You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jae-lee maybe I misunderstand, but can you use post_init to validate dependent fields?
import typic
from datetime import datetime
@typic.klass
class DateCheck:
start: datetime
end: datetime
def __post_init__(self):
if self.start > self.end:
raise ValueError("Start date have to be before end date.")
Description
Would like to see a feature to implement custom validations that could span multiple fields. For example:
Let's say you had a vacation start date and vacation end date field. Vacation start date should be before vacation end date.
The text was updated successfully, but these errors were encountered: