One to One Relationships in Flask-SQLAlchemy

  Рет қаралды 27,251

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 21
@prettyprinted
@prettyprinted 4 жыл бұрын
Join my free course on the basics of Flask-SQLAlchemy: prettyprinted.com/flasksql
@jonathanwarner2420
@jonathanwarner2420 6 жыл бұрын
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)
@prettyprinted
@prettyprinted 6 жыл бұрын
lol don't worry, I'll cover more Django.
@madnessgain443
@madnessgain443 4 жыл бұрын
lol
@brunosantos3672
@brunosantos3672 5 жыл бұрын
I am using Flask for an educational project. Your videos are helping a lot. Great work, thanks!
@scicommerce
@scicommerce 4 жыл бұрын
Thanks for the tips also
@aminemellef5401
@aminemellef5401 3 жыл бұрын
Nice content gr8 job
@pipi_delina
@pipi_delina 3 жыл бұрын
@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
@jeboisdupetitlait
@jeboisdupetitlait 4 жыл бұрын
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.
@bogdanvelica
@bogdanvelica 2 жыл бұрын
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
@noobdaaviacao
@noobdaaviacao 5 жыл бұрын
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?
@prettyprinted
@prettyprinted 5 жыл бұрын
The best approach would be in the route. If you use something like Flask-Login, then you can set the author of the post to be the current logged in user.
@justaniket
@justaniket 2 жыл бұрын
i am getting out of context error dont know why even though i followed the same steps
@ahmedlimam2241
@ahmedlimam2241 4 жыл бұрын
How do we add a Column to Parent that shows all of his children?
@ryansheppard6499
@ryansheppard6499 5 жыл бұрын
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?
@l.s.8793
@l.s.8793 4 жыл бұрын
yes, just set uselist=True (or omit this argument altogether, as it's set to true by default) for the table you want to have a one-to-many relationship with. Like so: one_to_one = db.relationship('Child1', backref='parent', uselist=False) one_to_many = db.relationship('Child2', backref='parent', uselist=True)
@farzinashouri2297
@farzinashouri2297 3 жыл бұрын
In the line child = db.relationship(....) what is child? I mean is it table name? or record? or just an arbitrary name?
@naheliegend5222
@naheliegend5222 3 жыл бұрын
how to create a parent related to the first child with no parent anymore?
@aravindc_v1232
@aravindc_v1232 5 жыл бұрын
what is that database view tool..?
@prettyprinted
@prettyprinted 5 жыл бұрын
sqlitebrowser.org/
@alexd7466
@alexd7466 4 жыл бұрын
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
Getting Started With Flask-SQLAlchemy
15:27
Pretty Printed
Рет қаралды 90 М.
Understanding the Lazy Parameter in Flask-SQLAlchemy Relationships
10:49
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Python SQLAlchemy ORM - 1 to MANY Relationships
14:10
Zeq Tech
Рет қаралды 12 М.
Create One To Many Database Relationship  - Flask Fridays #28
13:27
How to Use Flask-SQLAlchemy With Flask Blueprints
20:10
Pretty Printed
Рет қаралды 37 М.
5 Excel Secrets You'll Be Embarrassed You Didn't Know
17:32
Excel Campus - Jon
Рет қаралды 284 М.
Creating Many-To-Many Relationships in Flask-SQLAlchemy
7:28
Pretty Printed
Рет қаралды 45 М.
SQLAlchemy Turns Python Objects Into Database Entries
22:23
NeuralNine
Рет қаралды 188 М.
Use Flask-SQLAlchemy With Existing Database With Reflect and Automap
9:59
Flask & Flask-SQLAlchemy Model Relationships
21:34
darkyodeler
Рет қаралды 26 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН