Changes between Version 2 and Version 3 of Ticket #36225, comment 11


Ignore:
Timestamp:
Sep 25, 2025, 10:46:48 AM (36 hours ago)
Author:
Jacob Walls

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36225, comment 11

    v2 v3  
    11Reopened #35729 as a usability issue in the serialization framework that model subclasses cannot opt out of natural key serialization.
    22
    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'd you can deliberately omit `get_by_natural_key()` and also that USERNAME_FIELD can be non-unique.
     3This 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.
    44
    55Catching `AttributeError` here seems reasonable.
Back to Top