Exemple #1
0
 def get_urls(self):
     """ Returns the additional urls for the change view links """
     urls = super(UserAdmin, self).get_urls()
     admin_site = self.admin_site
     opts = self.model._meta
     new_urls = patterns("")
     for role in self.roles:
         new_urls += patterns("",
             url('^(\d+)/%s/$' % role.url_name,
                 wrap_admin_view(self, role().change_view),
                 name='%s_%s_%s_change' % (opts.app_label, opts.model_name, role.name)),
             url('^(\d+)/%s/delete/$' % role.url_name,
                 wrap_admin_view(self, role().delete_view),
                 name='%s_%s_%s_delete' % (opts.app_label, opts.model_name, role.name))
         )
     return new_urls + urls
Exemple #2
0
 def get_urls(self):
     """ add markdown preview url """
     urls = super(TicketAdmin, self).get_urls()
     my_urls = patterns('',
         (r'^preview/$', wrap_admin_view(self, self.message_preview_view))
     )
     return my_urls + urls
Exemple #3
0
 def get_urls(self):
     from django.conf.urls import url
     urls = super().get_urls()
     info = self.model._meta.app_label, self.model._meta.model_name
     urls.insert(
         0,
         url(r'^send-pending/$',
             wrap_admin_view(self, self.send_pending_view),
             name='%s_%s_send_pending' % info))
     return urls
Exemple #4
0
 def get_urls(self):
     from django.conf.urls import url
     urls = super(MessageAdmin, self).get_urls()
     info = self.model._meta.app_label, self.model._meta.model_name
     urls.insert(0,
         url(r'^send-pending/$',
             wrap_admin_view(self, self.send_pending_view),
             name='%s_%s_send_pending' % info)
     )
     return urls
Exemple #5
0
 def get_urls(self):
     """ Hooks select account url """
     urls = super(SelectPluginAdminMixin, self).get_urls()
     opts = self.model._meta
     info = opts.app_label, opts.model_name
     select_urls = [
         url("/select-plugin/$",
             wrap_admin_view(self, self.select_plugin_view),
             name='%s_%s_select_plugin' % info),
     ]
     return select_urls + urls
Exemple #6
0
 def get_urls(self):
     """ Hooks select account url """
     urls = super(SelectPluginAdminMixin, self).get_urls()
     opts = self.model._meta
     info = opts.app_label, opts.model_name
     select_urls = [
         url("select-plugin/$",
             wrap_admin_view(self, self.select_plugin_view),
             name='%s_%s_select_plugin' % info),
     ]
     return select_urls + urls
Exemple #7
0
 def get_urls(self):
     """ Hooks select account url """
     urls = super(AccountAdminMixin, self).get_urls()
     admin_site = self.admin_site
     opts = self.model._meta
     info = opts.app_label, opts.model_name
     account_list = AccountListAdmin(Account, admin_site).changelist_view
     select_urls = patterns("",
         url("/select-account/$",
             wrap_admin_view(self, account_list),
             name='%s_%s_select_account' % info),
     )
     return select_urls + urls 
Exemple #8
0
 def get_urls(self):
     """ Hooks select contact url """
     urls = super(ContractAdminMixin, self).get_urls()
     admin_site = self.admin_site
     opts = self.model._meta
     info = opts.app_label, opts.module_name
     contact_list = ContactListAdmin(Contact, admin_site).changelist_view
     select_urls = patterns("",
         url("/select-contact/$",
             wrap_admin_view(self, contact_list),
             name='%s_%s_select_contact' % info),
     )
     return select_urls + urls 
Exemple #9
0
 def get_urls(self):
     """ Hooks select account url """
     urls = super(AccountAdminMixin, self).get_urls()
     admin_site = self.admin_site
     opts = self.model._meta
     info = opts.app_label, opts.model_name
     account_list = AccountListAdmin(Account, admin_site).changelist_view
     select_urls = [
         url("add/select-account/$",
             wrap_admin_view(self, account_list),
             name='%s_%s_select_account' % info),
     ]
     return select_urls + urls
Exemple #10
0
 def get_urls(self):
     """ add markdown preview url """
     return [
         url(r'^preview/$',
             wrap_admin_view(self, self.message_preview_view))
     ] + super(TicketAdmin, self).get_urls()
Exemple #11
0
 def get_urls(self):
     """ add markdown preview url """
     return [
         url(r'^preview/$',
             wrap_admin_view(self, self.message_preview_view))
     ] + super(TicketAdmin, self).get_urls()