예제 #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)