Skip to content

Commit

Permalink
Bulk cognate disconnects from Xlsx #313
Browse files Browse the repository at this point in the history
  • Loading branch information
myrix committed Sep 21, 2020
1 parent bcdde40 commit 5a2a388
Show file tree
Hide file tree
Showing 5 changed files with 1,115 additions and 9 deletions.
20 changes: 18 additions & 2 deletions lingvodoc/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,9 +1202,25 @@ class Entity(CompositeIdMixin,
locale_id = Column(SLBigInteger())

def __init__(self, **kwargs):

pe_kwargs = {}

if 'published' in kwargs:
pe_kwargs['published'] = kwargs.pop('published')

if 'accepted' in kwargs:
pe_kwargs['accepted'] = kwargs.pop('accepted')

super().__init__(**kwargs)
publishingentity = PublishingEntity(client_id=self.client_id, object_id=self.object_id,
created_at=self.created_at)

publishingentity = (

PublishingEntity(
client_id = self.client_id,
object_id = self.object_id,
created_at = self.created_at,
**pe_kwargs))

DBSession.add(publishingentity)
self.publishingentity = publishingentity

Expand Down
6 changes: 4 additions & 2 deletions lingvodoc/schema/gql_lexicalentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,11 @@ def mutate(root, info, **args):
tags.append(tag)
if not tags:
n = 10 # better read from settings
rnd = random.SystemRandom()
choice_str = string.digits + string.ascii_letters
tag = (
time.asctime(time.gmtime()) + ''.join(
random.SystemRandom().choice(string.ascii_uppercase + string.digits) for c in range(n)))
time.asctime(time.gmtime()) +
''.join(rnd.choice(choice_str) for c in range(n)))
tags.append(tag)
lexical_entries = find_lexical_entries_by_tags(tags, field_id[0], field_id[1], False, False)
for par in connections:
Expand Down
Loading

0 comments on commit 5a2a388

Please sign in to comment.