47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
from core.models import Collection, Item, Timeline
|
|
from django.db import models
|
|
from django.utils.translation import ugettext as _
|
|
|
|
|
|
class Set(Collection):
|
|
"""
|
|
Common name used to describe a set of characters, objects or vehicles
|
|
"""
|
|
def __str__(self):
|
|
return '%s' % self.name
|
|
|
|
class Meta:
|
|
ordering = ('name',)
|
|
verbose_name = _('set')
|
|
verbose_name_plural = _('sets')
|
|
|
|
# Redefine help_text (for documentation, API, etc.)
|
|
Set._meta.get_field('name').help_text = _('Usual name of figurines set.')
|
|
|
|
|
|
class Figurine(Item):
|
|
"""
|
|
A character, a gadget, a vehicle or a world used on a Game to use specific
|
|
levels, abilities, etc.
|
|
"""
|
|
# class config
|
|
TARGET_MODEL = 'figurines.Set'
|
|
TARGET_VERBOSE_NAME = _('set')
|
|
RELATED_TARGET_NAME = 'figurines'
|
|
|
|
# No more status choices thant "CREATED"
|
|
|
|
wish = models.BooleanField(
|
|
default=False,
|
|
verbose_name=_('wish?'),
|
|
help_text=_('You need this figurine.'))
|
|
|
|
class Meta:
|
|
ordering = ('name',)
|
|
|
|
|
|
# Redefine help_text (for documentation, API, etc.)
|
|
Figurine._meta.get_field('name').help_text = _('Figurine denomination')
|
|
Figurine._meta.get_field('collection').help_text = _('Becoming set')
|
|
Figurine._meta.get_field('status').help_text = _('Figurine progression')
|