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

This commit is contained in:
Jonas Havelka 2023-08-10 12:39:11 +02:00
parent 6bb39fc0a0
commit 9ac0d06e1e
2 changed files with 3 additions and 2 deletions

View file

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

View file

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