#37139: InlineAdmin breaks when using db_default on primary key field without a
python default
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak):
To be clear, inlines are involved, but `uuid` with `db_default` is in the
main object not in the inlines.
Replying to [comment:2 Jacob Walls]:
> Reproduced on 5.2 with a project that had an equivalent custom function.
I think admin inlines require having a python default on the field.
🤔 I'm not sure I bu that argument. This way we could copy code of all new
features to the older version of Django and say it doesn't work there so
it is not a bug in the function 😉😉, sure it's not a direct bug in
`UUID7()` but a long standing issue in handling `DatabaseDefault` in
inlines, however people will try to use new functions and hit the same. I
need to check carefully why we pass an empty parent instance to the inline
form etc., admin is not my area of expertise.
--
Ticket URL: <
https://code.djangoproject.com/ticket/37139#comment:4>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.