Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
7420 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
2
mars 24
28197
0
mars 15
6137
1
mars 15
11104
3
mars 15
9072
1
mars 15
10508