Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1012 Widoki

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
4
gru 24
13250
3
lip 25
8621
3
maj 25
1584
1
kwi 25
1184
3
wrz 24
14030