Skip to Content
Menú
This question has been flagged
1 Respondre
6875 Vistes

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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
2
de març 24
27340
0
de març 15
5464
1
de març 15
10467
3
de març 15
8339
1
de març 15
9952