Repository navigation
129: Refactoring models - #191
Conversation
meffmadd
left a comment
There was a problem hiding this comment.
When I planned this I would have just created a single file for each models.Model. I think this is still the simplest solution. Some classes are long anyways and the naming is also straightforward then.
| VectorStoreStatus, | ||
| ) | ||
|
|
||
| __all__ = [ |
There was a problem hiding this comment.
I generally dislike __all__ because it is always a hassle to update for little gain but if you have a case for it it is fine.
There was a problem hiding this comment.
I kept __all__ here because
- Dropping these re-exports would force full paths everywhere and break historical migrations (e.g.
management/migrations/0005_file_purpose_update.py). - The "as" re-export (from X import Y as Y) works , but
__all__is the pattern already used (e.g.gateway/views/__init__.py).
There was a problem hiding this comment.
Ok got it! Keep it as is then.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| raise ValidationError("Associated team does not exist.") from None | ||
|
|
||
|
|
||
| class Token(models.Model): |
There was a problem hiding this comment.
Token should have its own file I think... this file is already very long again.
There was a problem hiding this comment.
I created a separate tokens.py file for this model.
meffmadd
left a comment
There was a problem hiding this comment.
To make things as simple as possible can you just create a new file for each model with the file having the same name as the class? I think that does make sense here and we do not have to worry about naming.
|
I've applied your comments and moved each model into its own file, named after the class. :) |
aqueduct/management/models.pyinto amanagement/models/packagemodels.py+) No DB changes → no migration needed.
+) Historical migrations still resolve via the package init.py