'Get the admin url for the page extension menu item, depending on whether a PageExtension instance exists
for the current page or not.
Return a tuple of the current extension and the url; the extension is None if no instance exists,
the url is None is no admin is registered for the extension.'

def get_page_extension_admin(self):

    page = self._get_page()
    try:
        page_extension = self.model.objects.get(extended_object_id=page.pk)
    except self.model.DoesNotExist:
        page_extension = None
    try:
        model_name = self.model.__name__.lower()
        if page_extension:
            admin_url = admin_reverse(('%s_%s_change' % (self.model._meta.app_label, model_name)), args=(page_extension.pk,))
        else:
            admin_url = ('%s?extended_object=%s' % (admin_reverse(('%s_%s_add' % (self.model._meta.app_label, model_name))), self.page.pk))
    except NoReverseMatch:
        admin_url = None
    return (page_extension, admin_url)
