Remove django-shorturls with my own implementation, since it's incompatible with Django 2 and unmaintained

This commit is contained in:
Danielle McLean 2018-03-21 21:50:40 +11:00
parent 27e0cb9a34
commit 098284a617
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
18 changed files with 252 additions and 184 deletions

View file

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