تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
9677 أدوات العرض

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
يناير 24
2659
2
يونيو 22
4590
2
يونيو 18
6132
2
نوفمبر 16
13750
2
فبراير 24
12628