__str__() methods, Specialties and Merits. Migrations.

This commit is contained in:
tcaxle 2020-04-11 15:40:33 +01:00
parent e73ad78787
commit 5c92a1fa53
6 changed files with 105 additions and 7 deletions

View File

@ -0,0 +1,34 @@
# Generated by Django 3.0.5 on 2020-04-11 14:31
import app.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0014_auto_20200411_1428'),
]
operations = [
migrations.AlterField(
model_name='charm',
name='modifierAbility',
field=app.models.NamedManyToManyField(blank=True, to='app.modifierAbility', verbose_name='Abilities Modifiers'),
),
migrations.AlterField(
model_name='charm',
name='modifierAttribute',
field=app.models.NamedManyToManyField(blank=True, to='app.modifierAttribute', verbose_name='Attribute Modifiers'),
),
migrations.AlterField(
model_name='charm',
name='modifierStatic',
field=app.models.NamedManyToManyField(blank=True, to='app.modifierStatic', verbose_name='Statics Modifiers'),
),
migrations.AlterField(
model_name='charm',
name='rollConfiguration',
field=app.models.NamedManyToManyField(blank=True, to='app.rollConfiguration', verbose_name='Roll Configurations'),
),
]

View File

@ -0,0 +1,39 @@
# Generated by Django 3.0.5 on 2020-04-11 14:39
import app.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0015_auto_20200411_1431'),
]
operations = [
migrations.AddField(
model_name='merit',
name='modifierAbility',
field=app.models.NamedManyToManyField(blank=True, to='app.modifierAbility', verbose_name='Abilities Modifiers'),
),
migrations.AddField(
model_name='merit',
name='modifierAttribute',
field=app.models.NamedManyToManyField(blank=True, to='app.modifierAttribute', verbose_name='Attribute Modifiers'),
),
migrations.AddField(
model_name='merit',
name='modifierStatic',
field=app.models.NamedManyToManyField(blank=True, to='app.modifierStatic', verbose_name='Statics Modifiers'),
),
migrations.AddField(
model_name='merit',
name='rollConfiguration',
field=app.models.NamedManyToManyField(blank=True, to='app.rollConfiguration', verbose_name='Roll Configurations'),
),
migrations.AddField(
model_name='speciality',
name='ability',
field=app.models.SingleChoiceField(blank=True, choices=[('War', (('ARCHERY', 'Archery'), ('ATHLETICS', 'Athletics'), ('AWARENESS', 'Awareness'), ('BRAWL', 'Brawl'), ('DODGE', 'Dodge'), ('INTEGRITY', 'Integrity'), ('MELEE', 'Melee'), ('RESISTANCE', 'Resistance'), ('THROWN', 'Thrown'), ('WAR', 'War'))), ('Life', (('CRAFT', 'Craft'), ('LARCENY', 'Larceny'), ('LINGUISTICS', 'Linguistics'), ('PERFORMANCE', 'Performance'), ('PRESENCE', 'Presence'), ('RIDE', 'Ride'), ('SAIL', 'Sail'), ('SOCIALISE', 'Socialise'), ('STEALTH', 'Stealth'), ('SURVIVAL', 'Survival'))), ('Wisdom', (('BUREAUCRACY', 'Bureaucracy'), ('INVESTIGATION', 'Investigation'), ('LORE', 'Lore'), ('MEDICINE', 'Medicine'), ('OCCULT', 'Occult')))], max_length=100, verbose_name='Ability'),
),
]

View File

@ -323,12 +323,21 @@ class modifierBase(models.Model):
value = NamedIntegerField("Modifier Value")
class modifierAttribute(modifierBase):
def __str__(self):
return "{} [{}]".format(self.attribute, self.value)
attribute = SingleChoiceField("Attribute", ATTRIBUTES)
class modifierAbility(modifierBase):
def __str__(self):
return "{} [{}]".format(self.ability, self.value)
ability = SingleChoiceField("Ability", ABILITIES)
class modifierStatic(modifierBase):
def __str__(self):
return "{} [{}]".format(self.static, self.value)
static = SingleChoiceField("Static", STATICS)
#==============================================================================#
@ -338,6 +347,9 @@ class itemBase(models.Model):
class Meta:
abstract = True
def __str__(self):
return self.name
name = NameField()
description = DescriptionField()
@ -384,6 +396,9 @@ class itemArmor(itemBase):
#----------------------------------- CHARMS -----------------------------------#
#==============================================================================#
class charm(models.Model):
def __str__(self):
return self.name
name = NameField()
description = DescriptionField()
modifierAttribute = NamedManyToManyField("Attribute Modifiers", modifierAttribute)
@ -395,21 +410,27 @@ class charm(models.Model):
#----------------------------------- MERITS -----------------------------------#
#==============================================================================#
class merit(models.Model):
def __str__(self):
return self.name
name = NameField()
description = DescriptionField()
dots = DotField("Dots")
# modifierAttribute
# modifierAbility
# modifierStatic
# rollConfiguration
modifierAttribute = NamedManyToManyField("Attribute Modifiers", modifierAttribute)
modifierAbility = NamedManyToManyField("Abilities Modifiers", modifierAbility)
modifierStatic = NamedManyToManyField("Statics Modifiers", modifierStatic)
rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration)
#==============================================================================#
#-------------------------------- SPECIALITIES --------------------------------#
#==============================================================================#
class speciality(models.Model):
def __str__(self):
return "[{}] {}".format(self.ability, self.name)
modifier = 2
name = NameField()
# ability
ability = SingleChoiceField("Ability", ABILITIES)
#==============================================================================#
#--------------------------------- INTIMACIES ---------------------------------#
@ -418,13 +439,14 @@ class intimacyBase(models.Model):
class Meta:
abstract = True
def __str__(self):
return "[{}] {}".format(self.description, self.intensity)
description = DescriptionField()
intensity = SingleChoiceField("Intensity", INTENSITIES)
pass
class intimacyTie(intimacyBase):
target = NamedCharField("Target")
pass
class intimacyPrincipal(intimacyBase):
pass
@ -436,6 +458,9 @@ class characterBase(models.Model):
class Meta:
abstract = True
def __str__(self):
return self.name
#============ GENERAL =============#
name = NameField()