Skip to Content
Menu
This question has been flagged
1 Odpoveď
7175 Zobrazenia

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
Zrušiť
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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
mar 24
27874
0
mar 15
5813
1
mar 15
10797
3
mar 15
8728
1
mar 15
10245