Re: [Django] #16379: Override UserManager

2011-07-07 Thread Django
#16379: Override UserManager
-+-
   Reporter:  thibaultj  |  Owner:  nobody
   Type:  Bug| Status:  closed
  Milestone: |  Component:  contrib.auth
Version:  1.3|   Severity:  Normal
 Resolution:  invalid|   Keywords:
   Triage Stage: |  auth,user,manager,usermanager
  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 This is more a usage question than a bug in Django, and apollo13 provided
 a solution.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #16379: Override UserManager

2011-06-30 Thread Django
#16379: Override UserManager
-+-
   Reporter:  thibaultj  |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  contrib.auth
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage: |  auth,user,manager,usermanager
  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
Changes (by apollo13):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Use https://docs.djangoproject.com/en/dev/ref/signals/#class-prepared to
 attach to the User class registration and then use
 ''manager.contribute_to_class'' to attach your manager. Even if it doesn't
 work, I don't think anything should be changed now since app-refactor will
 provide that afaik.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #16379: Override UserManager

2011-06-30 Thread Django
#16379: Override UserManager
---+--
 Reporter:  thibaultj  |  Owner:  nobody
 Type:  Bug| Status:  new
Milestone: |  Component:  contrib.auth
  Version:  1.3|   Severity:  Normal
 Keywords:  auth,user,manager,usermanager  |   Triage Stage:  Unreviewed
Has patch:  0  |  Easy pickings:  0
UI/UX:  0  |
---+--
 In contrib.auth, the User class is affected a custom UserManager manager.
 I cannot find any clean way to override this manager, or to define a new
 one.

 This is a problem in the following case: I created a middleware to manage
 acl. So in every request, I need to access request.user.profile.something.
 I'd like to override the get_query_set() method of the UserManager, to use
 select_related().

 The only possible solution seems to monkey patch user class in a
 middleware, as suggested here :
 http://stackoverflow.com/questions/6518280/override-usermanager-in-django

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.