-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
It would appear that this doesn't really work well with crazy MultiValueField-based fields. Not sure if my field is the problem or nango but I wonder - wouldn't it just be simpler to have a timestamp-based check on a auto_now-datetime field?
Anyway ... so my field is something like this:
class SplitDateTimeRangeField(forms.MultiValueField):
empty_values = validators.EMPTY_VALUES + (
(None, None),
DateTimeTZRange(None, None),
)
def __init__(self, **kwargs):
fields = (
forms.SplitDateTimeField(),
forms.SplitDateTimeField(),
)
super().__init__(fields, **kwargs)
self.range_field = pgforms.DateTimeRangeField(**kwargs)
def validate(self, value):
if value in self.empty_values and self.required:
raise ValidationError(self.error_messages['required'], code='required')
def compress(self, data_list):
return self.range_field.compress(data_list)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels