13 lines
366 B
Python
13 lines
366 B
Python
from django.db import models
|
|
|
|
from url_shortener.utils import generate_random_string_3
|
|
|
|
|
|
class ShortUrl(models.Model):
|
|
alias = models.CharField(
|
|
max_length=120, unique=True, default=generate_random_string_3
|
|
)
|
|
target = models.URLField()
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|