Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
7151 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
mar. 24
27837
0
mar. 15
5803
1
mar. 15
10762
3
mar. 15
8716
1
mar. 15
10222