Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
9649 Lượt xem

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 

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

You can set default value for date field like this,

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

Thanks

Ảnh đại diện
Huỷ bỏ

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

yes, wrong in your code ;)

contxt_today --> context_today

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 1 24
2618
2
thg 6 22
4557
2
thg 6 18
6102
2
thg 11 16
13717
2
thg 2 24
12607