X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/967eed676fc83d15b26149047f353ac61faa8217..da1171ae5f512c20c68a0616b3157ae9927a6f1f:/src/libraries/models.py diff --git a/src/libraries/models.py b/src/libraries/models.py index 0ad058610..56e9b2d4f 100644 --- a/src/libraries/models.py +++ b/src/libraries/models.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.urls import reverse +from django.utils.translation import gettext_lazy as _ class Catalog(models.Model): @@ -19,9 +19,8 @@ class Catalog(models.Model): def __str__(self): return self.name - @models.permalink def get_absolute_url(self): - return 'libraries_catalog_view', [self.slug] + return reverse('libraries_catalog_view', args=[self.slug]) class Library(models.Model): @@ -40,6 +39,5 @@ class Library(models.Model): def __str__(self): return self.name - @models.permalink def get_absolute_url(self): - return ('libraries_library_view', [self.catalog.slug, self.slug]) + return reverse('libraries_library_view', args=[self.catalog.slug, self.slug])