Skip to content

Add pokemon form trigger conditions#1578

Open
dyp1109 wants to merge 3 commits into
PokeAPI:masterfrom
dyp1109:feat/link-form-changes-methods
Open

Add pokemon form trigger conditions#1578
dyp1109 wants to merge 3 commits into
PokeAPI:masterfrom
dyp1109:feat/link-form-changes-methods

Conversation

@dyp1109

@dyp1109 dyp1109 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Change description

Addressing issues #1549 by adding new form triggers fields in /api/v2/pokemon-form/ endpoints.

Changes included:

  • New PokemonFormMethod and PokemonFormCondition models to store how a form is activated,
  • New pokemon_form_methods.csv to define trigger types, and pokemon_form_conditions.csv to link forms to their trigger methods.
  • New za mega-stones in items.csv

AI coding assistance disclosure

I use AI assistant for formatting.

Contributor check list

  • I have written a description of the contribution and explained its motivation.
  • I have written tests for my code changes (if applicable).
  • I have read and understood the AI Assisted Contribution guidelines.
  • I will own this change in production, and I am prepared to fix any bugs caused by my code change.

@Naramsim Naramsim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, can you merge the migrations into a single one?

Can you address the failing tests?

Comment thread data/v2/csv/items.csv Outdated
2231,peat-block,10,0,,
2232,metal-alloy,10,0,, No newline at end of file
2232,metal-alloy,10,0,,
2559,clefablite,44,0,80,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why start at 2559 instead of 2233?

Comment thread data/v2/csv/pokemon_form_conditions.csv Outdated
@@ -0,0 +1,224 @@
pokemon_form_id,form_method_id,item_id,ability_id,move_id

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe some more descriptive names like trigger_item_id and so on?

@@ -0,0 +1,7 @@
id,identifier

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add a pokemon_form_method_prose.csv file to match

Comment thread pokemon_v2/serializers.py Outdated
model = PokemonFormName
fields = ("name", "pokemon_name", "language")

class PokemonFormTriggerSerializer(serializers.ModelSerializer):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do like form trigger as the name rather than form method, but whatever you choose we should make it consistent between these classes and the file.

@dyp1109

dyp1109 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

The new update addresses the comments to fix the ID and naming issues. Migrations is merged into single file and prose csv file is added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants