Finish
This commit is contained in:
12
short_url/models.py
Normal file
12
short_url/models.py
Normal file
@ -0,0 +1,12 @@
|
||||
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)
|
Reference in New Issue
Block a user