跳至內容
選單
此問題已被標幟
1 回覆
7193 瀏覽次數

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.

頭像
捨棄
最佳答案

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',
}
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
3月 24
27888
0
3月 15
5833
1
3月 15
10812
3
3月 15
8747
1
3月 15
10260