Commit 0ee7be00a64c836e0239b06836d219f6c9605177
1 parent
376a8d99
możliwość edycji kwalifikatorów niezależnie od słowników
Showing
2 changed files
with
10 additions
and
9 deletions
dictionary/ajax_lexeme_view.py
... | ... | @@ -393,7 +393,8 @@ def update_lexeme(request, form_data): |
393 | 393 | def update_lexeme_qualifiers(lexeme, user, form_dict, form_data): |
394 | 394 | owner = lexeme.owner_vocabulary |
395 | 395 | editable_vocabs = editable_vocabularies(user).exclude(pk=owner.pk) |
396 | - l_editable_vocabs = lexeme.editable_vocabularies(user) | |
396 | + #l_editable_vocabs = lexeme.editable_vocabularies(user) | |
397 | + l_editable_vocabs = editable_vocabularies(user) | |
397 | 398 | qualifiers = Qualifier.objects.filter(vocabulary__in=l_editable_vocabs) |
398 | 399 | for qualifier in qualifiers: |
399 | 400 | qualifier.set_for( |
... | ... |
dictionary/forms.py
... | ... | @@ -28,14 +28,14 @@ class QualifiersField(ModelMultipleChoiceField): |
28 | 28 | self.to_field_name = None #? |
29 | 29 | |
30 | 30 | def set_qualifiers(self, user, qualified=None, lexeme=None, type=None): |
31 | - if qualified and qualified.id: | |
32 | - if lexeme: | |
33 | - vocabularies = lexeme.editable_vocabularies(user) | |
34 | - else: | |
35 | - vocabularies = qualified.editable_vocabularies(user) | |
36 | - qualifiers = Qualifier.objects.filter(vocabulary__in=vocabularies) | |
37 | - else: | |
38 | - qualifiers = editable_qualifiers(user) | |
31 | + # if qualified and qualified.id: | |
32 | + # if lexeme: | |
33 | + # vocabularies = lexeme.editable_vocabularies(user) | |
34 | + # else: | |
35 | + # vocabularies = qualified.editable_vocabularies(user) | |
36 | + # qualifiers = Qualifier.objects.filter(vocabulary__in=vocabularies) | |
37 | + # else: | |
38 | + qualifiers = editable_qualifiers(user) | |
39 | 39 | if type: |
40 | 40 | qualifiers = qualifiers.filter(type=type) |
41 | 41 | if not qualifiers: |
... | ... |