KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've got a model using a validation class called CompareDates for my model validators and I want to pass the validator two field values. However I'm unsure of how to use multiple field values in a validator. I want to be able to make comparisons between the dates in order to validate the model as a whole but it doesn't seem like you can keyword the values passed to the validators, or am I missing something? from django.db import models from myapp.models.validators.validatedates import CompareDates class GetDates(models.Model): """ Model stores two dates """ date1 = models.DateField( validators = [CompareDates().validate]) date2 = models.DateField( validators = [CompareDates().validate])
Tags (comma-separated)
Save Edits
Cancel