From 1f1226ee6c264067590cccf390ff71c41150e667 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sat, 19 Dec 2020 18:44:03 +0100 Subject: [PATCH] Create slug model --- litl/models.py | 26 ++++++++++++++++++++++++++ litl/settings.py | 1 + 2 files changed, 27 insertions(+) create mode 100644 litl/models.py diff --git a/litl/models.py b/litl/models.py new file mode 100644 index 0000000..1aed24b --- /dev/null +++ b/litl/models.py @@ -0,0 +1,26 @@ +# coding: utf-8 +# Author: Grizzly +# +# Models for litl. The main model keeps track of the the matching +# between the URLs and the custom suffix. + +from django.db import models + +class Slug(models.Model): + + slug = models.SlugField( + max_length=20, + null=False, + blank=False, + help_text="Slug of the new URL. Up to 20 caracters including letters, number, underscores and hyphens.",) + destination = models.CharField( + max_length=300, + null=False, + blank=False, + help_text="The destination URL, limited to 300 characters.",) + uid = models.CharField( + max_length=100, + null=True,) + date = models.DateTimeField( + auto_now=True,) + diff --git a/litl/settings.py b/litl/settings.py index 6490344..3cdbdc6 100644 --- a/litl/settings.py +++ b/litl/settings.py @@ -30,6 +30,7 @@ ALLOWED_HOSTS = ['litl.auro.re',] # Application definition INSTALLED_APPS = [ + 'litl', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes',