Ejemplo n.º 1
0
    def __init__(self, document, admin_site, base_url, admin_options):
        AdminAwareDocumentAdmin.__init__(self, document, admin_site)
        self.base_url = base_url
        self.resolver = CMSURLResolver(r'^' + base_url, self.get_urls())

        if admin_options.list_display:
            self.list_display = admin_options.list_display
        if admin_options.list_per_page:
            self.list_per_page = admin_options.list_per_page
Ejemplo n.º 2
0
class VirtualDocumentAdmin(AdminAwareDocumentAdmin):
    def __init__(self, document, admin_site, base_url, admin_options):
        AdminAwareDocumentAdmin.__init__(self, document, admin_site)
        self.base_url = base_url
        self.resolver = CMSURLResolver(r'^' + base_url, self.get_urls())

        if admin_options.list_display:
            self.list_display = admin_options.list_display
        if admin_options.list_per_page:
            self.list_per_page = admin_options.list_per_page

    def reverse(self, name, *args, **kwargs):
        ret = self.resolver.reverse(name, *args, **kwargs)
        return self.base_url + ret

    def get_base_breadcrumbs(self, top=False):
        admin_name = self.admin_site.name
        model_name = self.model._meta.verbose_name
        opts = self.model._meta
        breadcrumbs = [
            Breadcrumb('Home', ['%s:index' % admin_name]),
            Breadcrumb(opts.app_label,
                       ['%s:index' % admin_name]),  #TODO app listing support
        ]
        if top:
            breadcrumbs.append(Breadcrumb(opts.verbose_name_plural))
        else:
            breadcrumbs.append(
                Breadcrumb(opts.verbose_name_plural,
                           self.reverse('%s_changelist' % self.app_name)))
        return breadcrumbs
Ejemplo n.º 3
0
class VirtualDocumentAdmin(AdminAwareDocumentAdmin):
    def __init__(self, document, admin_site, base_url, admin_options):
        AdminAwareDocumentAdmin.__init__(self, document, admin_site)
        self.base_url = base_url
        self.resolver = CMSURLResolver(r'^'+base_url, self.get_urls())
        
        if admin_options.list_display:
            self.list_display = admin_options.list_display
        if admin_options.list_per_page:
            self.list_per_page = admin_options.list_per_page
    
    def reverse(self, name, *args, **kwargs):
        ret = self.resolver.reverse(name, *args, **kwargs)
        return self.base_url + ret
    
    def get_base_breadcrumbs(self, top=False):
        admin_name = self.admin_site.name
        model_name = self.model._meta.verbose_name
        opts = self.model._meta
        breadcrumbs = [
            Breadcrumb('Home', ['%s:index' % admin_name]),
            Breadcrumb(opts.app_label, ['%s:index' % admin_name]), #TODO app listing support
        ]
        if top:
            breadcrumbs.append(Breadcrumb(opts.verbose_name_plural))
        else:
            breadcrumbs.append(Breadcrumb(opts.verbose_name_plural, self.reverse('%s_changelist' % self.app_name)))
        return breadcrumbs
Ejemplo n.º 4
0
class VirtualDocumentAdmin(AdminAwareDocumentAdmin):
    def __init__(self, document, admin_site, base_url):
        AdminAwareDocumentAdmin.__init__(self, document, admin_site)
        self.base_url = base_url
        self.resolver = CMSURLResolver(r'^'+base_url, self.get_urls())
    
    def reverse(self, name, *args, **kwargs):
        ret = self.resolver.reverse(name, *args, **kwargs)
        return self.base_url + ret
Ejemplo n.º 5
0
 def __init__(self, document, admin_site, base_url, admin_options):
     AdminAwareDocumentAdmin.__init__(self, document, admin_site)
     self.base_url = base_url
     self.resolver = CMSURLResolver(r'^'+base_url, self.get_urls())
     
     if admin_options.list_display:
         self.list_display = admin_options.list_display
     if admin_options.list_per_page:
         self.list_per_page = admin_options.list_per_page
Ejemplo n.º 6
0
 def get_resolver(self):
     from dockitcms.common import CMSURLResolver
     urls = self.get_urls()
     return CMSURLResolver(r'^' + self.base_url, urls)
Ejemplo n.º 7
0
 def __init__(self, document, admin_site, base_url):
     AdminAwareDocumentAdmin.__init__(self, document, admin_site)
     self.base_url = base_url
     self.resolver = CMSURLResolver(r'^'+base_url, self.get_urls())