Re: [Django] #9602: Add admin.site._registry manipulation methods

2023-07-07 Thread Django
#9602: Add admin.site._registry manipulation methods
-+-
 Reporter:  Rob Hudson   |Owner:  Mariusz
 |  Felisiak
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  register modeladmin  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"2584783f46922bcb456ceb9700a3726314df65d3" 2584783]:
 {{{
 #!CommitTicketReference repository=""
 revision="2584783f46922bcb456ceb9700a3726314df65d3"
 Refs #9602 -- Moved AlreadyRegistered/NotRegistered exceptions to
 django.contrib.admin.exceptions.
 }}}

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701893016905f-539b71ca-714a-46fa-89dd-81f4f3da6481-00%40eu-central-1.amazonses.com.


Re: [Django] #9602: Add admin.site._registry manipulation methods

2023-07-06 Thread Django
#9602: Add admin.site._registry manipulation methods
-+-
 Reporter:  Rob Hudson   |Owner:  Mariusz
 |  Felisiak
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  register modeladmin  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by GitHub ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"f64fd47a7627ed6ffe2df2a32ded6ee528a784eb" f64fd47]:
 {{{
 #!CommitTicketReference repository=""
 revision="f64fd47a7627ed6ffe2df2a32ded6ee528a784eb"
 Fixed #9602 -- Added AdminSite.get_model_admin().

 This allows retrieving an admin class for the given model class without
 using internal attributes.
 }}}

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701892ef52e3a-2b3ed157-80f7-4ccd-920e-d04f0f7510bc-00%40eu-central-1.amazonses.com.


Re: [Django] #9602: Add admin.site._registry manipulation methods

2023-07-06 Thread Django
#9602: Add admin.site._registry manipulation methods
-+-
 Reporter:  Rob Hudson   |Owner:  Mariusz
 |  Felisiak
 Type:  New feature  |   Status:  assigned
Component:  contrib.admin|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  register modeladmin  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * owner:  anonymous => Mariusz Felisiak
 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/17049 PR]

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701892aabe403-39fd22e5-bb19-4882-bab4-7e34df6ef216-00%40eu-central-1.amazonses.com.


Re: [Django] #9602: Add admin.site._registry manipulation methods

2014-04-29 Thread Django
#9602: Add admin.site._registry manipulation methods
-+-
 Reporter:  robhudson|Owner:  anonymous
 Type:  New feature  |   Status:  assigned
Component:  contrib.admin|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  register modeladmin  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timo):

 * needs_docs:  1 => 0
 * has_patch:  1 => 0
 * version:  1.0 => master
 * easy:  1 => 0
 * needs_tests:  1 => 0


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.6b4b1216f352b586dcd07c4905418572%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #9602: Add admin.site._registry manipulation methods

2014-04-26 Thread Django
#9602: Add admin.site._registry manipulation methods
-+-
 Reporter:  robhudson|Owner:  anonymous
 Type:  New feature  |   Status:  assigned
Component:  contrib.admin|  Version:  1.0
 Severity:  Normal   |   Resolution:
 Keywords:  register modeladmin  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by anonymous):

 * status:  new => assigned
 * needs_tests:  0 => 1
 * easy:  0 => 1
 * owner:  nobody => anonymous
 * needs_docs:  0 => 1
 * has_patch:  0 => 1


Comment:

 useradmin = admin.site._registry.get(User, None)
 if useradmin:
 useradmin.list_display = useradmin.list_display + ('is_superuser',)
 else:
 class MyUserAdmin(AuthUserAdmin):
 list_display = ('username', 'email', 'first_name', 'last_name',
 'is_staff', 'is_superuser')
 admin.site.register(User, MyUserAdmin)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.93a37155408bed69840aaab3d5e68f57%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #9602: Add admin.site._registry manipulation methods

2011-09-27 Thread Django
#9602: Add admin.site._registry manipulation methods
-+-
   Reporter:  robhudson  |  Owner:  nobody
   Type:  New| Status:  new
  feature|  Component:  contrib.admin
  Milestone: |   Severity:  Normal
Version:  1.0|   Keywords:  register modeladmin
 Resolution: |  Has patch:  0
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by julien):

 * ui_ux:   => 0
 * easy:   => 0
 * stage:  Design decision needed => Accepted


Comment:

 Accepting that there should be a cleaner API for interacting with the
 registry. However the third point ("provide methods to update common
 `ModelAdmin` options") doesn't seem so useful.

-- 
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] #9602: Add admin.site._registry manipulation methods

2009-02-26 Thread Django
#9602: Add admin.site._registry manipulation methods
-+--
  Reporter:  robhudson   | Owner:  nobody   
  
Status:  new | Milestone:   
  
 Component:  django.contrib.admin|   Version:  1.0  
  
Resolution:  |  Keywords:  register 
modeladmin
 Stage:  Design decision needed  | Has_patch:  0
  
Needs_docs:  0   |   Needs_tests:  0
  
Needs_better_patch:  0   |  
-+--
Changes (by jacob):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Design decision needed
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
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] #9602: Add admin.site._registry manipulation methods

2008-11-14 Thread Django
#9602: Add admin.site._registry manipulation methods
--+-
 Reporter:  robhudson |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  django.contrib.admin  | Version:  1.0   
 Keywords:  register modeladmin   |   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 This is a feature request...

 Currently, one can unregister a model from the admin and register it again
 with a new ModelAdmin.  The problem I'm anticipating is when 2 or more
 apps want to add ModelAdmin options to a Model and the last one wins.

 Not to point out a specific 3rd party app, but this is an easily contrived
 example... If I have my own apps and one of them unregisters the User
 model's ModelAdmin and registers its own that, say, adds the
 `is_superuser` to the list_display.  Then if I add the django-openid app
 that (currently) also unregisters the User model's ModelAdmin and
 registers its own that adds an inline to a ManyToManyField for the OpenID
 associations tied to that user.  If django-openid is after my app in the
 INSTALLED_APPS list, I lose my list_display override.  And if my app is
 after the django-openid app, I lose the OpenID associations inlines.
 (See: http://code.google.com/p/django-
 openid/source/browse/trunk/django_openid/admin.py)

 It's possible currently to write the unregistration/registration such that
 this doesn't happen, but it relies on pulling the ModelAdmin out of the
 "private" _registry dictionary in the admin.site class.  For example:

 {{{
 useradmin = admin.site._registry.get(User, None)
 if useradmin:
 useradmin.list_display = useradmin.list_display + ('is_superuser',)
 else:
 class MyUserAdmin(AuthUserAdmin):
 list_display = ('username', 'email', 'first_name', 'last_name',
 'is_staff', 'is_superuser')
 admin.site.register(User, MyUserAdmin)
 }}}

 I can think of a few ways of fixing this, from least involved to more
 involved:

 1. At the very least I think it would be nice if the internal `_registry`
 dictionary didn't have the prepended underscore to signify that it is a
 private variable not to be touched, so one doesn't feel dirty doing
 something like this.

 2. I think it would be a bit cleaner if there were methods to lookup, get,
 and update this dict and keep it as a private dict.  For example,
 something like `admin.site.get_model_admin(User)`?

 3. Along with 2, provide methods to update common ModelAdmin options, like
 `list_display`.  This one is definitely venturing into debatable area, but
 something like `useradmin.list_display.add('is_superuser')` takes much
 away from this feeling so "monkey patchy".

-- 
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---