Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
7291 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
28029
0
mar. 15
5971
1
mar. 15
10935
3
mar. 15
8915
1
mar. 15
10388