On Wed, 2006-08-02 at 02:53 -0700, [EMAIL PROTECTED] wrote: > I would like to make a link to the admin for certain objects on the > public page, so that someone who has the acces rights, can click the > link, log in, and fix whatever he wants fixed. Is there an easy way to > do this, like a get_admin_url() or something?
The edit page for an item will be /admin/<app_name>/<model_name>/<id> (replacing the relevant bits in <..>). That is assuming your top-level urls.py sends /admin/ to the admin interface, of course. Given an object, you can construct the relevant URL using: id = object.id model_name = object.__class__.__name__.lower() app_name = object._meta.app_label Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---