Skip to content

Commit

Permalink
static_fields.txt -> static_fields.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor committed Sep 12, 2018
1 parent 0253da1 commit bae986d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions lingvodoc/utils/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
PublishingEntity as dbPublishingEntity,
Field as dbField,
DBSession)
from lingvodoc.utils.static_fields import fields_static

#from lingvodoc.views.v2.translations import translationgist_contents

Expand Down Expand Up @@ -186,7 +187,9 @@ def find_all_tags(lexical_entry, field_client_id, field_object_id, accepted, pub
return tags

def get_id_to_field_dict():
with open('static_fields.txt') as f:
dict_with_lists = json.load(f)
dict_with_tuples = {k: tuple(v) for k, v in dict_with_lists.items()}
return dict_with_tuples
dict_with_tuples = {k: tuple(v) for k, v in fields_static.items()}
return dict_with_tuples
# with open('static_fields.py') as f:
# dict_with_lists = json.load(f)
# dict_with_tuples = {k: tuple(v) for k, v in dict_with_lists.items()}
# return dict_with_tuples
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
fields_static = {
"Transcription":[
66,
8
Expand Down

0 comments on commit bae986d

Please sign in to comment.