Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Support user defined formatters for validators #608

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bharling
Copy link

@bharling bharling commented Aug 12, 2018

Expose formatters on validators allowing the use of custom formatters as opposed to just the hard-coded date / datetime formats currently available.

This allows a validator to serialize from a json value to any native type and back again, so long as it is defined on the formatter. The motivation behind this was initially to enable porting DRF's PrimaryKeyRelatedField and SlugRelatedField to APIStar to better enable ORM support for 3rd party libraries

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant