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

I am using model.AbstractModel, and there is one relation field that must let comodel_name refers to its self. So it should not be implemented until the class which inherits the abstract class.

It came out of my mind that is any posibility to set a field with @property and raise NotImplementdError in the abstract class, and then implement the field in inherit model like following:

​@property

​def model_id(self):

​return fields.Many2one(comodel_name='sub.class', string='ref')

Just a fancy think, is it posible? Thank you.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 12 24
13515
3
thg 7 25
8770
3
thg 5 25
1858
1
thg 4 25
1386
3
thg 9 24
14356