Last active
August 29, 2015 14:06
-
-
Save tiliv/196d09d755651ce184af 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
{ | |
"fields": [ | |
{ | |
"field_name": "name", // Simple field name | |
"prefixed_name": "name", // Potentially scoped, like "community-0-name" | |
"label": "Community Name", // verbose_name according to the form/model | |
"value": "Verrado", // "initial" for new forms, or else existing value | |
"value_label": null, // For ModelChoiceField foreignkeys, "value" is an id, so this is the unicode of that object. | |
"help_text": "A community, also known as a \"master-planned community\", is a parcel of land in which one or more builders intend to build several subdivisions. To add a community association or create a new community, type the first few letters of the name of the community that you wish to associate with. If the community you wish to associate with already exists within the database, select it from the \"Select from existing\" list and click on \"Submit\" at the bottom of this page to create the association. If the community does not exist within the database, type the name of the community, select it in the \"Create new\" list, and populate the fields below.", | |
"options": { | |
// Validation characteristics about the field. | |
// These just come from the set of possible attributes from built-in Django fields. | |
"allow_empty_file": null, | |
"empty_value": null, | |
"max_decimal_places": null, | |
"max_digits": null, | |
"max_length": null, | |
"max_results": null, // A Select2 item that describes how many to show at a page of searched results | |
"max_value": null, | |
"max_whole_digits": null, | |
"min_length": null, | |
"min_value": null, | |
"required": true | |
}, | |
"widget": { | |
// Attributes on the Widget class that describe rendering | |
"_widget": "TextInput", // debug entry, don't rely on this for anything | |
"allow_multiple_selected": null, | |
"choices": null, | |
"clear_checkbox_label": null, // ClearableFileInput stuff | |
"format": null, // DateField stuff I think | |
"initial_text": null, // (ignore this for now, we don't need it for our forms.) | |
"input_text": null, // (ignore this for now, we don't need it for our forms.) | |
"input_type": "text", | |
"is_hidden": false, | |
"is_localized": false, // Django does stuff with this, but it may already be taken care of at this stage. | |
"needs_multipart_form": false, | |
"options": null, // potential Select2 widget object sent to select2 init function | |
"template_with_clear": null, // ClearableFileField stuff | |
"template_with_initial": null // ClearableFileField stuff | |
} | |
}, | |
{ | |
"field_name": "city", | |
"prefixed_name": "city", | |
"value": 10301, | |
"value_label": "Tempe, AZ", | |
"label": "City/State/County", | |
"help_text": "Type the first few letters of the name of the city of the location and select the correct city/state/county combination from the list presented. If the correct city is not available, click \"Add New\" to add a city to the database.", | |
"options": { | |
"allow_empty_file": null, | |
"empty_value": null, | |
"max_decimal_places": null, | |
"max_digits": null, | |
"max_length": null, | |
"max_results": 1000, | |
"max_value": null, | |
"max_whole_digits": null, | |
"min_length": null, | |
"min_value": null, | |
"required": true | |
}, | |
"widget": { | |
"_widget": "AutoHeavySelect2Widget", | |
"allow_multiple_selected": null, | |
"choices": [], | |
"clear_checkbox_label": null, | |
"format": null, | |
"initial_text": null, | |
"input_text": null, | |
"input_type": "hidden", // The widget will receive a display=none, but has plans to be visible somehow | |
"is_hidden": false, // This flag will always mean that it is absolutely hidden from the user | |
"is_localized": false, | |
"needs_multipart_form": false, | |
"options": { | |
// Select2 widget JS config. This whole thing is sent directly to the select2 constructor | |
"ajax": { | |
"data": "django_select2.get_url_params", | |
"dataType": "json", | |
"quietMillis": 100, | |
"results": "django_select2.process_results" | |
}, | |
"allowClear": true, | |
"closeOnSelect": "true", | |
"escapeMarkup": "function(m){ return m; }", | |
"initSelection": "django_select2.onInit", | |
"minimumInputLength": 1, | |
"minimumResultsForSearch": 6, | |
"multiple": false, | |
"placeholder": "Type to search" | |
}, | |
"template_with_clear": null, | |
"template_with_initial": null | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment