-Subproject commit 97475f2813a36e402296d5f2389fe10cd4cd1e0b
+Subproject commit bd60745ce82318b1819768c9a31db0579228654d
class HayAdvanceForm(SearchForm):
#to replace de basic search form field
q = forms.CharField(required=False, label=('Title'), widget=forms.TextInput(attrs={'type': 'search'}))
- cote = forms.CharField(required=False, label=('Cote'), widget=forms.TextInput(attrs={'type': 'search'}))
+ code = forms.CharField(required=False, label=('Code'), widget=forms.TextInput(attrs={'type': 'search'}))
location = forms.CharField(required=False, label=('Location'), widget=forms.TextInput(attrs={'type': 'search'}))
def search(self):
if self.cleaned_data.get('q'):
sqs = sqs.filter(title__title__contains=self.cleaned_data['q'])
- if self.cleaned_data.get('cote'):
- sqs = sqs.filter(cote__cote__contains=self.cleaned_data['cote'])
+ if self.cleaned_data.get('code'):
+ sqs = sqs.filter(code__code__contains=self.cleaned_data['code'])
if self.cleaned_data.get('location'):
sqs = sqs.filter(location__location__contains=self.cleaned_data['location'])
{% if query %}
<h1>{% trans "Results" %}</h1>
{% ifequal type 'item' %}
- <p><b>Items ({{item_count}}) | <a href="{% url "haystack_advance_search_type" "collection" %}?q={{ query.q }}&cote={{ query.cote }}&location={{ query.location}}&page=1">Collections ({{collection_count}})</a></b></p>
+ <p><b>Items ({{item_count}}) | <a href="{% url "haystack_advance_search_type" "collection" %}?q={{ query.q }}&code={{ query.code }}&location={{ query.location}}&page=1">Collections ({{collection_count}})</a></b></p>
{% else %}
{% ifequal type 'collection'%}
- <p><b><a href="{% url "haystack_advance_search_type" "item" %}?q={{ query.q }}&cote={{ query.cote }}&location={{ query.location}}&page=1">Items ({{item_count}}) </a>| Collections ({{collection_count}})</b></p>
+ <p><b><a href="{% url "haystack_advance_search_type" "item" %}?q={{ query.q }}&code={{ query.code }}&location={{ query.location}}&page=1">Items ({{item_count}}) </a>| Collections ({{collection_count}})</b></p>
{% endifequal %}
{% endifequal %}
{% with object_list as items %}
{% if page.has_previous or page.has_next %}
<div>
- {% if page.has_previous %}<a href="?q={{ query.q }}&cote={{ query.cote }}&location={{ query.location}}&page={{ page.previous_page_number }}">{% endif %}« Previous{% if page.has_previous %}</a>{% endif %}
+ {% if page.has_previous %}<a href="?q={{ query.q }}&code={{ query.code }}&location={{ query.location}}&page={{ page.previous_page_number }}">{% endif %}« Previous{% if page.has_previous %}</a>{% endif %}
|
- {% if page.has_next %}<a href="?q={{ query.q }}&cote={{ query.cote }}&location={{ query.location}}&page={{ page.next_page_number }}">{% endif %}Next »{% if page.has_next %}</a>{% endif %}
+ {% if page.has_next %}<a href="?q={{ query.q }}&code={{ query.code }}&location={{ query.location}}&page={{ page.next_page_number }}">{% endif %}Next »{% if page.has_next %}</a>{% endif %}
</div>
{% endif %}
{% endwith %}
if self.request.GET.get('q'):
extra['title'] = self.request.GET['q']
- if self.request.GET.get('cote'):
- extra['cote'] = self.request.GET['cote']
+ if self.request.GET.get('code'):
+ extra['code'] = self.request.GET['code']
if self.request.GET.get('location'):
extra['location'] = self.request.GET['location']