Gallery-Archivist/archivist/apps/importer/models.py

25 lines
718 B
Python

from django.db import models
from django.utils.translation import gettext_lazy as _
from apps.sites.models import Category
from apps.user.models import UserProfile
class ImportSourceURLs(models.Model):
url = models.URLField(unique=True)
category = models.ForeignKey(Category, on_delete=models.CASCADE)
added_by_user = models.ForeignKey(UserProfile, on_delete=models.CASCADE)
date_added = models.DateTimeField(auto_now_add=True, editable=True)
last_imported = models.DateTimeField(auto_now=True, editable=True)
class Meta:
verbose_name = _("Import Source URL")
verbose_name_plural = _("Import Source URLs")
def __str__(self):
return self.url