One to One Relationships in Flask-SQLAlchemy

preview_player
Показать описание
One to One relationships are a special case that you may have in your project. In this video, I talk about how to create them in Flask-SQLAlchemy.

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

I know this is old but this still is the only helpful tutorial i found. Most of the videos Ive watched doesn't deal with relationships. Thank you. Been looking for this for the last couple days.

jpcalvo
Автор

My wife asked me, why I quitted django, I told her that there is no more django content from Pretty Printed (with tears in my eyes)

jonathanwarner
Автор

I am using Flask for an educational project. Your videos are helping a lot.
Great work, thanks!

brunosantos
Автор

Hi Anthony
Thanks for your videos.
I have a question about the backref, you chose
parent as the name. Does this mean that the column
in the child class needs to be named parent_id ?
or are these 2 resources completely uncorrelated ?
Thanks a lot.

jeboisdupetitlait
Автор

@prettyprint... do you have a tutorial on how to insert data into the parent and child tables with a little bit realistic project? kind regards

pipi_delina
Автор

Any idea who you can get the data in jinja2 tempalte from a child template? Usually i used (from your tutorials) current_user.firstname when the firstname was in the User table, but I we move that to UserDetails table, how do we get that? Thank you

bogdanvelica
Автор

How do we add a Column to Parent that shows all of his children?

ahmedlimam
Автор

i am getting out of context error dont know why even though i followed the same steps

justaniket
Автор

In the line child = db.relationship(....) what is child? I mean is it table name? or record? or just an arbitrary name?

farzinashouri
Автор

I'm in doubt about it. How is the structure of the code to identify the user who made a post? Is it the route or the form? I'm stuck in this car in the flask is it helping me?

noobdaaviacao
Автор

Thank you for this video! Can the parent have the one-to-one relationship with the child, but also have a one-to-many relationship with another table?

ryansheppard
Автор

how to create a parent related to the first child with no parent anymore?

naheliegend
Автор

using 'Child' and 'Parent' in this context doesn't make sense, because a child/parent relation is usually M2M. A better example could be for example Student - student_IDCard

alexd