shortener/src/redirect/models.py

15 lines
362 B
Python

from django.contrib.auth.models import AbstractUser
from django.db import models
class Redirect(models.Model):
short_code = models.CharField(max_length=250, blank=False, null=False, unique=True)
target_url = models.URLField()
def __str__(self):
return f"{self.short_code} => {self.target_url}"
class RedirectUser(AbstractUser):
pass