Flask Full Series - Web Application Development with Python - Model Relationships - Episode 7

preview_player
Показать описание
Flask Python
#Flask #Python #FlaskTutorial

👍Welcome to my Python Flask tutorial

In this episode, we will learn how to perform relationship between two models, to demonstrate this, we will create a new model called User, and this is a great preparation for our future features on this application, like registration system.

Throughout this series, I am going to go deeper into each topic by developing a real website that simulates an open market that different users can purchase items, including a budget system for each user.

Connect with me with:

👍 Subscribe for more Python tutorials like this:
🔥 Comment below on other topics you want to see tutorials next on my Channel.
-----------------------------------------------

My website:

Useful Links:

Code from Github:

Timeline for the video:
00:00 - 06:31 - Creating a User Model.
06:32 - 10:47 - Relationship between Item and User Model
10:48 - 13:28 - Creating one random User
13:29 - 20:57 - Assigning Items to an User object
Рекомендации по теме
Комментарии
Автор

Hi all, this is one great episode where we will be starting to create our User Registration System.
But we will learn mainly about how we can create a relationship between a User model to the Item model that we have already
created in the fifth episode, so this is the first time we are actually going to see a user owning some items.
Not an easy episode to understand, questions will be answered as always :)

jimshapedcoding
Автор

Hey Jim! i want to ask about 10:45, why dont we use 'User.id' with uppercase?

jeisaraja
Автор

Ouuuu man. This class was great. I am so into databases with python and SQL Alchemy. I love connecting several parts in our app.

sebiporini
Автор

At 12:04, i got am error to create user u1, i tried many time but can't fix it.

error is:
raise sa_exc.NoForeignKeysError(
Could not determine join condition between parent/child tables on relationship User.items - there are no foreign
keys linking these tables. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or specify a 'primaryjoin' e
xpression.



can you help?

raihanuddin
Автор

Cant the user input the db info from the website ui

WilsonMarunda-vflt
Автор

Hello Jim ! first i wanna thank you for you excellent course . but i have and issue, when i want to importing db from market.models, i got an error that says 'No module named 'models'' i stuck with it abouts few dAays . plz help me

dummy
Автор

I managed to resolve this issue, thanks to stackoverflow. Now I'hv new error:
'SQLALCHEMY_DATABASE_URI' config is not set. Bind key 'None' is not in 'SQLALCHEMY_BINDS' config.
I don't understand how to bind the key and where, I tried to find the solution but failed to understand their solutions, If you could help me then it would be great help. Thanks

MKSundaram
Автор

Hi Jim, I am Brian from Vietnam. I really like your videos due to its content very tremendous detail up to advanced level base on every aspect of the topic you made. Thank you so much for your hardwork

brianhuynh
Автор

I'm already behind with the videos (not much free time at home..) but thanks a lot for the series. Is it possible to have more than one relationship for the same class? In your example, say you wanted to register user transactions in a separate table needing a new relationship from User to Transactions. Or from Transactions to Item.

messenjah
visit shbcf.ru