Files
pi-ux-ce 0aebb19650
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
generate new urls based on the urlData form
2026-07-07 10:47:24 +01:00

28 lines
1.1 KiB
Python

from django.db import models
from datetime import datetime
from django.utils.timezone import make_aware
EPOCH = make_aware(datetime(1970, 1, 1))
class SimpsonsData(models.Model):
season = models.IntegerField()
episode = models.IntegerField()
url = models.CharField(max_length=1000)
seen = models.BooleanField()
modified_at = models.DateTimeField(default=EPOCH)
class Meta:
db_table = 'episodes'
class urlData(models.Model):
url_example = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=18&episode=5")
prefix = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=",blank=True, null=True)
infix = models.CharField(max_length=1000, help_text="&episode=",blank=True, null=True)
suffix = models.CharField(max_length=1000, help_text="" ,blank=True, null=True)
addedDate = models.DateField('Published', blank=True, null=True, auto_now_add=True)
class Meta:
db_table = 'redirectUrl'
simpsons_data_object = SimpsonsData.objects.using('simpsons_db')