Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
7153 Zobrazení

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šit
Nejlepší odpověď

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šit
Related Posts Odpovědi Zobrazení Aktivita
2
bře 24
27839
0
bře 15
5803
1
bře 15
10762
3
bře 15
8716
1
bře 15
10223