From c1abed0a0ce47f3e2dafffbd50fa5c2a204313a0 Mon Sep 17 00:00:00 2001 From: tcaxle Date: Sat, 11 Apr 2020 18:12:05 +0100 Subject: [PATCH] Solar and Lunar charms now separate subclass of charmBase --- app/__pycache__/admin.cpython-38.pyc | Bin 676 -> 707 bytes app/__pycache__/models.cpython-38.pyc | Bin 19799 -> 20373 bytes app/admin.py | 3 +- app/migrations/0010_auto_20200411_1711.py | 58 ++++++++++++++++++ .../0010_auto_20200411_1711.cpython-38.pyc | Bin 0 -> 2855 bytes app/models.py | 15 ++++- 6 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 app/migrations/0010_auto_20200411_1711.py create mode 100644 app/migrations/__pycache__/0010_auto_20200411_1711.cpython-38.pyc diff --git a/app/__pycache__/admin.cpython-38.pyc b/app/__pycache__/admin.cpython-38.pyc index 3ef2d18e602a0c998c5a7bc39ea0dd922318e378..81fc17552693da0e3a1cc844e84465783fc0a192 100644 GIT binary patch delta 105 zcmZ3&dYF|rl$V!_0SK&rO^ll~kyn=S$wckz9I1?1%nMjjMJN7KVHBIJ%(zmVD>);v xC^tAiC$Z=jgzZzBmsm9U5@SA_Bv5~mRofwxpkyn=S#zgJwlld4G7)2-RGp=M~P0mOx%ANe4F`rEW asH{k0atf0cdM7o36u>@}?ap5AOOxkpn6k{0_H}POQ(Lm9FIYjJ2oeU16qlW?&0v`r8)@CX9Rd8`59M1~xW z$1_B3Mye=_5|WS%w}U^dBC@Z=2RS0>2n)K6h!~M=ushqWGZ6C*Yk@r@W`gFNys73s z!!)uJT>**4xJ4U>cJ?}2!WL`2>Ng0}n_DHbXRZF;|ES+NmWKL@RX>}hM&DSL{NuoF zPI0)!;U;@tyTh{tbo7rIqD!nhw3|gEkI_Z85_wdy4EYN@uK|Ik3(Y&Ad4AJnYy7*` zIdq*}iQYihm@D=X-G(!7L@TVitp?37+-9Kf?0t0q&Q&PFcs2feY;Go0S!JV&msPf# zo^?pv+p?Z@_90l!UbP?cZ9ryjONPgR6HMzkgVq+z4i75ly->bj`j7)Rqr4v7fL6=g gdAR{TkTH`qA`mkV*wfBgWsh5QOPX7AX->EJ3(i&nQvd(} delta 538 zcmbO_pYi%EM!ry9UM>b8ko!3??oZ@IJ{iVy8?~F5L>aS`o0+3b+!<1mQj%L3Qj$}F zB9r$qDN36G#m#}@87Y}S@yt{Z-y(%6m_ajZvmCRbJyR0H_Ee4(=2XsR zrYO!-t`wG3ZXk;%l{ba8nK6nFD94t{4;0}Cve;7vfGhzZiz8JK$P!H9OyO!_h!RTS z1{%zBi#0hTu_$+PfU~=8AQJ;aF%UB_Fjnz`h4td&i%W{)<9`VU<>%xmIOpf3Wu})F zC6;97=M@(n1*)uKcT6tHEK9ZD{K?sdkuhenzN@?tA4GF*eoAIqW@?e2rtsuM4^7TA zp!%W=ATfEJtL)^fu7-jlKn@2Z2QwQZ8zUDGa!i(WQ=44wzK$_>vYN+g#m_+b9FVJo zkQ8!&m4cKPeV$xsE<2gub0K5xxYg$fr@{MHtzIl$XAfv!4phywO^dgWcMZYFLG!dVC&ySyR!Q^*-vp8jh1cZ2m HxCNL2M5c~g diff --git a/app/admin.py b/app/admin.py index f9c3162..27d062b 100644 --- a/app/admin.py +++ b/app/admin.py @@ -12,7 +12,8 @@ admin.site.register(itemWeaponMelee) admin.site.register(itemWeaponRanged) admin.site.register(itemArmor) -admin.site.register(charm) +admin.site.register(charmSolar) +admin.site.register(charmLunar) admin.site.register(merit) diff --git a/app/migrations/0010_auto_20200411_1711.py b/app/migrations/0010_auto_20200411_1711.py new file mode 100644 index 0000000..eb614de --- /dev/null +++ b/app/migrations/0010_auto_20200411_1711.py @@ -0,0 +1,58 @@ +# Generated by Django 3.0.5 on 2020-04-11 17:11 + +import app.models +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('app', '0009_auto_20200411_1706'), + ] + + operations = [ + migrations.CreateModel( + name='charmLunar', + 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')), + ('levelEssence', app.models.NamedIntegerField(default=0, help_text=None, verbose_name='Essence Level')), + ('levelKey', app.models.NamedIntegerField(default=0, help_text=None, verbose_name='Key Level')), + ('active', app.models.NamedBooleanField(default=False, verbose_name='Active?')), + ('attribute', app.models.SingleChoiceField(blank=True, choices=[('Physical', (('STR', 'Srength'), ('DEX', 'Dexterity'), ('STA', 'Stamina'))), ('Social', (('CHA', 'Charisma'), ('MAN', 'Manipulation'), ('APP', 'Appearance'))), ('Mental', (('PER', 'Perception'), ('INT', 'Intelligence'), ('WIT', 'Wits')))], max_length=100, verbose_name='Key Attribute')), + ('character', app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.characterBase', verbose_name='Character')), + ('modifierAbility', app.models.NamedManyToManyField(blank=True, to='app.modifierAbility', verbose_name='Abilities Modifiers')), + ('modifierAttribute', app.models.NamedManyToManyField(blank=True, to='app.modifierAttribute', verbose_name='Attribute Modifiers')), + ('modifierStatic', app.models.NamedManyToManyField(blank=True, to='app.modifierStatic', verbose_name='Statics Modifiers')), + ('rollConfiguration', app.models.NamedManyToManyField(blank=True, to='app.rollConfiguration', verbose_name='Roll Configurations')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='charmSolar', + 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')), + ('levelEssence', app.models.NamedIntegerField(default=0, help_text=None, verbose_name='Essence Level')), + ('levelKey', app.models.NamedIntegerField(default=0, help_text=None, verbose_name='Key Level')), + ('active', app.models.NamedBooleanField(default=False, verbose_name='Active?')), + ('ability', 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='Key Ability')), + ('character', app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.characterBase', verbose_name='Character')), + ('modifierAbility', app.models.NamedManyToManyField(blank=True, to='app.modifierAbility', verbose_name='Abilities Modifiers')), + ('modifierAttribute', app.models.NamedManyToManyField(blank=True, to='app.modifierAttribute', verbose_name='Attribute Modifiers')), + ('modifierStatic', app.models.NamedManyToManyField(blank=True, to='app.modifierStatic', verbose_name='Statics Modifiers')), + ('rollConfiguration', app.models.NamedManyToManyField(blank=True, to='app.rollConfiguration', verbose_name='Roll Configurations')), + ], + options={ + 'abstract': False, + }, + ), + migrations.DeleteModel( + name='charm', + ), + ] diff --git a/app/migrations/__pycache__/0010_auto_20200411_1711.cpython-38.pyc b/app/migrations/__pycache__/0010_auto_20200411_1711.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea0549c25f84cf219097c2d412e7694890f93cef GIT binary patch literal 2855 zcmd5;%X8aA7`Gm_9B?tZt{vu}f%7xxIaO$OeyK)?Ndf^80c=y}i_w9cBJ*EA*xnc&MyU&09uDO)S z{2>;zj}D9b@Q-i7fHPPLG93kGHBbjyM;quJT}kn5C%2u!8rFZxV4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mV?d00001 diff --git a/app/models.py b/app/models.py index 2dc877e..f4f896d 100644 --- a/app/models.py +++ b/app/models.py @@ -589,15 +589,20 @@ class itemArmor(itemBase): #==============================================================================# #----------------------------------- CHARMS -----------------------------------# #==============================================================================# -class charm(models.Model): +class charmBase(models.Model): + class Meta: + abstract = True + def __str__(self): return self.name name = NameField() description = DescriptionField() - rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration) + levelEssence = NamedIntegerField("Essence Level") + levelKey = NamedIntegerField("Key Level") character = NamedForeignKeyField("Character", characterBase) active = NamedBooleanField("Active?") + rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration) modifierAttribute = NamedManyToManyField("Attribute Modifiers", modifierAttribute) modifierAbility = NamedManyToManyField("Abilities Modifiers", modifierAbility) modifierStatic = NamedManyToManyField("Statics Modifiers", modifierStatic) @@ -614,6 +619,12 @@ class charm(models.Model): output += modifierStatic.value return +class charmSolar(charmBase): + ability = SingleChoiceField("Key Ability", ABILITIES) + +class charmLunar(charmBase): + attribute = SingleChoiceField("Key Attribute", ATTRIBUTES) + #==============================================================================# #----------------------------------- MERITS -----------------------------------# #==============================================================================#