Skip to content

Commit

Permalink
Adding in race data.
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Aug 13, 2023
1 parent 845b63e commit 58dfa7f
Show file tree
Hide file tree
Showing 4 changed files with 977 additions and 3 deletions.
5 changes: 4 additions & 1 deletion api_v2/management/commands/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ def handle(self, *args, **options) -> None:
for model in app_models:
SKIPPED_MODEL_NAMES = ['Document']
if model._meta.app_label == 'api_v2' and model.__name__ not in SKIPPED_MODEL_NAMES:
modelq = model.objects.filter(document=doc).order_by('pk')
if model.__name__ in ['Trait']:
modelq = model.objects.filter(race__document=doc).order_by('pk')
else:
modelq = model.objects.filter(document=doc).order_by('pk')
model_path = get_filepath_by_model(
model.__name__,
model._meta.app_label,
Expand Down
4 changes: 2 additions & 2 deletions api_v2/migrations/0003_race_trait.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.20 on 2023-08-13 02:16
# Generated by Django 3.2.20 on 2023-08-13 20:39

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -18,7 +18,7 @@ class Migration(migrations.Migration):
('desc', models.TextField(help_text='Description of the game content item. Markdown.')),
('key', models.CharField(help_text='Unique key for the Item.', max_length=100, primary_key=True, serialize=False)),
('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api_v2.document')),
('subrace_of', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api_v2.race')),
('subrace_of', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='api_v2.race')),
],
options={
'verbose_name_plural': 'races',
Expand Down
132 changes: 132 additions & 0 deletions data/v2/wizards-of-the-coast/srd/Race.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
[
{
"model": "api_v2.race",
"pk": "dragonborn",
"fields": {
"name": "Dragonborn",
"desc": "Your draconic heritage manifests in a variety of traits you share with other dragonborn.",
"document": "srd",
"subrace_of": null
}
},
{
"model": "api_v2.race",
"pk": "dwarf",
"fields": {
"name": "Dwarf",
"desc": "Your dwarf character has an assortment of inborn abilities, part and parcel of dwarven nature.",
"document": "srd",
"subrace_of": null
}
},
{
"model": "api_v2.race",
"pk": "elf",
"fields": {
"name": "Elf",
"desc": "Your elf character has a variety of natural abilities, the result of thousands of years of elven refinement.",
"document": "srd",
"subrace_of": null
}
},
{
"model": "api_v2.race",
"pk": "gnome",
"fields": {
"name": "Gnome",
"desc": "Your gnome character has certain characteristics in common with all other gnomes.",
"document": "srd",
"subrace_of": null
}
},
{
"model": "api_v2.race",
"pk": "half-elf",
"fields": {
"name": "Half-Elf",
"desc": "Your half-elf character has some qualities in common with elves and some that are unique to half-elves.",
"document": "srd",
"subrace_of": null
}
},
{
"model": "api_v2.race",
"pk": "half-orc",
"fields": {
"name": "Half-Orc",
"desc": "Your half-orc character has certain traits deriving from your orc ancestry.",
"document": "srd",
"subrace_of": null
}
},
{
"model": "api_v2.race",
"pk": "halfling",
"fields": {
"name": "Halfling",
"desc": "Your halfling character has a number of traits in common with all other halflings.",
"document": "srd",
"subrace_of": null
}
},
{
"model": "api_v2.race",
"pk": "high-elf",
"fields": {
"name": "High Elf",
"desc": "As a high elf, you have a keen mind and a mastery of at least the basics of magic. In many fantasy gaming worlds, there are two kinds of high elves. One type is haughty and reclusive, believing themselves to be superior to non-elves and even other elves. The other type is more common and more friendly, and often encountered among humans and other races.",
"document": "srd",
"subrace_of": "elf"
}
},
{
"model": "api_v2.race",
"pk": "hill-dwarf",
"fields": {
"name": "Hill Dwarf",
"desc": "As a hill dwarf, you have keen senses, deep intuition, and remarkable resilience.",
"document": "srd",
"subrace_of": "dwarf"
}
},
{
"model": "api_v2.race",
"pk": "human",
"fields": {
"name": "Human",
"desc": "It’s hard to make generalizations about humans, but your human character has these traits.",
"document": "srd",
"subrace_of": null
}
},
{
"model": "api_v2.race",
"pk": "lightfoot",
"fields": {
"name": "Lightfoot",
"desc": "As a lightfoot halfling, you can easily hide from notice, even using other people as cover. You're inclined to be affable and get along well with others. Lightfoots are more prone to wanderlust than other halflings, and often dwell alongside other races or take up a nomadic life.",
"document": "srd",
"subrace_of": "halfling"
}
},
{
"model": "api_v2.race",
"pk": "rock-gnome",
"fields": {
"name": "Rock Gnome",
"desc": "As a rock gnome, you have a natural inventiveness and hardiness beyond that of other gnomes.",
"document": "srd",
"subrace_of": "gnome"
}
},
{
"model": "api_v2.race",
"pk": "tiefling",
"fields": {
"name": "Tiefling",
"desc": "Tieflings share certain racial traits as a result of their infernal descent.",
"document": "srd",
"subrace_of": null
}
}
]
Loading

0 comments on commit 58dfa7f

Please sign in to comment.