Skip to Content
मेन्यू
This question has been flagged
1 Reply
9684 Views

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 

 

Avatar
Discard
Best Answer

Hi,

You can set default value for date field like this,

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

Thanks

Avatar
Discard

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

yes, wrong in your code ;)

contxt_today --> context_today

Related Posts Replies Views Activity
2
जन॰ 24
2670
2
जून 22
4601
2
जून 18
6143
2
नव॰ 16
13764
2
फ़र॰ 24
12639