#5921: [PATCH] Common parent class for User and AnonymousUser
-------------------------------+--------------------------------------------
Reporter:  [EMAIL PROTECTED]  |       Owner:  nobody      
  Status:  new                 |   Component:  Contrib apps
 Version:  SVN                 |    Keywords:              
   Stage:  Unreviewed          |   Has_patch:  1           
-------------------------------+--------------------------------------------
 Howdy!

 While I know of and respect Django's deference to Pythonic duck-typing, it
 would be helpful for {{{isinstance(obj, klass)}}} to confirm whether an
 object is a user or not, regardless of authentication. However User
 inherits solely from models.Model and !AnonymousUser inherits from object
 -- they have no common lineage despite common interface.

 This patch creates an abstract parent class for both User and
 !AnonymousUser so a check for {{{isinstance(obj,
 django.contrib.auth.models.UserClass)}}} returns True whether the user is
 authenticated or not.

 It provides this functionality without any other modification to the
 external interface, so there are no side-effects or other impacts of this
 change. I've tested it against the Django test suite and it passes.

 -jag

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5921>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to