20 lines
434 B
Python
20 lines
434 B
Python
from django.db import models
|
|
|
|
|
|
class Collection(models.Model):
|
|
name = models.CharField(max_length=64)
|
|
|
|
|
|
class Card(models.Model):
|
|
name = models.CharField(max_length=128)
|
|
collection = models.ForeignKey(
|
|
Collection,
|
|
on_delete=models.CASCADE,
|
|
related_name="cards",
|
|
related_query_name="card",
|
|
)
|
|
image = models.ImageField(upload_to="cards/")
|
|
|
|
class Meta:
|
|
ordering = ["name"]
|