You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
843 B
Python
31 lines
843 B
Python
# 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=True,
|
|
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,)
|
|
|
|
def __str__(self):
|
|
return '{} -> {:.10}'.format(self.slug,self.destination)
|
|
|
|
|