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 3 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
| ] | ||
|
|
||
| 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.
|
Corrections done |
jemarq04
left a comment
There was a problem hiding this comment.
Just a couple comments. Also, could you run make format to fix the python script formatting you're adding?
| berry_firmness_id=int(info[2]), | ||
| natural_gift_power=int(info[3]), | ||
| natural_gift_type_id=int(info[4]), | ||
| size=int(info[5]), | ||
| max_harvest=int(info[6]), | ||
| growth_time=int(info[7]), | ||
| soil_dryness=int(info[8]), | ||
| smoothness=int(info[9]), | ||
| name=item.name[: -len("-berry")] if item.name.endswith("-berry") else item.name, | ||
| berry_firmness_id=int(info[2]) if info[2] and info[2].strip() else None, | ||
| natural_gift_power=int(info[3]) if info[3] and info[3].strip() else None, | ||
| natural_gift_type_id=int(info[4]) if info[4] and info[4].strip() else None, | ||
| size=int(info[5]) if info[5] and info[5].strip() else None, | ||
| max_harvest=int(info[6]) if info[6] and info[6].strip() else None, | ||
| growth_time=int(info[7]) if info[7] and info[7].strip() else None, | ||
| soil_dryness=int(info[8]) if info[8] and info[8].strip() else None, | ||
| smoothness=int(info[9]) if info[9] and info[9].strip() else None, |
There was a problem hiding this comment.
I don't think we need to check the stripped value. We don't really make that check anywhere else, and I don't believe we've had any issues of unexpected whitespace.
| growth_time=int(info[7]), | ||
| soil_dryness=int(info[8]), | ||
| smoothness=int(info[9]), | ||
| name=item.name[: -len("-berry")] if item.name.endswith("-berry") else item.name, |
There was a problem hiding this comment.
| name=item.name[: -len("-berry")] if item.name.endswith("-berry") else item.name, | |
| name=item.name[:-6] if item.name.endswith("-berry") else item.name, |
No need to determine the length of a constant string, we can write that in. I'm also thinking using
name=item.name.split("-berry")[0]would do the same thing and make it clear that you're trying to remove that suffix if it exists, though both could work.
#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