Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
9906 Visualizzazioni

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
Abbandona
Risposta migliore

Hi,

You can set default value for date field like this,

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

Thanks

Avatar
Abbandona

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

yes, wrong in your code ;)

contxt_today --> context_today

Post correlati Risposte Visualizzazioni Attività
2
gen 24
3031
2
giu 22
4978
2
giu 18
6431
2
nov 16
14303
2
feb 24
12988