2017-08-22 19:02:43 +00:00
|
|
|
from core.models import Collection, Item, Timeline as BaseTimeline
|
2017-08-16 20:00:41 +00:00
|
|
|
from django.db import models
|
2017-08-17 20:42:48 +00:00
|
|
|
from django.utils.translation import ugettext as _
|
2017-08-16 20:00:41 +00:00
|
|
|
|
|
|
|
|
2017-08-22 19:02:43 +00:00
|
|
|
class Console(Collection):
|
2017-08-16 20:00:41 +00:00
|
|
|
"""
|
|
|
|
All console, system or box that can be used to play video games.
|
|
|
|
"""
|
|
|
|
def __str__(self):
|
|
|
|
return '%s' % self.name
|
2017-08-16 20:07:40 +00:00
|
|
|
|
|
|
|
|
2017-08-22 19:02:43 +00:00
|
|
|
class Game(Item):
|
2017-08-16 20:07:40 +00:00
|
|
|
"""
|
|
|
|
A video game you will use on a specific Console.
|
|
|
|
"""
|
2017-08-22 19:02:43 +00:00
|
|
|
# class config
|
|
|
|
TARGET_MODEL = 'games.Console'
|
|
|
|
TARGET_VERBOSE_NAME = _('console')
|
|
|
|
RELATED_TARGET_NAME = 'games'
|
|
|
|
|
2017-08-17 20:42:48 +00:00
|
|
|
# Status choices
|
2017-08-22 19:02:43 +00:00
|
|
|
BEATEN = 'beaten'
|
|
|
|
COMPLETED = 'completed'
|
|
|
|
EXCLUDED = 'excluded'
|
|
|
|
MASTERED = 'mastered'
|
|
|
|
UNFINISHED = 'unfinished'
|
2017-08-17 20:42:48 +00:00
|
|
|
|
|
|
|
STATUS_CHOICES = (
|
|
|
|
(BEATEN, _('Beaten')),
|
|
|
|
(COMPLETED, _('Completed')),
|
|
|
|
(EXCLUDED, _('Excluded')),
|
|
|
|
(MASTERED, _('Mastered')),
|
2017-08-22 19:02:43 +00:00
|
|
|
(UNFINISHED, _('Unfinished')),
|
2017-08-17 20:42:48 +00:00
|
|
|
)
|
2017-08-22 19:02:43 +00:00
|
|
|
DEFAULT_CHOICE = UNFINISHED
|
2017-08-17 20:42:48 +00:00
|
|
|
|
|
|
|
# others
|
|
|
|
playing = models.BooleanField(default=False)
|
|
|
|
unplayed = models.BooleanField(default=False)
|
|
|
|
wish = models.BooleanField(default=False)
|
2017-08-16 20:07:40 +00:00
|
|
|
|
2017-08-17 20:42:48 +00:00
|
|
|
class Meta:
|
|
|
|
ordering = ('-playing', 'name')
|
2017-08-22 19:02:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Timeline(BaseTimeline):
|
|
|
|
TARGET_MODEL = 'games.Game'
|
|
|
|
STATUS_CHOICES = Game.STATUS_CHOICES
|
|
|
|
DEFAULT_CHOICE = Item.DEFAULT_CHOICE
|