WIP: new way for making empty objects (sense, translation,...)

This commit is contained in:
2019-11-17 21:23:28 +01:00
parent 14655bd6cf
commit 3cfcef6253
5 changed files with 14 additions and 15 deletions

View File

@@ -98,8 +98,10 @@ class ShowAddTranslation(GenericShowModal):
for sense in model.entry.senses:
if sense == chosen_sense:
translation = Translation.new_empty()
translation.make_copy()
model.modal = lambda: modals.edit_translation(
sense, -1, len(sense.translations), AddTranslation, sense)
translation, -1, len(sense.translations), AddTranslation(translation, -1, sense))
return
console.log("Should not be here!")

View File

@@ -56,7 +56,7 @@ class EditExampleTranslation(Message):
class AddSense(SimpleEditMessage):
def update_model(self, model):
sense = self.prop
sense = Sense.new_empty()
sense.labels = [self.new_text]
model.entry.senses.append(sense)