charasheet/src/character/models/equipment.py

22 lines
693 B
Python
Raw Normal View History

2022-10-29 00:32:18 +02:00
from django.db import models
from django_extensions.db.models import TimeStampedModel
from common.models import UniquelyNamedModel
class Weapon(UniquelyNamedModel, TimeStampedModel, models.Model):
2022-10-31 00:20:55 +01:00
class Category(models.TextChoices):
MELEE = "MEL", "corps à corps"
RANGE = "RAN", "à distance"
NONE = "NON", "aucune"
2022-10-30 11:09:46 +01:00
damage = models.CharField(max_length=50, blank=True, verbose_name="dégâts")
special = models.TextField(blank=True, verbose_name="spécial")
2022-10-31 00:20:55 +01:00
category = models.CharField(
max_length=3, choices=Category.choices, default=Category.NONE
)
2022-10-30 11:09:46 +01:00
class Meta:
verbose_name = "Arme"
verbose_name_plural = "Armes"