theatlantic/django-select2-forms

Hidden field?

bukowa opened this issue · 0 comments

Why the city field is hidden? I render the form via {{ form.as_p }}

<input type="hidden" name="city" data-placeholder="None" class="django-select2" data-sortable="false" id="id_city" data-select2-options="{&quot;ajax&quot;: {&quot;url&quot;: &quot;/select2/fetch_items/users/user/city/&quot;, &quot;dataType&quot;: &quot;json&quot;, &quot;quietMillis&quot;: 200}, &quot;allowClear&quot;: true}" data-init-selection-url="/select2/init_selection/users/user/city/" />
city = select2.fields.ForeignKey(City, blank=True, null=True, ajax=True, search_field='name', js_options={'quiet_millis': 200}, on_delete=models.PROTECT)