Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7886 Lượt xem

Hello

Here is an example to illustrate my question:

Model A:
date: fields.Date(...)
info1: fields.Char(...)
Model B:
date: fields.Date(...)
value1: fields.Float(...)
flag1: fields.Boolean(...)

I would like to build a list view that provide the following information:

Type

Date

Information

Flag

Either 'A' or 'B'

The 'date' field.

Either 'info1' for model A or 'value1' for model B.

The 'flag1" field for Model B.


Given that Model A and Model B are two different models.

How could I show the user a "merge" list view of the record of the two models ? I would also like to be able to click a line of the list to reach the record ?


My idea would be to 'build' a 'merge model' that would be filled each time the end user requests to see the list. But how to do so ? SQL request ? Other ? When to build the list ? Should it be stored ?


Could you please advise ?

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hello

Is that impossible to achieve ? I cant believe none else needed to have a merge view of two models..

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 16
4389
1
thg 11 20
3871
0
thg 6 20
6836
2
thg 1 25
1175
0
thg 12 24
1330