Commit d3dcde9bccfea168af1b605a5e996e5e25787a17
1 parent
71ad2c03
Zapis jednostek frazeologicznych
Showing
1 changed file
with
4 additions
and
3 deletions
semantics/saving.py
... | ... | @@ -12,16 +12,17 @@ from wordnet.models import Hypernymy, LexicalUnit, Synonymy, Synset |
12 | 12 | |
13 | 13 | def modify_frames(lemma_id, operations, user): |
14 | 14 | store_old_versions(lemma_id, operations, user) |
15 | - make_operations(operations) | |
15 | + make_operations(lemma_id, operations) | |
16 | 16 | |
17 | -def make_operations(operations): | |
17 | +def make_operations(lemma_id, operations): | |
18 | 18 | translation = {'unit_id': {}, 'frame_id': {}, 'complement_id': {}, 'preference_id': {}} |
19 | + entry = Lemma.objects.get(id=lemma_id).entry_obj | |
19 | 20 | for operation in operations: |
20 | 21 | if operation['operation'] == "create_frame": |
21 | 22 | luids = [int(m['id']) for m in operation['meanings']] |
22 | 23 | translation['frame_id'][int(operation['id'])] = create_frame(luids) |
23 | 24 | elif operation['operation'] == "add_unit": |
24 | - translation['unit_id'][int(operation['unit']['id'])] = add_unit(operation['unit']) | |
25 | + translation['unit_id'][int(operation['unit']['id'])] = add_unit(entry, operation['unit']) | |
25 | 26 | elif operation['operation'] == "remove_frame": |
26 | 27 | if int(operation['id']) in translation['frame_id']: |
27 | 28 | frame_id = translation['frame_id'][int(operation['id'])] |
... | ... |