コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
9669 ビュー

I want to set default date field  January to December and later on i want a field in which user can select any date and that selected will do minus from default field please help me in it.

Here is the default field 

perioud = fields.date() but it is not showing 

 

アバター
破棄
最善の回答

Hi,

You can set default value for date field like this,

date = fields.Date(required=True, default=fields.Date.context_today)

Thanks

アバター
破棄

Wrong!!!
AttributeError: type object 'Date' has no attribute 'contxt_today'

yes, wrong in your code ;)

contxt_today --> context_today

関連投稿 返信 ビュー 活動
2
1月 24
2622
2
6月 22
4567
2
6月 18
6105
2
11月 16
13725
2
2月 24
12615