#15294: Use named urls instead of hard coded ones in admin views
---------------------------------------+-------------------------------
               Reporter:  julien       |          Owner:  ramiro
                   Type:  New feature  |         Status:  new
              Milestone:               |      Component:  contrib.admin
                Version:  SVN          |       Severity:  Normal
             Resolution:               |       Keywords:
           Triage Stage:  Accepted     |      Has patch:  1
    Needs documentation:  1            |    Needs tests:  0
Patch needs improvement:  0            |  Easy pickings:  0
                  UI/UX:  0            |
---------------------------------------+-------------------------------

Comment (by julien):

 The "model_tag" replacement is very elegant, well done! I'm just a bit
 ambivalent with the name between "admin_url" (shorter and sexier) and
 "admin_url_name" (more explicit and accurate) -- although it's no big deal
 either way.

 Unfortunately I still can't reproduce those test errors with any
 permutations of `generic_inline_admin`, `admin_views` and `comment_tests`.
 However, from what you've described in IRC it does feel like there could
 be some conflicts relating to the order in which the models are registered
 in the admin. Perhaps those errors could be avoided by using a context
 manager:

 {{{#!python
 def test_blah(self):
     with override_admin((MyModel, MyModelAdmin), (MyAwesomeModel,
 MyAwesomeModelAdmin),):
         # Tests go here
         ...
 }}}

 On `__enter__()` the CM would back up potential modeladmins that are
 already registered, then unregister them, then register the ones provided
 as arguments. And on `__exit__()` the CM would re-register the backed up
 modeladmins.

 Just a thought!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/15294#comment:32>
Django <https://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 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.

Reply via email to