Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
7015 Vistas

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
Mejor respuesta

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
Publicaciones relacionadas Respuestas Vistas Actividad
2
mar 24
27640
0
mar 15
5647
1
mar 15
10644
3
mar 15
8556
1
mar 15
10128