-
Notifications
You must be signed in to change notification settings - Fork 1
Basic validation implementation #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Desired syntaxe je cca nejak takhle: actions = {
"getById": Action(parameters={"id": IntegerType(validators=(IsPositive, ReferencesExistingObject))},
return_value=ObjectType("self"),
validators=SomeAnotherValidator
exec_fn=get_by_id)
}Jak toho docilit:
|
|
Zaroven prosim oprav toto https://github.com/karlosss/simple_api/blob/master/simple_api/object/actions.py#L21, je potreba to rozdelit na dva forloopy, jeden pres parametry a jeden pres data, tohle vyhodi duplikatni klice (realne se to nestane, ale je to bug) - podobne potom iteruj pres policka, kdyz na nich budes hledat validatory |
|
"validators pridat i do Action v actions.py" - to už vlastně dělám, jen to trochu upravím aby to fungovalo lépe |
simple_api/object/actions.py
Outdated
| self.return_value = return_value | ||
| self.exec_fn = exec_fn | ||
| self.permissions = permissions or () | ||
| self.action_validators = validators or () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potencialne prejmenovat pouze na self.validators
tests/graphql/library_system/library_system_validation/objects.py
Outdated
Show resolved
Hide resolved
tests/graphql/library_system/library_system_validation/objects.py
Outdated
Show resolved
Hide resolved
…a now, actions argument parsing renamed for better readability
Říkal jsem si že než budu pokračovat tak ti to sem postnu abys kdyžtak mohl upozornit na problémy apod. než se do toho moc zahrabu 👍