Create role models

This commit is contained in:
Jan Tuomi
2017-06-07 18:00:08 +03:00
parent b37d5f2f55
commit eea8c19f50
+33
View File
@@ -1,5 +1,6 @@
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
class Tag(models.Model):
@@ -35,3 +36,35 @@ class InfoTr(models.Model):
topic = models.CharField(max_length=255)
content = models.TextField()
translation_for = models.ForeignKey('Info', related_name='translations')
class BaseRole(models.Model):
'''
Base model for occupations/roles
'''
name = models.TextField(_('Name'))
is_board = models.BooleanField(_('Board member'))
class PresetRole(BaseRole):
'''
Model representing a preset occupation in the guild
'''
description = models.TextField(_('Description'))
summary = models.TextField(_('Summary'))
class CustomRole(BaseRole):
'''
Model representing a user-specified custom occupation
'''
pass
class Role(PresetRole):
'''
Model representing an active or historical occupation
in an official's history
'''
start_date = models.DateField(_('Start date'))
end_date = models.DateField(_('End date'))