Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1105 Näkymät

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
4
jouluk. 24
13423
3
heinäk. 25
8754
3
toukok. 25
1768
1
huhtik. 25
1303
3
syysk. 24
14227