ORM

16 views
Skip to first unread message

Jayesh Prajapati

unread,
Apr 22, 2020, 1:04:44 PM4/22/20
to Django users
Hello World,


I have doubt for that's why I come here.

If one can clear my doubt it would be so helpful.

Suppose, I have a table 3 table with foreign key of in each table.

Table 1
 FK of table 2

Table 2
 FK of table 3

Table 3
 FK of another table


Now, what I am doing is

t1 = Table1.objects.get().first()
t1.table_2.table_3.anyrow = "new value"
t1.save()

Then,

passing the t1 object to another function and printing the value of anyrow of table_3.

What it will print?
Is it right? or Wrong?
Reply all
Reply to author
Forward
0 new messages