Skip to Content
Menu
This question has been flagged
1 Reply
1838 Views

Hello,

I'm trying to understand if it is possible to do the following:

I have the following models:

model 1:

 exampleid1


model 2:

 exampleid1

 somedata


Now I'm trying to add a view with a table in model1 and in this table there should be the data from model2.somedata.


Is it possible to achieve this with a onetomany relation based on the exampleid1, so I can get only the matched data?


I hope you understand what I mean, it is like a join with a where clause.


thank you.

Avatar
Discard
Best Answer

In model 1, you can have related field to model 2:

variable_name = fields.Binary(related='model1.variable_name')



Avatar
Discard