Friday, March 23, 2012

reverse urls on admin

Hi,
I've overrided the get_urls() of one of my ModelAdmin in order to
provide some extra views. what I did is:

def get_urls(self):
"""Returns the additional urls used by the Contact admin."""
....
select_urls = patterns("",
url("^contract_pack/(?P<contact_id>\d+)/",
include(ContractPackAdmin(Pack, admin_site).get_urls()),
name="contract_pack"),)
return select_urls + urls

so now I'm trying to get the reverse url with reverse() but I've
failed on every try I did. I've tried with:

reverse('admin:"app_label"_"app_module"_contract_pack',
kwargs={'contact_id': 1})
reverse('admin:contract_pack', kwargs={'contact_id': 1})
reverse('contract_pack', kwargs={'contact_id': 1})

What acutally is the correct string for getting this url via reverse()?

Thanks!!!
--
Marc

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate