Skip to content

Commit 11997cb

Browse files
committed
rmvd unneeded 'parent' field from CreatureAttackActionSerializer
1 parent 59fc680 commit 11997cb

5 files changed

+18
-33
lines changed

api_v2/serializers/creature.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,24 @@ class CreatureActionAttackSerializer(serializers.ModelSerializer):
2222

2323
class Meta:
2424
model = models.CreatureActionAttack
25-
fields = '__all__'
25+
fields = [
26+
'name',
27+
'attack_type',
28+
'to_hit_mod',
29+
'reach',
30+
'range',
31+
'long_range',
32+
'target_creature_only',
33+
'damage_die_count',
34+
'damage_die_type',
35+
'damage_bonus',
36+
'damage_type',
37+
'extra_damage_die_count',
38+
'extra_damage_die_type',
39+
'extra_damage_bonus',
40+
'extra_damage_type',
41+
'distance_unit',
42+
]
2643

2744
# todo: type is any
2845
@extend_schema_field(OpenApiTypes.STR)

api_v2/tests/responses/TestObjects.test_creature_ancient_example.approved.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
"extra_damage_die_count": null,
2323
"extra_damage_die_type": null,
2424
"extra_damage_type": "thunder",
25-
"key": "srd_ancient-red-dragon_bite_bite-attack",
2625
"long_range": null,
2726
"name": "Bite attack",
28-
"parent": "srd_ancient-red-dragon_bite",
2927
"range": null,
3028
"reach": 15.0,
3129
"target_creature_only": false,
@@ -53,10 +51,8 @@
5351
"extra_damage_die_count": null,
5452
"extra_damage_die_type": null,
5553
"extra_damage_type": null,
56-
"key": "srd_ancient-red-dragon_claw_claw-attack",
5754
"long_range": null,
5855
"name": "Claw attack",
59-
"parent": "srd_ancient-red-dragon_claw",
6056
"range": null,
6157
"reach": 10.0,
6258
"target_creature_only": false,
@@ -124,10 +120,8 @@
124120
"extra_damage_die_count": null,
125121
"extra_damage_die_type": null,
126122
"extra_damage_type": null,
127-
"key": "srd_ancient-red-dragon_tail_tail-attack",
128123
"long_range": null,
129124
"name": "Tail attack",
130-
"parent": "srd_ancient-red-dragon_tail",
131125
"range": null,
132126
"reach": 20.0,
133127
"target_creature_only": false,

api_v2/tests/responses/TestObjects.test_creature_goblin_example.approved.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
"extra_damage_die_count": null,
2323
"extra_damage_die_type": null,
2424
"extra_damage_type": null,
25-
"key": "srd_goblin_scimitar_scimitar-attack",
2625
"long_range": null,
2726
"name": "Scimitar attack",
28-
"parent": "srd_goblin_scimitar",
2927
"range": null,
3028
"reach": 5.0,
3129
"target_creature_only": false,
@@ -53,10 +51,8 @@
5351
"extra_damage_die_count": null,
5452
"extra_damage_die_type": null,
5553
"extra_damage_type": null,
56-
"key": "srd_goblin_shortbow_shortbow-attack",
5754
"long_range": 320.0,
5855
"name": "Shortbow attack",
59-
"parent": "srd_goblin_shortbow",
6056
"range": 80.0,
6157
"reach": null,
6258
"target_creature_only": false,

api_v2/tests/responses/TestObjects.test_creature_guard_example.approved.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
"extra_damage_die_count": null,
2323
"extra_damage_die_type": null,
2424
"extra_damage_type": null,
25-
"key": "srd_guard_spear_spear-melee-attack",
2625
"long_range": 60.0,
2726
"name": "Spear Melee attack",
28-
"parent": "srd_guard_spear",
2927
"range": 20.0,
3028
"reach": 5.0,
3129
"target_creature_only": false,
@@ -42,10 +40,8 @@
4240
"extra_damage_die_count": null,
4341
"extra_damage_die_type": null,
4442
"extra_damage_type": null,
45-
"key": "srd_guard_spear_spear-ranged-attack",
4643
"long_range": 60.0,
4744
"name": "Spear Ranged attack",
48-
"parent": "srd_guard_spear",
4945
"range": 20.0,
5046
"reach": null,
5147
"target_creature_only": false,

api_v2/tests/responses/TestObjects.test_creatureset_example.approved.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@
2424
"extra_damage_die_count": null,
2525
"extra_damage_die_type": null,
2626
"extra_damage_type": null,
27-
"key": "srd_camel_bite_bite-attack",
2827
"long_range": null,
2928
"name": "Bite attack",
30-
"parent": "srd_camel_bite",
3129
"range": null,
3230
"reach": 5.0,
3331
"target_creature_only": false,
@@ -365,10 +363,8 @@
365363
"extra_damage_die_count": null,
366364
"extra_damage_die_type": null,
367365
"extra_damage_type": null,
368-
"key": "srd_draft-horse_hooves_hooves-attack",
369366
"long_range": null,
370367
"name": "Hooves attack",
371-
"parent": "srd_draft-horse_hooves",
372368
"range": null,
373369
"reach": 5.0,
374370
"target_creature_only": false,
@@ -552,10 +548,8 @@
552548
"extra_damage_die_count": null,
553549
"extra_damage_die_type": null,
554550
"extra_damage_type": null,
555-
"key": "srd_elephant_gore_gore-attack",
556551
"long_range": null,
557552
"name": "Gore attack",
558-
"parent": "srd_elephant_gore",
559553
"range": null,
560554
"reach": 5.0,
561555
"target_creature_only": false,
@@ -583,10 +577,8 @@
583577
"extra_damage_die_count": null,
584578
"extra_damage_die_type": null,
585579
"extra_damage_type": null,
586-
"key": "srd_elephant_stomp_stomp-attack",
587580
"long_range": null,
588581
"name": "Stomp attack",
589-
"parent": "srd_elephant_stomp",
590582
"range": null,
591583
"reach": 5.0,
592584
"target_creature_only": true,
@@ -785,10 +777,8 @@
785777
"extra_damage_die_count": null,
786778
"extra_damage_die_type": null,
787779
"extra_damage_type": null,
788-
"key": "srd_mastiff_bite_bite-attack",
789780
"long_range": null,
790781
"name": "Bite attack",
791-
"parent": "srd_mastiff_bite",
792782
"range": null,
793783
"reach": 5.0,
794784
"target_creature_only": false,
@@ -987,10 +977,8 @@
987977
"extra_damage_die_count": null,
988978
"extra_damage_die_type": null,
989979
"extra_damage_type": null,
990-
"key": "srd_mule_hooves_hooves-attack",
991980
"long_range": null,
992981
"name": "Hooves attack",
993-
"parent": "srd_mule_hooves",
994982
"range": null,
995983
"reach": 5.0,
996984
"target_creature_only": false,
@@ -1193,10 +1181,8 @@
11931181
"extra_damage_die_count": null,
11941182
"extra_damage_die_type": null,
11951183
"extra_damage_type": null,
1196-
"key": "srd_pony_hooves_hooves-attack",
11971184
"long_range": null,
11981185
"name": "Hooves attack",
1199-
"parent": "srd_pony_hooves",
12001186
"range": null,
12011187
"reach": 5.0,
12021188
"target_creature_only": false,
@@ -1385,10 +1371,8 @@
13851371
"extra_damage_die_count": null,
13861372
"extra_damage_die_type": null,
13871373
"extra_damage_type": null,
1388-
"key": "srd_riding-horse_hooves_hooves-attack",
13891374
"long_range": null,
13901375
"name": "Hooves attack",
1391-
"parent": "srd_riding-horse_hooves",
13921376
"range": null,
13931377
"reach": 5.0,
13941378
"target_creature_only": false,
@@ -1577,10 +1561,8 @@
15771561
"extra_damage_die_count": null,
15781562
"extra_damage_die_type": null,
15791563
"extra_damage_type": null,
1580-
"key": "srd_warhorse_hooves_hooves-attack",
15811564
"long_range": null,
15821565
"name": "Hooves attack",
1583-
"parent": "srd_warhorse_hooves",
15841566
"range": null,
15851567
"reach": 5.0,
15861568
"target_creature_only": false,

0 commit comments

Comments
 (0)