Skip to content

Commit 69d763a

Browse files
committed
🐛 (Imports) Fix missing imports in models/__init__.py
1 parent 68552ca commit 69d763a

File tree

2 files changed

+11
-0
lines changed
  • docs/docs/07_sqlalchemy_many_to_many

2 files changed

+11
-0
lines changed

docs/docs/07_sqlalchemy_many_to_many/02_one_to_many_review/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class StoreModel(db.Model):
5959
</Tabs>
6060
</div>
6161

62+
Remember to import the `TagModel` in `models/__init__.py` so that it is then imported by `app.py`. Otherwise SQLAlchemy won't know about it, and it won't be able to create the tables.
63+
6264
## The marshmallow schemas
6365

6466
These are the new schemas we'll add. Note that none of the tag schemas have any notion of "items". We'll add those to the schemas when we construct the many-to-many relationship.

docs/docs/07_sqlalchemy_many_to_many/03_many_to_many_relationships/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ class ItemsTags(db.Model):
6363
tag_id = db.Column(db.Integer, db.ForeignKey("tags.id"))
6464
```
6565

66+
Let's also add this to our `models/__init__.py` file:
67+
68+
```python title="models/__init__.py"
69+
from models.item import ItemModel
70+
from models.tag import TagModel
71+
from models.store import StoreModel
72+
from models.item_tags import ItemsTags
73+
```
74+
6675
### Using the secondary table in the main models
6776

6877

0 commit comments

Comments
 (0)