Ajout du champ "shortname" sur les collections

master
Olivier DOSSMANN 2018-01-15 18:55:03 +01:00
parent 50f0361b91
commit a6dcad77d9
7 changed files with 81 additions and 19 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-18 19:39+0000\n"
"POT-Creation-Date: 2018-01-15 17:37+0000\n"
"PO-Revision-Date: 2017-09-16 17:16+0200\n"
"Last-Translator: Olivier DOSSMANN <git@dossmann.net>\n"
"Language-Team: \n"

View File

@ -7,29 +7,33 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-18 19:39+0000\n"
"PO-Revision-Date: 2017-09-18 21:23+0200\n"
"POT-Creation-Date: 2018-01-15 17:37+0000\n"
"PO-Revision-Date: 2018-01-15 18:38+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
"X-Generator: Poedit 2.0.5\n"
#: core/models.py:7 core/models.py:28
#: core/models.py:7 core/models.py:29
msgid "name"
msgstr "nom"
#: core/models.py:24
#: core/models.py:8
msgid "shortname"
msgstr "nom court"
#: core/models.py:25
msgid "New"
msgstr "Nouveau"
#: core/models.py:48 core/models.py:80
#: core/models.py:49 core/models.py:81
msgid "status"
msgstr "état"
#: core/models.py:65
#: core/models.py:66
msgid "date"
msgstr "date"

View File

@ -1,10 +1,12 @@
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext as _
class Collection(models.Model):
name = models.CharField(max_length=255, verbose_name=_('name'))
shortname = models.CharField(max_length=30, verbose_name=_('shortname'))
def __str__(self):
return '%s' % self.name
@ -20,9 +22,7 @@ class Item(models.Model):
# status choices
CREATED = 'created'
STATUS_CHOICES = (
(CREATED, _('New')),
)
STATUS_CHOICES = ((CREATED, _('New')), )
DEFAULT_CHOICE = CREATED
name = models.CharField(max_length=255, verbose_name=_('name'))
@ -70,8 +70,7 @@ class Timeline(models.Model):
Add new field 'item' which is a link to TARGET_MODEL
"""
target_field = models.ForeignKey(
cls.TARGET_MODEL,
verbose_name=_(cls.TARGET_VERBOSE_NAME))
cls.TARGET_MODEL, verbose_name=_(cls.TARGET_VERBOSE_NAME))
target_field.contribute_to_class(cls, 'item')
status_field = models.CharField(
max_length=30,
@ -81,11 +80,9 @@ class Timeline(models.Model):
status_field.contribute_to_class(cls, 'status')
def __str__(self):
return '%s: %s - %s' % (
self.date.strftime('%Y-%m-%d'),
self.status,
self.item)
return '%s: %s - %s' % (self.date.strftime('%Y-%m-%d'), self.status,
self.item)
class Meta:
abstract = True
ordering = ('-date',)
ordering = ('-date', )

View File

@ -2,15 +2,19 @@
pk: 1
fields:
name: Amiibo
shortname: Amiibo
- model: figurines.set
pk: 2
fields:
name: Disney Infinity
shortname: Infinity
- model: figurines.set
pk: 3
fields:
name: Lego Dimensions
shortname: LD
- model: figurines.set
pk: 4
fields:
name: Skylanders
name: "Skylanders Serie 1: Spyro's adventure"
shortname: Skylanders

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-01-15 17:30
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('figurines', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='set',
name='shortname',
field=models.CharField(
default='TODO: Add shortname',
max_length=30,
verbose_name='shortname'), ),
]

View File

@ -2,43 +2,54 @@
pk: 1
fields:
name: Steam
shortname: Steam
- model: games.platform
pk: 2
fields:
name: Game Boy
shortname: Game Boy
- model: games.platform
pk: 3
fields:
name: Nintendo 3DS
shortname: 3DS
- model: games.platform
pk: 4
fields:
name: Nintendo Switch
shortname: Switch
- model: games.platform
pk: 5
fields:
name: PC
shortname: PC
- model: games.platform
pk: 6
fields:
name: Genesis / Mega Drive
shortname: GEN
- model: games.platform
pk: 7
fields:
name: Nintendo Entertainment System
shortname: NES
- model: games.platform
pk: 8
fields:
name: PlayStation
shortname: PS
- model: games.platform
pk: 9
fields:
name: PlayStation 3
shortname: PS3
- model: games.platform
pk: 10
fields:
name: PlayStation 4
shortname: PS4
- model: games.platform
pk: 11
fields:
name: Wii
shortname: Wii

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-01-15 17:30
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('games', '0009_add_help_text_for_documentation'),
]
operations = [
migrations.AddField(
model_name='platform',
name='shortname',
field=models.CharField(
default='TODO: Add shortname',
max_length=30,
verbose_name='shortname'), ),
]