Skip to content

Refactor models.py#56

Merged
cmsato09 merged 29 commits into
mainfrom
development
Jul 8, 2025
Merged

Refactor models.py#56
cmsato09 merged 29 commits into
mainfrom
development

Conversation

@cmsato09
Copy link
Copy Markdown
Owner

@cmsato09 cmsato09 commented Jul 8, 2025

Separated out my model classes into individual classes

cmsato09 and others added 29 commits November 13, 2024 11:21
- Moved all DQM1 specific models from `src/app/models.py` to
  `src/app/models/dqm1/` for better organization
- `src/app/models.py` file deleted because it's empty
- MonsterFamily related models in src/app/models/dqm1/models/monster.py moved to separate file within the same directory
- Moved MonsterFamilyRead related models from monster_family.py to schemas.py
- Moved MonsterDetailRead related models from monster.py
- Moved SkillRead related models from skill.py
- Prevents circular import problem between model files that import each
  other
- Removed MonsterDetailRead related models to schemas.py
- Moved MonsterSkillLink to associations.py
- Moved MonsterFamilyRead class to models/dqm1/schemas.py file
- Moved SkillRead related classes to schemas.py
- Updated import statements
A circular dependency between the `monster` and `skill` models was
causing `PydanticUndefinedAnnotation` and `NoInspectionAvailable`
errors during application startup and testing.

This occurred because the `MonsterSkillLink` association model was
defined in `monster.py` but was needed at runtime by `skill.py`,
creating an import deadlock.

This commit resolves the issue by moving `MonsterSkillLink` to its
own dedicated file, `src/app/models/dqm1/associations.py`. This
breaks the import cycle, as both `monster` and `skill` models can
now safely import the association table from a neutral location.
- Due to changes to model files, import statements using those models
  were changed to reflect it
Fix circular model dependencies and improve schema organization
@cmsato09 cmsato09 merged commit ff07bda into main Jul 8, 2025
12 checks passed
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.

1 participant