I hereby claim:
- I am webjunkie on github.
- I am webjunkie (https://keybase.io/webjunkie) on keybase.
- I have a public key ASBtMhNKBhfhgDgYl9Z5i61wA9tsNrhd5Udlatwnz_jEVwo
To claim this, I am signing this object:
| import json | |
| with open("swagger.json", "r") as f: | |
| data = json.load(f) | |
| def print_properties(value, pad=""): | |
| properties = value.get('properties', {}) | |
| required = value.get('required', []) |
| # the mixin | |
| class JSONFieldFormMixin(object): | |
| """ | |
| Given that a model has some kind of TextField ``json_storage_field`` with | |
| a string of JSON formatted data inside, this mixin adds handling of this | |
| field to a ModelForm. | |
| It will read the text field, convert to Python dict, fill the form fields | |
| that are given via ``json_fields`` and on saving will write this back to |
| from django import forms | |
| from django.core.exceptions import ValidationError | |
| class MultipleChoiceCommaField(forms.MultipleChoiceField): | |
| """ | |
| Store a comma separated list of multiple choice values in a CharField/TextField | |
| """ | |
| widget = forms.CheckboxSelectMultiple |
I hereby claim:
To claim this, I am signing this object: