Commit 0da7049f0ed3c426487245dbfeb6b635db6ecb82

Authored by Bartłomiej Nitoń
1 parent a5734633

Bugfix for schema edition form submit.

dictionary/static/js/lemma-view.js
... ... @@ -2000,10 +2000,10 @@ function frame_form_submit() {
2000 2000 else {
2001 2001 edited_frame = getElementInstance(edited_id, schemas);
2002 2002 var old_edited_frame_id = edited_frame['element'].id;
2003   - //edited_frame['element'].id = new_elem_id; tuta zmienilem
2004   - edited_frame['element'].id = result['id'];
  2003 + edited_frame['element'].id = new_elem_id; //tutaj zmienilem
  2004 + //edited_frame['element'].id = result['id'];
2005 2005 edited_frame_id = edited_frame['element'].id;
2006   - //new_elem_id--;
  2006 + new_elem_id--;
2007 2007 edited_frame['element'].text_rep = result['text_rep'];
2008 2008 edited_frame['element'].characteristics = result['characteristics'];
2009 2009 edited_frame['element'].opinion = result['opinion'];
... ...
semantics/views.py
... ... @@ -72,7 +72,8 @@ def reorder_history(frames_list):
72 72 def ajax_frames(request, lemma_id):
73 73  
74 74 lemma = Lemma.objects.get(id=lemma_id, old=False)
75   - lexical_units = LexicalUnit.objects.filter(Q(base__startswith=lemma.entry + u' ')|Q(base__contains=u' '+lemma.entry+u' ')|Q(base__endswith=u' '+lemma.entry)|Q(base=lemma.entry)).order_by('sense')
  75 + #lexical_units = LexicalUnit.objects.filter(Q(base__startswith=lemma.entry + u' ')|Q(base__contains=u' '+lemma.entry+u' ')|Q(base__endswith=u' '+lemma.entry)|Q(base=lemma.entry)).order_by('sense')
  76 + lexical_units = LexicalUnit.objects.filter(Q(base = lemma.entry)|Q(base = lemma.entry + u' się')).order_by('sense')
76 77  
77 78 alternations = {}
78 79 frames_dict = {}
... ... @@ -205,8 +206,8 @@ def ajax_frames(request, lemma_id):
205 206 @ajax(method='get', encode_result=False)
206 207 def ajax_units(request, lemma_id):
207 208 lemma = Lemma.objects.get(id=lemma_id, old=False)
208   -# lexical_units = LexicalUnit.objects.filter(Q(base = lemma.entry, pos="czasownik")|Q(base = lemma.entry + u' się', pos="czasownik")).order_by('base', 'sense')
209   - lexical_units = LexicalUnit.objects.filter(Q(base__startswith=lemma.entry + u' ', pos="czasownik")|Q(base__contains=u' '+lemma.entry+u' ', pos="czasownik")|Q(base__endswith=u' '+lemma.entry, pos="czasownik")|Q(base=lemma.entry, pos="czasownik")).order_by('base', 'sense')
  209 + lexical_units = LexicalUnit.objects.filter(Q(base = lemma.entry, pos="czasownik")|Q(base = lemma.entry + u' się', pos="czasownik")).order_by('base', 'sense')
  210 +# lexical_units = LexicalUnit.objects.filter(Q(base__startswith=lemma.entry + u' ', pos="czasownik")|Q(base__contains=u' '+lemma.entry+u' ', pos="czasownik")|Q(base__endswith=u' '+lemma.entry, pos="czasownik")|Q(base=lemma.entry, pos="czasownik")).order_by('base', 'sense')
210 211  
211 212 context = {
212 213 'lexical_units': [{"id": lu.id, "luid": lu.luid, "base": lu.base, "sense": lu.sense, "pos": lu.pos, "glossa": lu.glossa, "definition": lu.definition} for lu in lexical_units],
... ...