Skip to content

Commit

Permalink
Update src/sqlacodegen/generators.py
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
  • Loading branch information
sheinbergon and agronholm authored Jan 11, 2025
1 parent ecc1b89 commit 79c25af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sqlacodegen/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,7 @@ def collect_imports(self, models: Iterable[Model]) -> None:
super(DeclarativeGenerator, self).collect_imports(models)
if any(isinstance(model, Model) for model in models):
self.add_literal_import("sqlalchemy", "MetaData")

if any(isinstance(model, ModelClass) for model in models):
self.add_literal_import("sqlmodel", "SQLModel")
self.add_literal_import("sqlmodel", "Field")
Expand Down

0 comments on commit 79c25af

Please sign in to comment.