def update_model(self, model):
    model.number = self.number.data
    model.group = self.group.data
    model.duration = self.duration.data
    model.description = self.description.data
    model.type = self.type.data
    model.vote_id = None
    model.election_id = None
    model.election_compound_id = None
    if (self.type.data == 'simple_vote'):
        model.vote_id = self.simple_vote.data
    elif (self.type.data == 'complex_vote'):
        model.vote_id = self.complex_vote.data
    elif (self.type.data == 'majorz_election'):
        model.election_id = self.majorz_election.data
    elif (self.type.data == 'proporz_election'):
        model.election_id = self.proporz_election.data
    elif (self.type.data == 'election_compound'):
        model.election_compound_id = self.election_compound.data
    model.structure = self.structure.data
    model.css = self.css.data
def update_model(self, model):
    model.number = self.number.data
    model.group = self.group.data
    model.duration = self.duration.data
    model.description = self.description.data
    model.type = self.type.data
    model.vote_id = None
    model.election_id = None
    model.election_compound_id = None
    if (self.type.data == 'simple_vote'):
        model.vote_id = self.simple_vote.data
    elif (self.type.data == 'complex_vote'):
        model.vote_id = self.complex_vote.data
    elif (self.type.data == 'majorz_election'):
        model.election_id = self.majorz_election.data
    elif (self.type.data == 'proporz_election'):
        model.election_id = self.proporz_election.data
    elif (self.type.data == 'election_compound'):
        model.election_compound_id = self.election_compound.data
    model.structure = self.structure.data
    model.css = self.css.data