Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
7142 Prikazi

Hi guys !

I want to add a field who has all the time the same value (for every objects of his class).

How can i do that ?

Thanks.

Avatar
Opusti
Best Answer

You can create a field in python like that :

_columns = {
    'my_field' : fields.char('My static field', size=64),
}
_defaults = {
    'my_field': lambda *a: 'The default value',
}
Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
mar. 24
27831
0
mar. 15
5798
1
mar. 15
10758
3
mar. 15
8712
1
mar. 15
10220