add latest berries and alter schema to allow empty properties from th…#1572
add latest berries and alter schema to allow empty properties from th…#1572programgames wants to merge 2 commits into
Conversation
213fc8d to
1267378
Compare
Naramsim
left a comment
There was a problem hiding this comment.
It's ok to put everything at the end of the file
| growth_time=int(info[7]), | ||
| soil_dryness=int(info[8]), | ||
| smoothness=int(info[9]), | ||
| id=int(info[0]) if info[0] and info[0].strip() else None, |
There was a problem hiding this comment.
I wouldn't allow None values for id, name, and other required fields. Better to remove the else None part
| growth_time=int(info[7]), | ||
| soil_dryness=int(info[8]), | ||
| smoothness=int(info[9]), | ||
| id=int(info[0]) if info[0] and info[0].strip() else None, |
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( |
There was a problem hiding this comment.
Do we really need these? Can they not just be values like 0? (Note: berries are a weak domain of my pokemon knowledge)
There was a problem hiding this comment.
Since Sword and Shield, the concept of crop cultivation has been removed, null values from my point of view seems more appropriate because if we use 0 it would say 'this berry has a natural gift of 0' for example. But this concept doesn't exist in SW, SV and after.
There was a problem hiding this comment.
Yeah, better to allow null fileds in this case.
| growth_time=int(info[7]), | ||
| soil_dryness=int(info[8]), | ||
| smoothness=int(info[9]), | ||
| item_id=int(info[1]) if info[1] and info[1].strip() else None, |
There was a problem hiding this comment.
I'd also here not allow null values. A berry should alwasy be linked with an item.
I don't want line such as
68,,,,,,,,,to be possible to appear.
| soil_dryness=int(info[8]), | ||
| smoothness=int(info[9]), | ||
| item_id=int(info[1]) if info[1] and info[1].strip() else None, | ||
| name=item.name[: item.name.index("-")] if "-" in item.name else item.name, |
There was a problem hiding this comment.
If possible I'd also strenghten the logic here, splitting on - is a bit weak. Better to be explicit and, if present, remove the whole -berry part.
#1126
I added both hopo berry and roseli item.
Also Kee,Marangua,Hopo and Roseli berries in the berry table.
As you said in the issue, new berries don't have much properties as old ones do I had to change the schema to allow empty values.
Datas came from Serebii and bulbapedia :
and then :
I would like to know if it a good practice to add new data add the end of the file like I did.
Thank you