Created
April 12, 2017 18:27
-
-
Save mikeywaites/3f8ac6a7e2514db9561a8fa71baa84c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pipe() | |
def is_over_18(session): | |
if not sessinon.data > 18: | |
raise session.field('under_age') | |
class AgeMarshalPipeline(MarshalPipeline): | |
validation_pipes = [is_over_18] | |
class AgeField(field.Boolean): | |
marshal_pipeline = AgeMarshalPipeline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment