Browse Source

Další drobné úpravy: admin_url potřebuje app_label

v3
Jonas Havelka 1 year ago
parent
commit
9ac0d06e1e
  1. 3
      seminar/models/base.py
  2. 2
      tvorba/models.py

3
seminar/models/base.py

@ -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

2
tvorba/models.py

@ -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…
Cancel
Save