Flask & Flask-SQLAlchemy Model Relationships

preview_player
Показать описание
Talking about:
* One-to-One Relationships
* One-to-Many Relationships
* Many-to-Many Relationships

Рекомендации по теме
Комментарии
Автор

Time Stamps for people who are searching for specific topic
3:05 - one to many
9:27 - one to one
13:50 - many to many

bartosz
Автор

Dude, that's the best SQLAlchemy tutorial on Youtube EVER! You changed my whole idea about how to deal with SQL e how it is powerful! Thank you so much!

wduandy
Автор

This is a very helpful video man! you get a subscribe from me, also, it would have been awesome if you have shown how to delete on a many to many relationship

moayedmustafa
Автор

Hey boss, Not sure if its a SQLAlchemy 2.0 thing but ```relationships('Movie', backref="director", lazy='select)``` in the documentation states that the "backref" keyword specifies both sides of the relationship as if you used "back_populates" on both tables, so why do we need the Foreign Key on the child table?

dylanwilliams
Автор

I confused 222 subscribers to 222k subscribers. And he totally deserve it.

DavidPeterJW
Автор

lovely, lovely, lovely. Man such a simple explanation for such a complex topic. Thanks for contribution.

mnauet
Автор

FINALLY ABLE TO UNDERSTAND IT ! Thank you so much, all other tutorials literally skip the most logical steps or details a beginner can ask when he has no knowledge of this particular topic. You've explained it so well that it compensates for almost 2 hours of reading SQLAlchemy's documentation about relationships. Thank you brother you're very concise and really go into details, you're a good teacher.

SouthVisionMG
Автор

how did you do that copy/paste trick on mutliple lines at 18:45?

magnuserikkeenrobot
Автор

My VS linter doesn't recognize db.Column :(.

Автор

Nice video,
I have a question.
in my database, I have only 1 table that I use and have 4 rows of input. when I delete that input it deletes in the database.
what I like to achieve is when I input the data, I have duplicate data. so when I delete the original I still have the copy of the data in another table.
what i should use? relationships work in this?

atiindacity
Автор

Great video, thanks for also quickly showing the cli tools (init & bootstrap)!

shmiggit
Автор

anyone, unittest for this?, any reference?...

Nearco
Автор

Really nice video dude, keep it going!

jpmol
Автор

How did director_id get added to movies table, we haven't passed director_id in db.session.add?

RahulChauhanart
Автор

I never leave comments on any video but dude, this was awesome. Very clear explanation, I don't know who disliked this video but you earned my like man! You deserve lots and lots of subscribers & I think you should upload more such content (hard to find such clear videos on youtube). Thanks a lot, man!

mayankdebnath
Автор

I dont know if you're checking comments but can you show how to create api with these database

samippaudel
Автор

Here I am 2 years later; very well presented and explained.

ksafan
Автор

How is it that the Director.movies db.relationship has a backref of 'director', but Movies uses the name director_id (not director)?

weezilla
Автор

Dude, this video helps me a lot! Thanks for making this video and I hope this video keep blessing other newbies like me!

jialiliang
Автор

Hi, thanks for the great video! Just a brief question, I currently have included a constructor in each table class, so would that mean I would need to include the db.relation variables in the constructor as well (regarding one-to-many relationships)? Thanks again :)

infinity-hpvr