Skip to content

Commit 1267378

Browse files
committed
add latest berries and alter schema to allow empty properties from the new berries
1 parent 286d7a0 commit 1267378

4 files changed

Lines changed: 61 additions & 12 deletions

File tree

data/v2/build.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,17 +1001,17 @@ def csv_record_to_objects(info):
10011001
def csv_record_to_objects(info):
10021002
item = Item.objects.get(pk=int(info[1]))
10031003
yield Berry(
1004-
id=int(info[0]),
1005-
item_id=int(info[1]),
1006-
name=item.name[: item.name.index("-")],
1007-
berry_firmness_id=int(info[2]),
1008-
natural_gift_power=int(info[3]),
1009-
natural_gift_type_id=int(info[4]),
1010-
size=int(info[5]),
1011-
max_harvest=int(info[6]),
1012-
growth_time=int(info[7]),
1013-
soil_dryness=int(info[8]),
1014-
smoothness=int(info[9]),
1004+
id=int(info[0]) if info[0] and info[0].strip() else None,
1005+
item_id=int(info[1]) if info[1] and info[1].strip() else None,
1006+
name=item.name[: item.name.index("-")] if "-" in item.name else item.name,
1007+
berry_firmness_id=int(info[2]) if info[2] and info[2].strip() else None,
1008+
natural_gift_power=int(info[3]) if info[3] and info[3].strip() else None,
1009+
natural_gift_type_id=int(info[4]) if info[4] and info[4].strip() else None,
1010+
size=int(info[5]) if info[5] and info[5].strip() else None,
1011+
max_harvest=int(info[6]) if info[6] and info[6].strip() else None,
1012+
growth_time=int(info[7]) if info[7] and info[7].strip() else None,
1013+
soil_dryness=int(info[8]) if info[8] and info[8].strip() else None,
1014+
smoothness=int(info[9]) if info[9] and info[9].strip() else None,
10151015
)
10161016

10171017
build_generic((Berry,), "berries.csv", csv_record_to_objects)

data/v2/csv/berries.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,7 @@ id,item_id,firmness_id,natural_gift_power,natural_gift_type_id,size,max_harvest,
6363
62,187,5,80,8,267,5,24,7,60
6464
63,188,2,80,16,33,5,24,7,60
6565
64,189,1,80,17,52,5,24,7,60
66+
65,724,,100,18,,8,72,,
67+
66,725,,100,17,,8,72,,
68+
67,2233,,17,,,,,,
69+
68,2234,,,,,,,,

data/v2/csv/items.csv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2174,4 +2174,6 @@ id,identifier,category_id,cost,fling_power,fling_effect_id
21742174
2229,laorigin-ball,34,0,,
21752175
2230,black-augurite,10,0,,
21762176
2231,peat-block,10,0,,
2177-
2232,metal-alloy,10,0,,
2177+
2232,metal-alloy,10,0,,
2178+
2233,hopo-berry,28,300,,
2179+
2234,roseli-berry,7,200,10,
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Generated by Django 5.2.10 on 2026-06-25 15:20
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("pokemon_v2", "0028_pokemonevolution_evolved_form_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="berry",
15+
name="growth_time",
16+
field=models.IntegerField(blank=True, null=True),
17+
),
18+
migrations.AlterField(
19+
model_name="berry",
20+
name="max_harvest",
21+
field=models.IntegerField(blank=True, null=True),
22+
),
23+
migrations.AlterField(
24+
model_name="berry",
25+
name="natural_gift_power",
26+
field=models.IntegerField(blank=True, null=True),
27+
),
28+
migrations.AlterField(
29+
model_name="berry",
30+
name="size",
31+
field=models.IntegerField(blank=True, null=True),
32+
),
33+
migrations.AlterField(
34+
model_name="berry",
35+
name="smoothness",
36+
field=models.IntegerField(blank=True, null=True),
37+
),
38+
migrations.AlterField(
39+
model_name="berry",
40+
name="soil_dryness",
41+
field=models.IntegerField(blank=True, null=True),
42+
),
43+
]

0 commit comments

Comments
 (0)