Created
August 20, 2021 09:02
-
-
Save wselfjes/605678f746bdfdb5c9f1ba53aca8d687 to your computer and use it in GitHub Desktop.
Anna's models design
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class NameDescription: | |
name = models.CharField(max_length=30) | |
description = models.TextField(blank=True) | |
class ToAll: | |
characters = models.ManyToManyField('lore.Character') | |
events = models.ManyToManyField('lore.Event') | |
factions = models.ManyToManyField('lore.Faction') | |
items = models.ManyToManyField('lore.Item') | |
places = models.ManyToManyField('lore.Place') | |
class Item(models.Model, NameDescription, ToAll): | |
pass | |
class Character(models.Model, NameDescription, ToAll): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment