コード例 #1
0
ファイル: models.py プロジェクト: yfcheung/myrg
 def get_admin_url(self):
     """
     Returns the admin URL to edit the object represented by this log entry.
     """
     if self.content_type and self.object_id:
         url_name = 'admin:%s_%s_change' % (self.content_type.app_label, self.content_type.model)
         try:
             return reverse(url_name, args=(quote(self.object_id),))
         except NoReverseMatch:
             pass
     return None
コード例 #2
0
ファイル: models.py プロジェクト: yfcheung/myrg
 def get_admin_url(self):
     """
     Returns the admin URL to edit the object represented by this log entry.
     """
     if self.content_type and self.object_id:
         url_name = 'admin:%s_%s_change' % (self.content_type.app_label,
                                            self.content_type.model)
         try:
             return reverse(url_name, args=(quote(self.object_id), ))
         except NoReverseMatch:
             pass
     return None
コード例 #3
0
ファイル: admin_urls.py プロジェクト: yfcheung/myrg
def admin_urlquote(value):
    return quote(value)
コード例 #4
0
ファイル: main.py プロジェクト: yfcheung/myrg
 def url_for_result(self, result):
     pk = getattr(result, self.pk_attname)
     return reverse('admin:%s_%s_change' % (self.opts.app_label,
                                            self.opts.model_name),
                    args=(quote(pk),),
                    current_app=self.model_admin.admin_site.name)
コード例 #5
0
ファイル: admin_urls.py プロジェクト: yfcheung/myrg
def admin_urlquote(value):
    return quote(value)