funquail/api/funkwhale_api/requests/models.py

23 lines
839 B
Python
Raw Normal View History

2018-02-21 00:02:48 +01:00
from django.db import models
from django.utils import timezone
2018-06-09 15:36:16 +02:00
NATURE_CHOICES = [("artist", "artist"), ("album", "album"), ("track", "track")]
2018-02-21 00:02:48 +01:00
STATUS_CHOICES = [
2018-06-09 15:36:16 +02:00
("pending", "pending"),
("accepted", "accepted"),
("imported", "imported"),
("closed", "closed"),
2018-02-21 00:02:48 +01:00
]
2018-02-21 00:02:48 +01:00
class ImportRequest(models.Model):
creation_date = models.DateTimeField(default=timezone.now)
imported_date = models.DateTimeField(null=True, blank=True)
user = models.ForeignKey(
2018-06-09 15:36:16 +02:00
"users.User", related_name="import_requests", on_delete=models.CASCADE
)
2018-02-21 00:02:48 +01:00
artist_name = models.CharField(max_length=250)
albums = models.CharField(max_length=3000, null=True, blank=True)
2018-06-09 15:36:16 +02:00
status = models.CharField(choices=STATUS_CHOICES, max_length=50, default="pending")
2018-02-21 00:02:48 +01:00
comment = models.TextField(null=True, blank=True, max_length=3000)