Changes between Version 1 and Version 2 of Ticket #35223


Ignore:
Timestamp:
Feb 16, 2024, 2:27:50 PM (5 months ago)
Author:
Brian Ibbotson
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35223 – Description

    v1 v2  
    1 Starting to migrate models in my (large) project to use Django 5’s new db_default attribute for fields (using Django 5.0.2), encountering behavior contrary to my expectations.
     1Starting to migrate models in my (large) project to use Django 5’s new {{{db_default}}} attribute for fields (using Django 5.0.2), encountering behavior contrary to my expectations.
    22
    33A field with {{{db_default}}} raises a {{{ValidationError}}} when {{{full_clean()}}} called, if that field has been omitted from the {{{create()}}} call.
     
    55This is (to me) unexpected behavior. Would expect that no error would be raised, the instance would be saved successfully, with the specified {{{db_default}}} value set at the database level.
    66
    7 Has been explained to me in the Django forums that this is correct, that I should instead either
     7Has been explained to me in the Django forums that the {{{ValidationError}}} is correct, that I should instead either
    88
    99(1) explicitly choose to {{{exclude}}} the missing fields from {{{full_clean()}}} call,
Back to Top