AnonymousUser should have a 'pk' attribute
|Reported by:||Chris Lamb||Owned by:|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I like the "pk" field on models as it means I can refer to the primary key of any instance without having to know some implementation detail about the model.
However, this idea breaks down with the AnonymousUser pseudo-model; it has an id element (of None) but it has no pk element. This requires some special-casing which I would like to be rid of.
Sure, it's not a real model. But if AnonymousUser has an 'id' element and can exist where a "real" auth.User may exist, it might as well have an 'pk' too.
Patch is trivial.
Change History (9)
comment:2 Changed 5 years ago by
|Component:||Uncategorized → contrib.auth|
|Summary:||AnonymousUser should have a 'pk' element → AnonymousUser should have a 'pk' attribute|
|Triage Stage:||Unreviewed → Accepted|
|Type:||Uncategorized → New feature|
comment:3 Changed 5 years ago by
|Owner:||changed from nobody to Stephen Muss|
|Status:||new → assigned|
comment:5 Changed 5 years ago by
|Owner:||Stephen Muss deleted|
|Status:||assigned → new|
|Version:||1.4 → SVN|