From a291e44b8336dbf1b115e6a452cc4bd5482b101f Mon Sep 17 00:00:00 2001
From: tcaxle
Date: Fri, 17 Apr 2020 23:25:06 +0100
Subject: [PATCH] The CSS continues... Episode III: Abilities. Features include
ability types and support for custom abilities
---
app/admin.py | 8 +
app/migrations/0004_auto_20200417_2126.py | 526 ++++++++++++++++++++++
app/migrations/0005_auto_20200417_2128.py | 330 ++++++++++++++
app/models.py | 483 +++++---------------
static/css/style.css | 2 +-
templates/characterDetail.html | 443 +-----------------
6 files changed, 995 insertions(+), 797 deletions(-)
create mode 100644 app/migrations/0004_auto_20200417_2126.py
create mode 100644 app/migrations/0005_auto_20200417_2128.py
diff --git a/app/admin.py b/app/admin.py
index 94b6460..a6ff766 100644
--- a/app/admin.py
+++ b/app/admin.py
@@ -3,6 +3,11 @@ from .models import *
admin.site.register(RollConfiguration)
+admin.site.register(PropertyBase)
+admin.site.register(PropertyAttribute)
+admin.site.register(PropertyAbility)
+admin.site.register(PropertyStatic)
+
admin.site.register(ModifierAttribute)
admin.site.register(ModifierAbility)
admin.site.register(ModifierStatic)
@@ -29,6 +34,9 @@ admin.site.register(CharacterMortal)
admin.site.register(CharacterExaltSolar)
admin.site.register(CharacterExaltLunar)
+admin.site.register(OwnershipPropertyAttribute)
+admin.site.register(OwnershipPropertyAbility)
+admin.site.register(OwnershipPropertyStatic)
admin.site.register(OwnershipItem)
admin.site.register(OwnershipItemWeapon)
admin.site.register(OwnershipItemArmor)
diff --git a/app/migrations/0004_auto_20200417_2126.py b/app/migrations/0004_auto_20200417_2126.py
new file mode 100644
index 0000000..52a29c9
--- /dev/null
+++ b/app/migrations/0004_auto_20200417_2126.py
@@ -0,0 +1,526 @@
+# Generated by Django 3.0.5 on 2020-04-17 21:26
+
+import app.models
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('contenttypes', '0002_remove_content_type_name'),
+ ('app', '0003_auto_20200416_1911'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='PropertyBase',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', app.models.NameField(max_length=100, verbose_name='Name')),
+ ('description', app.models.DescriptionField(blank=True, max_length=1000, verbose_name='Description')),
+ ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_app.propertybase_set+', to='contenttypes.ContentType')),
+ ],
+ options={
+ 'abstract': False,
+ 'base_manager_name': 'objects',
+ },
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='appearance',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='archery',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='athletics',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='awareness',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='brawl',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='bureaucracy',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='charisma',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='craft',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='dexterity',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='dodge',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='integrity',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='intelligence',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='investigation',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='larceny',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='linguistics',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='lore',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='manipulation',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='martialArts',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='medicine',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='melee',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='occult',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='perception',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='performance',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='presence',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='resistance',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='ride',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='sail',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='socialize',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='stamina',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='stealth',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='strength',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='survival',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='thrown',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='war',
+ ),
+ migrations.RemoveField(
+ model_name='characterbase',
+ name='wits',
+ ),
+ migrations.AlterField(
+ model_name='characterexaltbase',
+ name='characterbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterBase'),
+ ),
+ migrations.AlterField(
+ model_name='characterexaltlunar',
+ name='characterexaltbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterExaltBase'),
+ ),
+ migrations.AlterField(
+ model_name='characterexaltsolar',
+ name='characterexaltbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterExaltBase'),
+ ),
+ migrations.AlterField(
+ model_name='charactermortal',
+ name='characterbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmbase',
+ name='effectbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmevocation',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmevocation',
+ name='key',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.ItemBase', verbose_name='Artifact'),
+ ),
+ migrations.AlterField(
+ model_name='charmlunar',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmlunarshape',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmmartialart',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmsolar',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='effectbase',
+ name='modifiers',
+ field=app.models.NamedManyToManyField(blank=True, to='app.ModifierBase', verbose_name='Modifiers'),
+ ),
+ migrations.AlterField(
+ model_name='effectbase',
+ name='rollConfiguration',
+ field=app.models.NamedManyToManyField(blank=True, to='app.RollConfiguration', verbose_name='Roll Configurations'),
+ ),
+ migrations.AlterField(
+ model_name='intimacybase',
+ name='character',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='intimacy_set', to='app.CharacterBase', verbose_name='Character'),
+ ),
+ migrations.AlterField(
+ model_name='intimacyprincipal',
+ name='intimacybase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.IntimacyBase'),
+ ),
+ migrations.AlterField(
+ model_name='intimacytie',
+ name='intimacybase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.IntimacyBase'),
+ ),
+ migrations.AlterField(
+ model_name='item',
+ name='itembase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
+ ),
+ migrations.AlterField(
+ model_name='itemarmor',
+ name='itembase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
+ ),
+ migrations.AlterField(
+ model_name='itemweaponbase',
+ name='itembase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
+ ),
+ migrations.AlterField(
+ model_name='itemweaponmelee',
+ name='itemweaponbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemWeaponBase'),
+ ),
+ migrations.AlterField(
+ model_name='itemweaponranged',
+ name='itemweaponbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemWeaponBase'),
+ ),
+ migrations.AlterField(
+ model_name='merit',
+ name='effectbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
+ ),
+ migrations.AlterField(
+ model_name='modifierability',
+ name='modifierbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
+ ),
+ migrations.AlterField(
+ model_name='modifierattribute',
+ name='modifierbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
+ ),
+ migrations.AlterField(
+ model_name='modifierstatic',
+ name='modifierbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmevocation',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmEvocation_set', to='app.CharacterExaltBase', verbose_name='Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmevocation',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmevocation',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmEvocationTarget_set', to='app.CharmEvocation', verbose_name='Evocation'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunar',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunar_set', to='app.CharacterExaltLunar', verbose_name='Lunar Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunar',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunar',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarTarget_set', to='app.CharmLunar', verbose_name='Lunar Charm'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunarshape',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarShape_set', to='app.CharacterExaltLunar', verbose_name='Lunar Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunarshape',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunarshape',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarShapeTarget_set', to='app.CharmLunarShape', verbose_name='Lunar Shape'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmmartialart',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmMartialArt_set', to='app.CharacterExaltBase', verbose_name='Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmmartialart',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmmartialart',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmMartialArtTarget_set', to='app.CharmMartialArt', verbose_name='Martial Arts Charm'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmsolar',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmSolar_set', to='app.CharacterExaltSolar', verbose_name='Solar Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmsolar',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmsolar',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmSolarTarget_set', to='app.CharmSolar', verbose_name='Solar Charm'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitem',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItem_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitem',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitem',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemTarget_set', to='app.Item', verbose_name='Item'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemarmor',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemArmor_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemarmor',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemarmor',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemArmorTarget_set', to='app.ItemArmor', verbose_name='Armor'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemweapon',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemWeapon_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemweapon',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemweapon',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemWeaponTarget_set', to='app.ItemWeaponBase', verbose_name='Weapon'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipmerit',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipMerit_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipmerit',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipmerit',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipMeritTarget_set', to='app.Merit', verbose_name='Merit'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipspeciality',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipSpeciality_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipspeciality',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipspeciality',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipSpecialityTarget_set', to='app.Speciality', verbose_name='Speciality'),
+ ),
+ migrations.AlterField(
+ model_name='speciality',
+ name='effectbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
+ ),
+ migrations.CreateModel(
+ name='PropertyAbility',
+ fields=[
+ ('propertybase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.PropertyBase')),
+ ('propertyType', app.models.SingleChoiceField(blank=True, choices=[('War', 'War'), ('Life', 'Life'), ('Wisdom', 'Wisdom'), ('Additional', 'Additional')], max_length=100, verbose_name='Type')),
+ ],
+ options={
+ 'abstract': False,
+ 'base_manager_name': 'objects',
+ },
+ bases=('app.propertybase',),
+ ),
+ migrations.CreateModel(
+ name='PropertyAttribute',
+ fields=[
+ ('propertybase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.PropertyBase')),
+ ('propertyType', app.models.SingleChoiceField(blank=True, choices=[('Physical', 'Physical'), ('Social', 'Social'), ('Mental', 'Mental')], max_length=100, verbose_name='Type')),
+ ('core', app.models.NamedBooleanField(default=False, verbose_name='Core?')),
+ ],
+ options={
+ 'abstract': False,
+ 'base_manager_name': 'objects',
+ },
+ bases=('app.propertybase',),
+ ),
+ migrations.CreateModel(
+ name='PropertyStatic',
+ fields=[
+ ('propertybase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.PropertyBase')),
+ ],
+ options={
+ 'abstract': False,
+ 'base_manager_name': 'objects',
+ },
+ bases=('app.propertybase',),
+ ),
+ migrations.CreateModel(
+ name='OwnershipStatic',
+ fields=[
+ ('ownershipbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase')),
+ ('character', app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.CharacterBase', verbose_name='Owner')),
+ ('target', app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.PropertyStatic', verbose_name='Static')),
+ ],
+ options={
+ 'abstract': False,
+ 'base_manager_name': 'objects',
+ },
+ bases=('app.ownershipbase',),
+ ),
+ migrations.CreateModel(
+ name='OwnershipPropertyAttribute',
+ fields=[
+ ('ownershipbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase')),
+ ('value', app.models.NamedIntegerField(default=0, help_text=None, verbose_name='Dots')),
+ ('character', app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipPropertyAttribute_set', to='app.CharacterBase', verbose_name='Owner')),
+ ('target', app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipPropertyAttributeTarget_set', to='app.PropertyAttribute', verbose_name='Attribute')),
+ ],
+ options={
+ 'abstract': False,
+ 'base_manager_name': 'objects',
+ },
+ bases=('app.ownershipbase',),
+ ),
+ migrations.CreateModel(
+ name='OwnershipPropertyAbility',
+ fields=[
+ ('ownershipbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase')),
+ ('value', app.models.NamedIntegerField(default=0, help_text=None, verbose_name='Dots')),
+ ('character', app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.CharacterBase', verbose_name='Owner')),
+ ('target', app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.PropertyAbility', verbose_name='Ability')),
+ ],
+ options={
+ 'abstract': False,
+ 'base_manager_name': 'objects',
+ },
+ bases=('app.ownershipbase',),
+ ),
+ ]
diff --git a/app/migrations/0005_auto_20200417_2128.py b/app/migrations/0005_auto_20200417_2128.py
new file mode 100644
index 0000000..cc1ae37
--- /dev/null
+++ b/app/migrations/0005_auto_20200417_2128.py
@@ -0,0 +1,330 @@
+# Generated by Django 3.0.5 on 2020-04-17 21:28
+
+import app.models
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('contenttypes', '0002_remove_content_type_name'),
+ ('app', '0004_auto_20200417_2126'),
+ ]
+
+ operations = [
+ migrations.RenameModel(
+ old_name='OwnershipStatic',
+ new_name='OwnershipPropertyStatic',
+ ),
+ migrations.AlterField(
+ model_name='characterexaltbase',
+ name='characterbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterBase'),
+ ),
+ migrations.AlterField(
+ model_name='characterexaltlunar',
+ name='characterexaltbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterExaltBase'),
+ ),
+ migrations.AlterField(
+ model_name='characterexaltsolar',
+ name='characterexaltbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterExaltBase'),
+ ),
+ migrations.AlterField(
+ model_name='charactermortal',
+ name='characterbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmbase',
+ name='effectbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmevocation',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmevocation',
+ name='key',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.ItemBase', verbose_name='Artifact'),
+ ),
+ migrations.AlterField(
+ model_name='charmlunar',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmlunarshape',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmmartialart',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='charmsolar',
+ name='charmbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
+ ),
+ migrations.AlterField(
+ model_name='effectbase',
+ name='modifiers',
+ field=app.models.NamedManyToManyField(blank=True, to='app.ModifierBase', verbose_name='Modifiers'),
+ ),
+ migrations.AlterField(
+ model_name='effectbase',
+ name='rollConfiguration',
+ field=app.models.NamedManyToManyField(blank=True, to='app.RollConfiguration', verbose_name='Roll Configurations'),
+ ),
+ migrations.AlterField(
+ model_name='intimacybase',
+ name='character',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='intimacy_set', to='app.CharacterBase', verbose_name='Character'),
+ ),
+ migrations.AlterField(
+ model_name='intimacyprincipal',
+ name='intimacybase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.IntimacyBase'),
+ ),
+ migrations.AlterField(
+ model_name='intimacytie',
+ name='intimacybase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.IntimacyBase'),
+ ),
+ migrations.AlterField(
+ model_name='item',
+ name='itembase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
+ ),
+ migrations.AlterField(
+ model_name='itemarmor',
+ name='itembase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
+ ),
+ migrations.AlterField(
+ model_name='itemweaponbase',
+ name='itembase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
+ ),
+ migrations.AlterField(
+ model_name='itemweaponmelee',
+ name='itemweaponbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemWeaponBase'),
+ ),
+ migrations.AlterField(
+ model_name='itemweaponranged',
+ name='itemweaponbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemWeaponBase'),
+ ),
+ migrations.AlterField(
+ model_name='merit',
+ name='effectbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
+ ),
+ migrations.AlterField(
+ model_name='modifierability',
+ name='modifierbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
+ ),
+ migrations.AlterField(
+ model_name='modifierattribute',
+ name='modifierbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
+ ),
+ migrations.AlterField(
+ model_name='modifierstatic',
+ name='modifierbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmevocation',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmEvocation_set', to='app.CharacterExaltBase', verbose_name='Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmevocation',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmevocation',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmEvocationTarget_set', to='app.CharmEvocation', verbose_name='Evocation'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunar',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunar_set', to='app.CharacterExaltLunar', verbose_name='Lunar Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunar',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunar',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarTarget_set', to='app.CharmLunar', verbose_name='Lunar Charm'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunarshape',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarShape_set', to='app.CharacterExaltLunar', verbose_name='Lunar Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunarshape',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmlunarshape',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarShapeTarget_set', to='app.CharmLunarShape', verbose_name='Lunar Shape'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmmartialart',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmMartialArt_set', to='app.CharacterExaltBase', verbose_name='Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmmartialart',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmmartialart',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmMartialArtTarget_set', to='app.CharmMartialArt', verbose_name='Martial Arts Charm'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmsolar',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmSolar_set', to='app.CharacterExaltSolar', verbose_name='Solar Exalted Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmsolar',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipcharmsolar',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmSolarTarget_set', to='app.CharmSolar', verbose_name='Solar Charm'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitem',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItem_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitem',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitem',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemTarget_set', to='app.Item', verbose_name='Item'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemarmor',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemArmor_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemarmor',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemarmor',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemArmorTarget_set', to='app.ItemArmor', verbose_name='Armor'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemweapon',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemWeapon_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemweapon',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipitemweapon',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemWeaponTarget_set', to='app.ItemWeaponBase', verbose_name='Weapon'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipmerit',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipMerit_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipmerit',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipmerit',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipMeritTarget_set', to='app.Merit', verbose_name='Merit'),
+ ),
+ migrations.AlterField(
+ model_name='ownershippropertyability',
+ name='character',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershippropertyability',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershippropertyattribute',
+ name='character',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipPropertyAttribute_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershippropertyattribute',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershippropertystatic',
+ name='character',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershippropertystatic',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipspeciality',
+ name='owner',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipSpeciality_set', to='app.CharacterBase', verbose_name='Owner'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipspeciality',
+ name='ownershipbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
+ ),
+ migrations.AlterField(
+ model_name='ownershipspeciality',
+ name='target',
+ field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipSpecialityTarget_set', to='app.Speciality', verbose_name='Speciality'),
+ ),
+ migrations.AlterField(
+ model_name='speciality',
+ name='effectbase_ptr',
+ field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
+ ),
+ ]
diff --git a/app/models.py b/app/models.py
index d9f21bd..061212b 100644
--- a/app/models.py
+++ b/app/models.py
@@ -71,6 +71,19 @@ ABILITIES = [
),
]
+ATTRIBUTE_TYPES = [
+ ("Physical", "Physical"),
+ ("Social", "Social"),
+ ("Mental", "Mental"),
+]
+
+ABILITY_TYPES = [
+ ("War", "War"),
+ ("Life", "Life"),
+ ("Wisdom", "Wisdom"),
+ ("Additional", "Additional")
+]
+
STATICS = [
("Natural Soak", "Natural Soak"),
("Armored Soak", "Armored Soak"),
@@ -394,6 +407,23 @@ class RollConfiguration(PolymorphicModel):
botch = (successes == 0) and (1 in listRoll)
return successes, botch, listRoll, listExploded, listDisappeared
+#==============================================================================#
+#--------------------------------- PROPERTIES ---------------------------------#
+#==============================================================================#
+class PropertyBase(PolymorphicModel):
+ name = NameField()
+ description = DescriptionField()
+
+class PropertyAttribute(PropertyBase):
+ propertyType = SingleChoiceField("Type", ATTRIBUTE_TYPES)
+ core = NamedBooleanField("Core?")
+
+class PropertyAbility(PropertyBase):
+ propertyType = SingleChoiceField("Type", ABILITY_TYPES)
+
+class PropertyStatic(PropertyBase):
+ propertyType = None
+
#==============================================================================#
#--------------------------------- MODIFIERS ----------------------------------#
#==============================================================================#
@@ -426,7 +456,7 @@ class CharacterBase(PolymorphicModel):
return self.name
#======== MODIFIER METHODS ========#
- def effectModifier(self, keyword):
+ def effectModifier(self, PropertyBase):
modifier = 0
try:
ownerships = [ownership for ownership in ownershipBase.objects.all() if (ownership.owner == self) and (ownership.active)]
@@ -445,357 +475,28 @@ class CharacterBase(PolymorphicModel):
concept = models.TextField(blank=True)
#=========== ATTRIBUTES ===========#
- strength = DotField("Strength")
- def attributeStrength(self):
- return self.strength + self.effectModifier("Strength")
- def dotsStrength(self):
- output = []
- for i in range(self.strength):
- output.append(True)
- for i in range(5 - self.strength):
- output.append(False)
- return output
- dexterity = DotField("Dexterity")
- def attributeDexterity(self):
- return self.dexterity + self.effectModifier("Dexterity")
- def dotsDexterity(self):
- output = []
- for i in range(self.dexterity):
- output.append(True)
- for i in range(5 - self.dexterity):
- output.append(False)
- return output
- stamina = DotField("Stamina")
- def attributeStamina(self):
- return self.stamina + self.effectModifier("Stamina")
- def dotsStamina(self):
- output = []
- for i in range(self.stamina):
- output.append(True)
- for i in range(5 - self.stamina):
- output.append(False)
- return output
- charisma = DotField("Charisma")
- def attributeCharisma(self):
- return self.charisma + self.effectModifier("Charisma")
- def dotsCharisma(self):
- output = []
- for i in range(self.charisma):
- output.append(True)
- for i in range(5 - self.charisma):
- output.append(False)
- return output
- manipulation = DotField("Manipulation")
- def attributeManipulation(self):
- return self.manipulation + self.effectModifier("Manipulation")
- def dotsManipulation(self):
- output = []
- for i in range(self.manipulation):
- output.append(True)
- for i in range(5 - self.manipulation):
- output.append(False)
- return output
- appearance = DotField("Apperance")
- def attributeAppearance(self):
- return self.appearance + self.effectModifier("Appearance")
- def dotsAppearance(self):
- output = []
- for i in range(self.appearance):
- output.append(True)
- for i in range(5 - self.appearance):
- output.append(False)
- return output
- perception = DotField("Perception")
- def attributePerception(self):
- return self.perception + self.effectModifier("Perception")
- def dotsPerception(self):
- output = []
- for i in range(self.perception):
- output.append(True)
- for i in range(5 - self.perception):
- output.append(False)
- return output
- intelligence = DotField("Intelligence")
- def attributeIntelligence(self):
- return self.intelligence + self.effectModifier("Intelligence")
- def dotsIntelligence(self):
- output = []
- for i in range(self.intelligence):
- output.append(True)
- for i in range(5 - self.intelligence):
- output.append(False)
- return output
- wits = DotField("Wits")
- def attributeWits(self):
- return self.wits + self.effectModifier("Wits")
- def dotsWits(self):
- output = []
- for i in range(self.wits):
- output.append(True)
- for i in range(5 - self.wits):
- output.append(False)
- return output
+ # Reverse Reference
+ def attributeSet(self):
+ try:
+ return [ownership.target for ownership in self.OwnershipPropertyAttribute_set.all()]
+ except:
+ return None
#=========== ABILITIES ============#
- archery = DotField("Archery")
- def abilityArchery(self):
- return self.archery + self.effectModifier("Archery")
- def dotsArchery(self):
+ # Reverse Reference
+ def abilitySet(self):
output = []
- for i in range(self.archery):
- output.append(True)
- for i in range(5 - self.archery):
- output.append(False)
- return output
- athletics = DotField("Athletics")
- def abilityAthletics(self):
- return self.athletics + self.effectModifier("Athletics")
- def dotsAthletics(self):
- output = []
- for i in range(self.athletics):
- output.append(True)
- for i in range(5 - self.athletics):
- output.append(False)
- return output
- awareness = DotField("Awareness")
- def abilityAwareness(self):
- return self.awareness + self.effectModifier("Awareness")
- def dotsAwareness(self):
- output = []
- for i in range(self.awareness):
- output.append(True)
- for i in range(5 - self.awareness):
- output.append(False)
- return output
- brawl = DotField("Brawl")
- def abilityBrawl(self):
- return self.brawl + self.effectModifier("Brawl")
- def dotsBrawl(self):
- output = []
- for i in range(self.brawl):
- output.append(True)
- for i in range(5 - self.brawl):
- output.append(False)
- return output
- bureaucracy = DotField("Bureaucracy")
- def abilityBureaucracy(self):
- return self.bureaucracy + self.effectModifier("Bureaucracy")
- def dotsBureaucracy(self):
- output = []
- for i in range(self.bureaucracy):
- output.append(True)
- for i in range(5 - self.bureaucracy):
- output.append(False)
- return output
- craft = DotField("Craft")
- def abilityCraft(self):
- return self.craft + self.effectModifier("Craft")
- def dotsCraft(self):
- output = []
- for i in range(self.craft):
- output.append(True)
- for i in range(5 - self.craft):
- output.append(False)
- return output
- dodge = DotField("Dodge")
- def abilityDodge(self):
- return self.dodge + self.effectModifier("Dodge")
- def dotsDodge(self):
- output = []
- for i in range(self.dodge):
- output.append(True)
- for i in range(5 - self.dodge):
- output.append(False)
- return output
- integrity = DotField("Integrity")
- def abilityIntegrity(self):
- return self.integrity + self.effectModifier("Integrity")
- def dotsIntegrity(self):
- output = []
- for i in range(self.integrity):
- output.append(True)
- for i in range(5 - self.integrity):
- output.append(False)
- return output
- investigation = DotField("Investigation")
- def abilityInvestigation(self):
- return self.investigation + self.effectModifier("Investigation")
- def dotsInvestigation(self):
- output = []
- for i in range(self.investigation):
- output.append(True)
- for i in range(5 - self.investigation):
- output.append(False)
- return output
- larceny = DotField("Larceny")
- def abilityLarceny(self):
- return self.larceny + self.effectModifier("Larceny")
- def dotsLarceny(self):
- output = []
- for i in range(self.larceny):
- output.append(True)
- for i in range(5 - self.larceny):
- output.append(False)
- return output
- linguistics = DotField("Linguistics")
- def abilityLinguistics(self):
- return self.linguistics + self.effectModifier("Linguistics")
- def dotsLinguistics(self):
- output = []
- for i in range(self.linguistics):
- output.append(True)
- for i in range(5 - self.linguistics):
- output.append(False)
- return output
- lore = DotField("Lore")
- def abilityLore(self):
- return self.lore + self.effectModifier("Lore")
- def dotsLore(self):
- output = []
- for i in range(self.lore):
- output.append(True)
- for i in range(5 - self.lore):
- output.append(False)
- return output
- martialArts = DotField("MartialArts")
- def abilityMartialArts(self):
- return self.martialArts + self.effectModifier("Martial Arts")
- def dotsMartialArts(self):
- output = []
- for i in range(self.martialArts):
- output.append(True)
- for i in range(5 - self.martialArts):
- output.append(False)
- return output
- medicine = DotField("Medicine")
- def abilityMedicine(self):
- return self.medicine + self.effectModifier("Medicine")
- def dotsMedicine(self):
- output = []
- for i in range(self.medicine):
- output.append(True)
- for i in range(5 - self.medicine):
- output.append(False)
- return output
- melee = DotField("Melee")
- def abilityMelee(self):
- return self.melee + self.effectModifier("Melee")
- def dotsMelee(self):
- output = []
- for i in range(self.melee):
- output.append(True)
- for i in range(5 - self.melee):
- output.append(False)
- return output
- occult = DotField("Occult")
- def abilityOccult(self):
- return self.occult + self.effectModifier("Occult")
- def dotsOccult(self):
- output = []
- for i in range(self.occult):
- output.append(True)
- for i in range(5 - self.occult):
- output.append(False)
- return output
- performance = DotField("Performance")
- def abilityPerformance(self):
- return self.performance + self.effectModifier("Performance")
- def dotsPerformance(self):
- output = []
- for i in range(self.performance):
- output.append(True)
- for i in range(5 - self.performance):
- output.append(False)
- return output
- presence = DotField("Presence")
- def abilityPresence(self):
- return self.presence + self.effectModifier("Presence")
- def dotsPresence(self):
- output = []
- for i in range(self.presence):
- output.append(True)
- for i in range(5 - self.presence):
- output.append(False)
- return output
- resistance = DotField("Resistance")
- def abilityResistance(self):
- return self.resistance + self.effectModifier("Resistance")
- def dotsResistance(self):
- output = []
- for i in range(self.resistance):
- output.append(True)
- for i in range(5 - self.resistance):
- output.append(False)
- return output
- ride = DotField("Ride")
- def abilityRide(self):
- return self.ride + self.effectModifier("Ride")
- def dotsRide(self):
- output = []
- for i in range(self.ride):
- output.append(True)
- for i in range(5 - self.ride):
- output.append(False)
- return output
- sail = DotField("Sail")
- def abilitySail(self):
- return self.sail + self.effectModifier("Sail")
- def dotsSail(self):
- output = []
- for i in range(self.sail):
- output.append(True)
- for i in range(5 - self.sail):
- output.append(False)
- return output
- socialize = DotField("Socialize")
- def abilitySocialize(self):
- return self.socialize + self.effectModifier("Socialize")
- def dotsSocialize(self):
- output = []
- for i in range(self.socialize):
- output.append(True)
- for i in range(5 - self.socialize):
- output.append(False)
- return output
- stealth = DotField("Stealth")
- def abilityStealth(self):
- return self.stealth + self.effectModifier("Stealth")
- def dotsStealth(self):
- output = []
- for i in range(self.stealth):
- output.append(True)
- for i in range(5 - self.stealth):
- output.append(False)
- return output
- survival = DotField("Survival")
- def abilitySurvival(self):
- return self.survival + self.effectModifier("Survival")
- def dotsSurvival(self):
- output = []
- for i in range(self.survival):
- output.append(True)
- for i in range(5 - self.survival):
- output.append(False)
- return output
- thrown = DotField("Thrown")
- def abilityThrown(self):
- return self.thrown + self.effectModifier("Thrown")
- def dotsThrown(self):
- output = []
- for i in range(self.thrown):
- output.append(True)
- for i in range(5 - self.thrown):
- output.append(False)
- return output
- war = DotField("War")
- def abilityWar(self):
- return self.war + self.effectModifier("War")
- def dotsWar(self):
- output = []
- for i in range(self.war):
- output.append(True)
- for i in range(5 - self.war):
- output.append(False)
+ try:
+ ownerships = self.ownershipPropertyAbility_set.order_by("target__name")
+ output.append(("War", [ownership for ownership in ownerships if ownership.target.propertyType=="War"]))
+ output.append(("Life", [ownership for ownership in ownerships if ownership.target.propertyType=="Life"]))
+ output.append(("Wisdom", [ownership for ownership in ownerships if ownership.target.propertyType=="Wisdom"]))
+ output.append(("Additional", [ownership for ownership in ownerships if ownership.target.propertyType=="Additional"]))
+ except:
+ output.append(("War", []))
+ output.append(("Life", []))
+ output.append(("Wisdom", []))
+ output.append(("Additional", []))
return output
#============= MERITS =============#
@@ -940,35 +641,35 @@ class CharacterBase(PolymorphicModel):
return output
#============ STATICS =============#
- def resolve(self, speciality=None, mod=0):
- return mod + ceil((self.attributeWits() + self.abilityIntegrity()) / 2) + self.effectModifier("RESOLVE")
-
- def guile(self, speciality=None, mod=0):
- return mod + ceil((self.attributeManipulation() + self.abilitySocialize()) / 2) + self.effectModifier("GUILE")
-
- def soakNatural(self, mod=0):
- return mod + self.attributeStamina() + self.effectModifier("SOAK NATURAL")
-
- def soakArmored(self, mod=0):
- return mod + self.armorSoak()
-
- def soakTotal(self, mod=0):
- return mod + self.soakNatural() + self.soakArmored()
-
- def hardness(self, mod=0):
- return mod + self.armorHardness() + self.effectModifier("HARDNESS")
-
- def joinBattle(self, mod=0):
- return mod + self.attributeWits() + self.abilityAwareness() + 3 + self.effectModifier("JOIN BATTLE")
-
- def evasion(self, mod=0):
- return mod + ceil((self.attributeDexterity() + self.abilityDodge()) / 2) - self.armorMobilityPenalty() + self.effectModifier("EVASION")
-
- def rush(self, mod=0):
- return mod + self.attributeDexterity() + self.abilityAthletics() + self.effectModifier("RUSH")
-
- def disengage(self, mod=0):
- return mod + self.attributeDexterity() + self.abilityDodge() + self.effectModifier("DISENGAGE")
+# def resolve(self, speciality=None, mod=0):
+# return mod + ceil((self.attributeWits() + self.abilityIntegrity()) / 2) + self.effectModifier("RESOLVE")
+#
+# def guile(self, speciality=None, mod=0):
+# return mod + ceil((self.attributeManipulation() + self.abilitySocialize()) / 2) + self.effectModifier("GUILE")
+#
+# def soakNatural(self, mod=0):
+# return mod + self.attributeStamina() + self.effectModifier("SOAK NATURAL")
+#
+# def soakArmored(self, mod=0):
+# return mod + self.armorSoak()
+#
+# def soakTotal(self, mod=0):
+# return mod + self.soakNatural() + self.soakArmored()
+#
+# def hardness(self, mod=0):
+# return mod + self.armorHardness() + self.effectModifier("HARDNESS")
+#
+# def joinBattle(self, mod=0):
+# return mod + self.attributeWits() + self.abilityAwareness() + 3 + self.effectModifier("JOIN BATTLE")
+#
+# def evasion(self, mod=0):
+# return mod + ceil((self.attributeDexterity() + self.abilityDodge()) / 2) - self.armorMobilityPenalty() + self.effectModifier("EVASION")
+#
+# def rush(self, mod=0):
+# return mod + self.attributeDexterity() + self.abilityAthletics() + self.effectModifier("RUSH")
+#
+# def disengage(self, mod=0):
+# return mod + self.attributeDexterity() + self.abilityDodge() + self.effectModifier("DISENGAGE")
class CharacterMortal(CharacterBase):
def type(self):
@@ -1259,6 +960,32 @@ class OwnershipItemArmor(OwnershipBase):
target = NamedForeignKeyField("Armor", ItemArmor, related_name="ownershipItemArmorTarget_set")
owner = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipItemArmor_set")
+class OwnershipPropertyAttribute(OwnershipBase):
+ target = NamedForeignKeyField("Attribute", PropertyAttribute, related_name="ownershipPropertyAttributeTarget_set")
+ character = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipPropertyAttribute_set")
+ value = NamedIntegerField("Dots")
+ def dots(self):
+ output = []
+ for i in range(self.value):
+ output.append(True)
+ for i in range(5 - self.value):
+ output.append(False)
+ return output
+class OwnershipPropertyAbility(OwnershipBase):
+ target = NamedForeignKeyField("Ability", PropertyAbility, related_name="ownershipPropertyAbilityTarget_set")
+ character = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipPropertyAbility_set")
+ value = NamedIntegerField("Dots")
+ def dots(self):
+ output = []
+ for i in range(self.value):
+ output.append(True)
+ for i in range(5 - self.value):
+ output.append(False)
+ return output
+class OwnershipPropertyStatic(OwnershipBase):
+ target = NamedForeignKeyField("Static", PropertyStatic, related_name="ownershipPropertyStaticTarget_set")
+ character = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipPropertyStaticTarget_set")
+
class OwnershipCharmMartialArt(OwnershipBase):
target = NamedForeignKeyField("Martial Arts Charm", CharmMartialArt, related_name="ownershipCharmMartialArtTarget_set")
owner = NamedForeignKeyField("Exalted Owner", CharacterExaltBase, related_name="ownershipCharmMartialArt_set")
diff --git a/static/css/style.css b/static/css/style.css
index d7ade8e..a165487 100644
--- a/static/css/style.css
+++ b/static/css/style.css
@@ -218,7 +218,7 @@ h2:before, h2:after {
h3 {
font-size: 18px;
}
-h3:before, h2:after {
+h3:before, h3:after {
height: 2px;
}
h1:before, h1:after, h2:before, h2:after, h3:before, h3:after {
diff --git a/templates/characterDetail.html b/templates/characterDetail.html
index f979f1b..1de083b 100644
--- a/templates/characterDetail.html
+++ b/templates/characterDetail.html
@@ -24,424 +24,31 @@
{% endblock %}
{% block abilities %}
- Abilities
-
-
- Archery:
-
- {% for dot in object.dotsArchery %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
Hello I describe the archery
-
-
- Athletics:
-
- {% for dot in object.dotsAthletics %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Awareness:
-
- {% for dot in object.dotsAwareness %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Brawl:
-
- {% for dot in object.dotsBrawl %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Bureaucracy:
-
- {% for dot in object.dotsBureaucracy %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Craft:
-
- {% for dot in object.dotsCraft %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Dodge:
-
- {% for dot in object.dotsDodge %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Integrity:
-
- {% for dot in object.dotsIntegrity %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Investigation:
-
- {% for dot in object.dotsInvestigation %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Larceny:
-
- {% for dot in object.dotsLarceny %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Linguistics:
-
- {% for dot in object.dotsLinguistics %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Lore:
-
- {% for dot in object.dotsLore %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Martial Arts:
-
- {% for dot in object.dotsMartialArts %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Medicine:
-
- {% for dot in object.dotsMedicine %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Melee:
-
- {% for dot in object.dotsMelee %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Occult:
-
- {% for dot in object.dotsOccult %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Performance:
-
- {% for dot in object.dotsPerformance %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Presence:
-
- {% for dot in object.dotsPresence %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Resistance:
-
- {% for dot in object.dotsResistance %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Ride:
-
- {% for dot in object.dotsRide %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Sail:
-
- {% for dot in object.dotsSail %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Socialize:
-
- {% for dot in object.dotsSocialize %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Stealth:
-
- {% for dot in object.dotsStealth %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Survival:
-
- {% for dot in object.dotsSurvival %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- Thrown:
-
- {% for dot in object.dotsThrown %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
-
- War:
-
- {% for dot in object.dotsWar %}
- {% if dot %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
-
-
-
+ Abilities
+ {% for type, ownerships in object.abilitySet %}
+ {{ type }}
+ {% for ownership in ownerships %}
+
+ {{ ownership.target.name }}
+
+ {% for dot in ownership.dots %}
+ {% if dot %}
+
+ {% else %}
+
+ {% endif %}
+ {% endfor %}
+
+
+
+ {% if ownership.target.description %}
+ {{ ownership.target.description }}
+ {% else %}
+ No description found.
+ {% endif %}
+
+ {% endfor %}
+ {% endfor %}
{% endblock %}
{% block attributes %}