Created
October 28, 2014 20:12
-
-
Save lightstrike/000565cf6d240afada1b to your computer and use it in GitHub Desktop.
Experimenting with how to customize django-parsley
This file contains 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
def get_selector(*args): | |
return ''.join([a for a in args]) | |
def get_parsley_errors_data(parsley_attr, fields): | |
parsley_extras = dict() | |
for field in fields: | |
field_dict = {} | |
field_slug = slugify(field) | |
field_dict[parsley_attr] = get_selector( | |
'.', field_slug, '-', c.ERRORS_CLASS) | |
parsley_extras[field] = field_dict | |
return parsley_extras |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment