Changes between Version 2 and Version 3 of Ticket #36225, comment 11
- Timestamp:
- Sep 25, 2025, 10:46:48 AM (36 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36225, comment 11
v2 v3 1 1 Reopened #35729 as a usability issue in the serialization framework that model subclasses cannot opt out of natural key serialization. 2 2 3 This issue was opened after OP bit the bullet and reimplemented the User model from scratch. I agree it's not correct for createsuperuser to deduce from `field.unique` that `get_by_natural_key()` exists, given that we've doc'dyou can deliberately omit `get_by_natural_key()` and also that USERNAME_FIELD can be non-unique.3 This issue was opened after OP bit the bullet and reimplemented the User model from scratch. I agree it's not correct for createsuperuser to deduce from `field.unique` that `get_by_natural_key()` exists, given that we've [https://github.com/django/django/blob/46bd92274c57fd6f138c067562696092732cec59/docs/topics/serialization.txt#L635 doc'd] you can deliberately omit `get_by_natural_key()` and also that USERNAME_FIELD can be non-unique. 4 4 5 5 Catching `AttributeError` here seems reasonable.