콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
7276 화면

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
28005
0
3월 15
5958
1
3월 15
10913
3
3월 15
8882
1
3월 15
10374