Thanks Ibrahim, I was searching google for a solution and was sent here -
it was simply perfect. (should be merged to be honest!)
On Sunday, September 23, 2012 4:46:46 PM UTC+2, Ibrahim Lawal wrote:
>
> Here's how I achieved it.
>
> {% load i18n %}
> {% if choices|length > 9 %}
> <h3>{% blocktrans with title|escape as filter_title %} By {{ filter_title
> }} {% endblocktrans %}</h3>
> <FORM>
> <SELECT style="width:100%" id="filter-{{ title|escape }}"
> onchange="window.location=this.value">
> {% for choice in choices %}
> <OPTION{% if choice.selected %} selected="selected"{% endif %} value="{{
> choice.query_string|iriencode }}">{{ choice.display|escape }}</OPTION>
> {% endfor %}
> </SELECT>
> </FORM>
> {% else %}
> <h3>{% blocktrans with title as filter_title %} By {{ filter_title }} {%
> endblocktrans %}</h3>
> <ul>
> {% for choice in choices %}
> <li{% if choice.selected %} class="selected"{% endif %}>
> <a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a></li>
> {% endfor %}
> </ul>
> {% endif %}
>
> The else option is simply a duplication of djangos own admin/filter.html
>
>
>
>
>
> On Friday, 1 February 2008 10:55:21 UTC+1, Julien wrote:
>>
>> Hello there,
>>
>> The list_filter meta attribute lets you add filters in the admin
>> interface. It's great, but the problem is that the field I'm filtering
>> (a ForeignKey) has thousands of values, so I get thousands of links
>> put in the right end side of the page.
>>
>> Is it possible to have a drop down list or something that compresses
>> the space taken by that list of values?
>>
>> Thanks a lot!
>>
>> Julien
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.