Skip to Content
Menu
This question has been flagged
1 Atsakyti
7180 Rodiniai

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.

Portretas
Atmesti
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',
}
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
kov. 24
27879
0
kov. 15
5818
1
kov. 15
10800
3
kov. 15
8737
1
kov. 15
10253