Další drobné úpravy: admin_url potřebuje app_label
This commit is contained in:
parent
6bb39fc0a0
commit
9ac0d06e1e
2 changed files with 3 additions and 2 deletions
|
@ -14,8 +14,9 @@ class SeminarModelBase(models.Model):
|
|||
# return "https://" + str(get_current_site(None)) + self.verejne_url()
|
||||
|
||||
def admin_url(self):
|
||||
app_name = self._meta.app_label
|
||||
model_name = self.__class__.__name__.lower()
|
||||
return reverse('admin:seminar_{}_change'.format(model_name), args=(self.id, ))
|
||||
return reverse('admin:{}_{}_change'.format(app_name, model_name), args=(self.id, ))
|
||||
|
||||
# def verejne_url(self):
|
||||
# return None
|
||||
|
|
|
@ -522,7 +522,7 @@ class Problem(SeminarModelBase,PolymorphicModel):
|
|||
return reverse('seminar_problem', kwargs={'pk': self.id})
|
||||
|
||||
def admin_url(self):
|
||||
return reverse('admin:seminar_problem_change', args=(self.id, ))
|
||||
return reverse('admin:tvorba_problem_change', args=(self.id, ))
|
||||
|
||||
@cached_property
|
||||
def hlavni_problem(self):
|
||||
|
|
Loading…
Reference in a new issue