-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MinValueValidator on models.DateField causes TypeError #2369
Labels
Milestone
Comments
Thanks for reporting this. We try to coerce |
This was referenced Mar 9, 2017
This was referenced Oct 16, 2017
This was referenced Nov 6, 2017
This was referenced Nov 14, 2017
This was referenced Dec 10, 2017
This was referenced Dec 20, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a model field like
date = models.DateField(validators=[MinValueValidator(datetime.date(1970,1,1))])
Reference the field in a serializer and modelviewset.
self in the last line is DateField(allow_null=True, min_value=datetime.date(1970, 1, 1), required=False)
As I understand it - the validator is a valid model field argument but it errors out with django rest framework. I'm using 3.0.2. Not sure if it's related to this somewhat vague issue Thanks!
The text was updated successfully, but these errors were encountered: