Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1014 Zobrazení

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.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
4
pro 24
13250
3
čvc 25
8621
3
kvě 25
1592
1
dub 25
1203
3
zář 24
14043