Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1017 Weergaven

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
4
dec. 24
13255
3
jul. 25
8625
3
mei 25
1592
1
apr. 25
1208
3
sep. 24
14047