mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-06-26 17:58:36 +02:00
22 lines
693 B
Python
22 lines
693 B
Python
from django.db import models
|
|
from django_extensions.db.models import TimeStampedModel
|
|
|
|
from common.models import UniquelyNamedModel
|
|
|
|
|
|
class Weapon(UniquelyNamedModel, TimeStampedModel, models.Model):
|
|
class Category(models.TextChoices):
|
|
MELEE = "MEL", "corps à corps"
|
|
RANGE = "RAN", "à distance"
|
|
NONE = "NON", "aucune"
|
|
|
|
damage = models.CharField(max_length=50, blank=True, verbose_name="dégâts")
|
|
special = models.TextField(blank=True, verbose_name="spécial")
|
|
category = models.CharField(
|
|
max_length=3, choices=Category.choices, default=Category.NONE
|
|
)
|
|
|
|
class Meta:
|
|
verbose_name = "Arme"
|
|
verbose_name_plural = "Armes"
|