Hi All,
I am generating admin interface form.
I want to add search functionality and paginate my following "ModelMultipleChoiceField" field of django form. Is is possible to achieve this ?
Because it contains around 5000 results.
Here is my forms.py
class ScheduledTestForm(forms.ModelForm):
tags = forms.ModelMultipleChoiceField(queryset=Tag.objects.all())
class Meta:
model = Test
exclude = ['pita_id', 'challenge', 'test_template']
Here is my template.html :(partial code) :
{% block nav-global %}{% endblock %}
{% block content %}
<form action="." method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
{% endblock %}
{% block nav-global %}{% endblock %}
{% block content %}
<form action="." method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
{% endblock %}
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAC5ThKEFQ-Ash-A%2BX6V5jNn5LJoUCNpj2nuaTrBJ0PtL_X0x7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment