Per specification I have date and time input in UnixTimeStamp
Also, I need check that I have only digits on input (nor something like this "2011-12-12")
I have forms.DataTimeField
and model.DataTimeField
now.
I decided to modify this in such way:
Added UnixTimeStampField(forms.RegexField)
- here I check with regular expression, that I have only digits.
But I got problem with model, since UnixTimeStampField(forms.RegexField)
is based on string and need to be converted to datatime.
I don't like this solution.
How I can create something like UnixTimeStampField(forms.DateTimeField)
?
I tried to do this, but then I have "123321" on input I got "Incorrect parameter" from DateTimeField
validators.