Commit 5de7aa01eb730fccec27fd3b1b3a8a9c4cfe4551
1 parent
ae00e34b
usunięcie powtórzeń
Showing
2 changed files
with
4 additions
and
3 deletions
semantics/static/js/semantics_lexical_units.js
@@ -331,7 +331,7 @@ function lexicalisationForm(lemma, pre, tokenised) { | @@ -331,7 +331,7 @@ function lexicalisationForm(lemma, pre, tokenised) { | ||
331 | } | 331 | } |
332 | 332 | ||
333 | $.ajax({ | 333 | $.ajax({ |
334 | - type: "GET", | 334 | + type: "POST", |
335 | dataType: "json", | 335 | dataType: "json", |
336 | url: ajax_get_mwes, | 336 | url: ajax_get_mwes, |
337 | data: {"options": JSON.stringify(list)}, | 337 | data: {"options": JSON.stringify(list)}, |
semantics/views.py
@@ -646,10 +646,11 @@ def relational_preference_form(request): | @@ -646,10 +646,11 @@ def relational_preference_form(request): | ||
646 | form = RelationalSelPrefForm() | 646 | form = RelationalSelPrefForm() |
647 | return {'form': form} | 647 | return {'form': form} |
648 | 648 | ||
649 | -@ajax(method='get', encode_result=True) | 649 | +@ajax(method='post', encode_result=True) |
650 | def ajax_get_mwes(request, options): | 650 | def ajax_get_mwes(request, options): |
651 | results = [] | 651 | results = [] |
652 | - for term in options: | 652 | + bases = sorted(list(set(options))) |
653 | + for term in bases: | ||
653 | term = unicode(term) | 654 | term = unicode(term) |
654 | if len(term) > 0: | 655 | if len(term) > 0: |
655 | obj_results = LexicalUnit.objects.filter(base=term) | 656 | obj_results = LexicalUnit.objects.filter(base=term) |