Handling db_default? #9257
Unanswered
shangxiao
asked this question in
Potential Issue
Replies: 1 comment
-
may be we could see/try with some example use cases of the new features and then decide based on the outcomes? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Django 5.0 introduces
db_default
, this now raises the question: should DRF be aware of fields with db_default set?Aside from whether DRF could potentially evaluate a
db_default
expression, it does have an affect on therequired
attribute during introspection, since required is determined based on the presence of field default.The workaround for now is to manually set
required
toFalse
inextra_kwargs
if you have adb_default
.Beta Was this translation helpful? Give feedback.
All reactions