-# -*- coding: utf-8 -*-\r
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.\r
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.\r
#\r
from django.db import models\r
+from django.urls import reverse\r
from django.utils.translation import ugettext_lazy as _\r
\r
\r
def __str__(self):\r
return self.name\r
\r
- @models.permalink\r
def get_absolute_url(self):\r
- return 'libraries_catalog_view', [self.slug]\r
+ return reverse('libraries_catalog_view', args=[self.slug])\r
\r
\r
class Library(models.Model):\r
def __str__(self):\r
return self.name\r
\r
- @models.permalink\r
def get_absolute_url(self):\r
- return ('libraries_library_view', [self.catalog.slug, self.slug])\r
+ return reverse('libraries_library_view', args=[self.catalog.slug, self.slug])\r