Ajout d'une catégorisation des figurines : champ 'sorte' (kind)
This commit is contained in:
@ -5,7 +5,7 @@ from figurines.models import Set
|
||||
|
||||
class FigurineInline(admin.TabularInline):
|
||||
model = Figurine
|
||||
fields = ('name', 'wish')
|
||||
fields = ('name', 'kind', 'wish')
|
||||
extra = 2
|
||||
|
||||
|
||||
|
21
collection/figurines/migrations/0004_add_figurines_kind.py
Normal file
21
collection/figurines/migrations/0004_add_figurines_kind.py
Normal file
@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.9 on 2018-01-20 20:54
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('figurines', '0003_auto_20180116_1756'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='figurine',
|
||||
name='kind',
|
||||
field=models.CharField(choices=[('character', 'Character'), ('vehicle', 'Vehicle'), ('world', 'World'), ('gadget', 'Gadget')], default='character', max_length=30, verbose_name='kind'),
|
||||
),
|
||||
]
|
@ -29,7 +29,24 @@ class Figurine(Item):
|
||||
TARGET_VERBOSE_NAME = _('set')
|
||||
RELATED_TARGET_NAME = 'figurines'
|
||||
|
||||
# No more status choices thant "CREATED"
|
||||
# No more status choices than "CREATED"
|
||||
|
||||
# Figurines can be Character, vehicle, world or gadget (weapon)
|
||||
CHARACTER = 'character'
|
||||
VEHICLE = 'vehicle'
|
||||
WORLD = 'world'
|
||||
GADGET = 'gadget'
|
||||
KIND_CHOICES = (
|
||||
(CHARACTER, _('Character')),
|
||||
(VEHICLE, _('Vehicle')),
|
||||
(WORLD, _('World')),
|
||||
(GADGET, _('Gadget')),
|
||||
)
|
||||
kind = models.CharField(
|
||||
max_length=30,
|
||||
choices=KIND_CHOICES,
|
||||
default=CHARACTER,
|
||||
verbose_name=_('kind'))
|
||||
|
||||
wish = models.BooleanField(
|
||||
default=False,
|
||||
|
Reference in New Issue
Block a user