Remove django-shorturls with my own implementation, since it's incompatible with Django 2 and unmaintained
This commit is contained in:
parent
27e0cb9a34
commit
098284a617
18 changed files with 252 additions and 184 deletions
|
|
@ -8,6 +8,7 @@ from slugify import slugify
|
|||
from textwrap import shorten
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from lemonshort.short_url import short_url
|
||||
from meta.models import ModelMeta
|
||||
from model_utils.models import TimeStampedModel
|
||||
from users.models import Profile
|
||||
|
|
@ -148,6 +149,10 @@ class Entry(ModelMeta, TimeStampedModel):
|
|||
args.append(self.slug)
|
||||
return reverse('entries:entry_amp', args=args)
|
||||
|
||||
@property
|
||||
def short_url(self):
|
||||
return short_url(self)
|
||||
|
||||
@property
|
||||
def slug(self):
|
||||
return slugify(self.name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue