Hi,
I'm trying to add a custom view to a custom admin-site instance, as
documented there: 
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-views-to-admin-sites

In my rather small example project I've got this custom admin class.
It works just fine, I can register ModelAdmins and so on.

from urls.py
...
(r'^my/(.*)', myad.sites.my_site.root),
...

class CreationAdminSite(sites.AdminSite):
   def get_urls(self):
      urls = super(CreationAdminSite, self).get_urls()
      my_urls = patterns('',
         (r'^myview/$', 'mic.myad.views.show')
      )
      return my_urls + urls
my_site = CreationAdminSite()

Calling my/myview won't work however. (It should, right?)
The pattern shows up when introspecting with python manage.py shell

(InteractiveConsole)
>>> from mic.myad.sites import my_site
>>> my_site.get_urls()
[<RegexURLPattern None ^myview/$>, <RegexURLPattern admin_index ^$>,
<RegexURLPattern %sadmin_logout ^logout/$>, <RegexURLPattern
admin_password_change ^password_change/$>, <RegexURLPattern
admin_password_change_done ^password_change/done/$>, <RegexURLPattern
admin_jsi18n ^jsi18n/$>, <RegexURLPattern None ^r/(?P<content_type_id>
\d+)/(?P<object_id>.+)/$>, <RegexURLPattern admin_app_list ^(?
P<app_label>\w+)/$>]

The first pattern is right there, and so this should work or did I do
something wrong? I just can't see why this isn't working...



Any help would be greatly appreciated ;)


ps running 9832, "fresh" checkout

pps Same thing when trying to overwrite the get_urls() from a
ModelAdmin, that won't work also.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to