Exemple #1
0
def init_db():
    # Create the fixtures
    engineering = Department(name='Engineering')
    engineering.save()

    hr = Department(name='Human Resources')
    hr.save()

    manager = Role(name='manager')
    manager.save()

    engineer = Role(name='engineer')
    engineer.save()

    peter = Person(first_name='Peter',
                   last_name='Parker',
                   department=engineering,
                   role=engineer)
    peter.save()

    roy = Person(first_name='Roy',
                 last_name='Royce',
                 department=engineering,
                 role=engineer)
    roy.save()

    tracy = Person(first_name='Tracy',
                   last_name='Monita',
                   department=hr,
                   role=manager)
    tracy.save()
Exemple #2
0
def init_db():
    # import all modules here that might define models so that
    # they will be registered properly on the metadata.  Otherwise
    # you will have to import them first before calling init_db()
    from models import Department, Employee, Role
    Base.metadata.drop_all(bind=engine)
    Base.metadata.create_all(bind=engine)

    # Create the fixtures
    engineering = Department(name='Engineering')
    db_session.add(engineering)
    hr = Department(name='Human Resources')
    db_session.add(hr)

    manager = Role(name='manager')
    db_session.add(manager)
    engineer = Role(name='engineer')
    db_session.add(engineer)

    peter = Employee(name='Peter', department=engineering, role=engineer)
    db_session.add(peter)
    roy = Employee(name='Roy', department=engineering, role=engineer)
    db_session.add(roy)
    tracy = Employee(name='Tracy', department=hr, role=manager)
    db_session.add(tracy)
    db_session.commit()
Exemple #3
0
def add_department(self):
    # -------------------------
    # Add a department
    # -------------------------
    name = request.form.get('name', '')

    id = 0

    try:
        id = Department().get_next_department_id()
    except BaseException:
        app.logger.info('Error finding next department ID')
        abort(422)

    department = Department(
        id=id,
        name=name
    )

    try:
        department = department.add_department_to_database()
        flash(f'Department {name} was successfully added!', 'success')
    except BaseException:
        app.logger.info(
            f'An error occurred. Department {name} could not be added!')
        abort(422)

    return redirect(url_for('departments'))
Exemple #4
0
def departmentJobname():
    '''
        新增部门名称,岗位名称及其显示
    '''

    department = Department.query.order_by('id desc').all()
    jobname = Jobname.query.order_by('id desc').all()

    if request.method == 'POST':
        department = request.form.get('department', '')
        jobname = request.form.get('jobname', '')

        if department and jobname:
            db.session.add(Department(department))
            db.session.add(Jobname(jobname))
            db.session.commit()
        elif department:
            db.session.add(Department(department))
            db.session.commit()
        elif jobname:
            db.session.add(Jobname(jobname))
            db.session.commit()

        return redirect(url_for('.departmentJobname'))

    return render_template('userManage/departmentJobname.html', data=locals())
Exemple #5
0
def create_data():
    Base.metadata.create_all(bind=engine)

    engineering = Department(name='Engineering')
    db_session.add(engineering)
    hr = Department(name='Human Resources')
    db_session.add(hr)

    peter = Employee(name='Peter',
                     department=engineering,
                     hobbies="['pool', 'sitting down']",
                     results="{'code': 'A+', 'team work': 'C'}")
    db_session.add(peter)
    roy = Employee(name='Roy',
                   department=engineering,
                   hobbies="['football', 'mechanics']",
                   results="{'code': 'B', 'team work': 'A'}")
    db_session.add(roy)
    tracy = Employee(name='Tracy',
                     department=hr,
                     hobbies="['smoking', 'guns']",
                     results="{'code': 'A+', 'team work': 'B'}")
    db_session.add(tracy)

    db_session.commit()

    return jsonify({'status': 'ok'})
async def init_db():
    from models import Department, Employee, Role
    Base.metadata.drop_all(bind=engine)
    Base.metadata.create_all(bind=engine)

    # Create Fixture for department
    engineering = Department(name='Engineering')
    db_session.add(engineering)
    hr = Department(name='Human Resource')
    db_session.add(hr)

    # Create Fixture for Role
    manager = Role(name='manager')
    db_session.add(manager)
    engineer = Role(name='Engineer')
    db_session.add(engineer)

    # Create
    peter = Employee(name='Peter', department=engineering, role=manager)
    db_session.add(peter)
    roy = Employee(name='Roy', department=engineering, role=engineer)
    db_session.add(roy)
    tracy = Employee(name='Tracy', department=hr, role=manager)
    db_session.add(tracy)

    # Insert seed data into database
    db_session.commit()
Exemple #7
0
def init_db():
    # import all modules here that might define models so that
    # they will be registered properly on the metadata.  Otherwise
    # you will have to import them first before calling init_db()
    from models import Department, Employee, Role
    Base.metadata.drop_all(bind=engine)
    Base.metadata.create_all(bind=engine)

    # Create the fixtures
    one_app = Department(name='One App(人工智能)')
    db_session.add(one_app)
    tire = Department(name='TireO2O(卖轮胎的)')
    db_session.add(tire)
    hr = Department(name='HR(协助人口买卖)')
    db_session.add(hr)

    manager = Role(name='product manager')
    db_session.add(manager)
    engineer = Role(name='engineer')
    db_session.add(engineer)

    hydra = Employee(name='Hydra', department=one_app, role=engineer)
    db_session.add(hydra)
    samuel = Employee(name='Samuel', department=one_app, role=engineer)
    db_session.add(samuel)
    tony = Employee(name='Tony', department=one_app, role=manager)
    db_session.add(tony)
    daisy = Employee(name='Daisy', department=tire, role=manager)
    db_session.add(daisy)
    kyle = Employee(name='Kyle', department=tire, role=engineer)
    db_session.add(kyle)
    xenia = Employee(name='Xenia', department=hr, role=manager)
    db_session.add(xenia)
    db_session.commit()
Exemple #8
0
def init_db():
    # import all modules here that might define models so that
    # they will be registered properly on the metadata.  Otherwise
    # you will have to import them first before calling init_db()
    from models import Department, Employee, Role
    Base.metadata.drop_all(bind=engine)
    Base.metadata.create_all(bind=engine)

    # Create the fixtures
    engineering = Department(name='Engineering')
    db_session.add(engineering)
    hr = Department(name='Human Resources')
    db_session.add(hr)

    manager = Role(name='manager')
    db_session.add(manager)
    engineer = Role(name='engineer')
    db_session.add(engineer)

    peter = Employee(name='Peter', department=engineering, role=engineer)
    db_session.add(peter)
    roy = Employee(name='Roy', department=engineering, role=engineer)
    db_session.add(roy)
    tracy = Employee(name='Tracy', department=hr, role=manager)

    # postgresql specific dialects tests
    # tracy.articles = [1, 2, 3, 4]
    # tracy.json_data = {"test_json": "test_json"}
    # tracy.jsonb_data = {"test_jsonb": "test_jsonb"}
    # tracy.hstore_data = {"test_hstore": "test_hstore"}

    db_session.add(tracy)
    db_session.commit()
def create_all():
    if not database_exists('sqlite:///fastlane.db'):
        db.create_all()
        db.session.add(Department(department_name='Design'))
        db.session.add(Department(department_name='Production'))
        db.session.add(Department(department_name='Prototype'))
        db.session.commit()
Exemple #10
0
def init_db():
    # import all modules here that might define models so that
    # they will be registered properly on the metadata.  Otherwise
    # you will have to import them first before calling init_db()
    from models import Department, Employee, Role
    for model in [Department, Employee, Role]:
        if model.exists():
            model.delete_table()
        model.create_table(read_capacity_units=1, write_capacity_units=1, wait=True)

    # Create the fixtures
    engineering = Department(id=str(uuid4()), name='Engineering')
    engineering.save()
    hr = Department(id=str(uuid4()), name='Human Resources')
    hr.save()

    manager = Role(id=str(uuid4()), name='manager')
    manager.save()

    engineer = Role(id=str(uuid4()), name='engineer')
    engineer.save()

    peter = Employee(id=str(uuid4()), name='Peter', department=engineering, role=engineer)
    peter.save()

    roy = Employee(id=str(uuid4()), name='Roy', department=engineering, role=engineer)
    roy.save()

    tracy = Employee(id=str(uuid4()), name='Tracy', department=hr, role=manager)
    tracy.save()
Exemple #11
0
def init_db():
    """Import all modules here that might define models so that
    they will be registered properly on the metadata. Otherwise
    you will have to import them first before calling init_db()
    """
    from models import Department, Employee, Pokemon, Role
    Base.metadata.drop_all(bind=engine)
    Base.metadata.create_all(bind=engine)

    engineering = Department(name="Engineering")
    db_session.add(engineering)
    hr = Department(name="Human Resources")
    db_session.add(hr)

    manager = Role(name="manager")
    db_session.add(manager)
    engineer = Role(name="engineer")
    db_session.add(engineer)

    peter = Employee(name="Peter", department=engineering, role=engineer)
    db_session.add(peter)
    roy = Employee(name="Roy", department=engineering, role=engineer)
    db_session.add(roy)
    tracy = Employee(name="Tracy", department=hr, role=manager)
    db_session.add(tracy)
    db_session.commit()

    charzard = Pokemon(name="Charzard", level=100, type="fire")
    db_session.add(charzard)
    db_session.commit()
Exemple #12
0
def init_db():
    # import all modules here that might define models so that
    # they will be registered properly on the metadata.  Otherwise
    # you will have to import them first before calling init_db()
    from models import Department, User, Role, Dataset
    Base.metadata.drop_all(bind=engine)
    Base.metadata.create_all(bind=engine)

    # Create the fixtures
    engineering = Department(name='Engineering')
    db_session.add(engineering)
    hr = Department(name='Human Resources')
    db_session.add(hr)

    manager = Role(name='manager')
    db_session.add(manager)
    engineer = Role(name='engineer')
    db_session.add(engineer)

    peter = User(name='Peter', department=engineering, role=engineer)
    db_session.add(peter)
    roy = User(name='Roy', department=engineering, role=engineer)
    db_session.add(roy)
    tracy = User(name='Tracy', department=hr, role=manager)
    db_session.add(tracy)

    # Dataset
    import random
    from random import randint
    from faker import Faker
    fake = Faker('en_US')
    nPoints = 11

    # data = {'x': [randint(0, 1000) for i in range(nPoints)], 'z': [float(random.randrange(0, 1000))/100 for i in range(nPoints)], 'names': [fake.name() for i in range(nPoints)] }
    data = {
        'x': [int(i) for i in range(nPoints)],
        'z': [float(i) for i in range(nPoints)],
        'names': [fake.name() for i in range(nPoints)]
    }
    test_data1 = Dataset(name='dataset1',
                         description='First dataset',
                         table_name='data1',
                         enabled=True,
                         raw=data)
    db_session.add(test_data1)

    # data = {'x': [randint(0, 1000) for i in range(nPoints)], 'z': [float(random.randrange(0, 1000))/100 for i in range(nPoints)], 'names': [fake.name() for i in range(nPoints)] }
    # test_data2 = Dataset(name='dataset2', description='Second dataset', table_name='data2', enabled=False, raw=data)
    # db_session.add(test_data2)

    db_session.commit()
Exemple #13
0
def make_data(db):
    from models import Department, Worker, WorkCommand
    db.create_all()

    _commit = (lambda *objs: commit(db, *objs))

    d_a = Department(name='A')
    d_b = Department(name='B')
    d_c = Department(name='C')
    _commit(d_a, d_b, d_c)

    workers = [
        Worker(name='Noah', department=d_a, age=random.randrange(18, 61)),
        Worker(name='Liam', department=d_a, age=random.randrange(18, 61)),
        Worker(name='Jacob', department=d_a, age=random.randrange(18, 61)),
        Worker(name='Mason', department=d_a, age=random.randrange(18, 61)),
        Worker(name='William', department=d_a, age=random.randrange(18, 61)),
        Worker(name='Ethan', department=d_a, age=random.randrange(18, 61)),
        Worker(name='Michael', department=d_b, age=random.randrange(18, 61)),
        Worker(name='Alexander', department=d_b, age=random.randrange(18, 61)),
        Worker(name='Jayden', department=d_b, age=random.randrange(18, 61)),
        Worker(name='Daniel', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Sophia', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Emma', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Olivia', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Isabella', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Ava', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Mia', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Emily', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Abigail', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Madison', department=d_c, age=random.randrange(18, 61)),
        Worker(name='Elizabeth', department=d_c, age=random.randrange(18, 61)),
    ]

    _commit(*workers)

    work_commands = []
    for worker in workers:
        for i in xrange(random.randrange(1, 559)):
            quantity = random.randrange(1, 21)
            today = datetime.now().replace(hour=0,
                                           minute=0,
                                           second=0,
                                           microsecond=0)
            # last six month
            created = today - timedelta(random.randrange(1, 186))
            work_commands.append(
                WorkCommand(worker=worker, quantity=quantity, created=created))

    _commit(*work_commands)
def init_db():
    Base.query = db_session.query_property()
    Base.metadata.create_all(bind=engine)

    engineering = Department(name='Engineering')
    db_session.add(engineering)

    hr = Department(name='Human Resources')
    db_session.add(hr)

    db_session.add(Employee(name='Peter', department=engineering))
    db_session.add(Employee(name='Roy', department=engineering))
    db_session.add(Employee(name='Tracy', department=hr))

    db_session.commit()
    def test_create_employee(self):

        employee = Employee('Anna', 'Olekseevna', 'Ivanova', 22, '1998-01-01',
                            '+38(099)1548123', 'trainee', 2, 1, 10000)
        department = Department('IT', 'Ivanov I.I', '+38(093)1548-093')
        db.session.add(department)
        db.session.add(employee)
        db.session.commit()
        department = Department.query.get(1)
        self.assertEqual(department.id, 1)
        self.assertEqual(department.name, 'IT')
        self.assertEqual(department.manager, 'Ivanov I.I')
        self.assertEqual(department.phone, '+38(093)1548-093')
        self.assertEqual(employee.first_name, 'Anna')
        self.assertEqual(employee.patronymic, 'Olekseevna')
        self.assertEqual(employee.last_name, 'Ivanova')
        self.assertEqual(employee.age, 22)
        self.assertEqual(employee.birth_date, date(1998, 1, 1))
        self.assertEqual(employee.phone, '+38(099)1548123')
        self.assertEqual(employee.position, 'trainee')
        self.assertEqual(employee.experience, 2)
        self.assertEqual(employee.department_id, 1)
        self.assertEqual(employee.salary, 10000)

        assert department in db.session
        assert employee in db.session
Exemple #16
0
def update_user(payload={}, fields=[]):
    if 'user_id' in payload:
        user_id = payload.pop('user_id')
        # print(payload)

        user = User.objects(pk=user_id)
        if user is not None:
            user = user.first()

            if 'country' in payload:
                payload['country'] = Country(pk=payload['country'])
            if 'gender' in payload and payload['gender'] is not None:
                payload['gender'] = Gender(pk=int(payload['gender']))
            if 'languages' in payload:
                payload['languages'] = [
                    Language(pk=lang) for lang in payload['languages']
                ]
            if 'department' in payload and payload['department'] is not None:
                payload['department'] = Department(
                    pk=int(payload['department']))
            if 'chair' in payload and payload['chair'] is not None:
                payload['chair'] = Chair(pk=int(payload['chair']))
            if 'bio' in payload: payload["bio"] = payload['bio']
            updated = user.update(**payload)
            print(user)
            return updated >= 1, payload
        else:
            print("Not found")
            return False, None
    else:
        print("Not found")
        return False, None
Exemple #17
0
def add_department(department_id):
    from datetime import datetime as dd
    new_department = Department(department_id=department_id,
                                created_timestamp=dd.utcnow())
    session.add(new_department)
    session.commit()
    print(session.query(Department).all()[-1].__dict__)
Exemple #18
0
def ADDepartment():
    system('cls')
    print('Enter Name Of Department')
    name = input()
    departmentName = Department(name=name)
    session.add(departmentName)
    session.commit()
Exemple #19
0
def department(id):  #Get the department by id and the add members to it
    department = Department()
    qry = db.session.query(Department).filter(Department.id == id)
    department = qry.first()  #Handle exception for missing id in the databse
    return render_template(
        'departments/department.html', department=department
    )  #Display the department and the various members and ther positions
 def test_view_employees(self):
     response = self.client.get('/employees')
     self.assertTrue(response.status_code, 200)
     department = Department('IT', 'Ivanov I.I', '+38(093)1548-093')
     employee_1 = Employee('Anna', 'Olekseevna', 'Ivanova', 22,
                           '1998-01-01', '+38(099)1548123', 'trainee', 2, 1,
                           10000)
     db.session.add(department)
     db.session.add(employee_1)
     db.session.commit()
     employees = db.session.query(Employee.id, Employee.first_name,
                               Employee.patronymic, Employee.last_name,
                               Employee.age, Employee.birth_date,
                               Employee.phone, Employee.position,
                               Employee.experience, Employee.salary,
                               Department.name.label('department_name')) \
         .select_from(Employee) \
         .join(Department, isouter=True).all()
     self.assertEqual(employees[0].id, 1)
     self.assertEqual(employees[0].first_name, 'Anna')
     self.assertEqual(employees[0].patronymic, 'Olekseevna')
     self.assertEqual(employees[0].last_name, 'Ivanova')
     self.assertEqual(employees[0].age, 22)
     self.assertEqual(employees[0].birth_date, date(1998, 1, 1))
     self.assertEqual(employees[0].position, 'trainee')
     self.assertEqual(employees[0].experience, 2)
     self.assertEqual(employees[0].department_name, 'IT')
     self.assertEqual(employees[0].salary, 10000)
Exemple #21
0
def addaction():
    dpmname = request.form.get("dpmname")
    dpmnames = Department(dpmname=dpmname)
    db.session.add(dpmnames)
    db.session.commit()

    return redirect(url_for('show_all'))
Exemple #22
0
def employees(self):
    # -------------------------
    # List all employees
    # -------------------------
    try:
        results = Employee().list_all_employees_filtered(Department())

        if results is None:
            app.logger.info('No matches between Employees\
                and Department tables')
            abort(422)

        dtos = []

        for emp, dep in results:
            dto = EmployeeDto(
                id=emp.id,
                name=emp.name,
                department_id=emp.department_id,
                department_name=dep.name,
                title=emp.title,
                emp_number=emp.emp_number,
                address=emp.address,
                phone=emp.phone,
                wage=emp.wage,
                is_active=emp.is_active
            )

            dtos.append(dto)

        departments = Department().list_all_departments()

        if departments is None or len(departments) == 0:
            app.logger.info('Departments table is empty?')
            abort(422)

        return render_template(
            'grocery/employees.html', data=dtos,
            departments=departments,
            nickname=session[conf_profile_key]['nickname'] if
            'POSTMAN_TOKEN' not in request.headers and
            'test_permission' not in request.headers else 'Guest')
    except BaseException:
        app.logger.info('An error occurred. Employees not available')
        abort(422)
Exemple #23
0
 def add_department(self, entity):
     if entity.name == None:
         raise tt.InvalidValueException(
             2, "no department name value exception")
     entity = Department(entity)
     self.session.add(entity)
     self.session.commit()
     print("Processing department {0}".format(entity.name))
     return True
Exemple #24
0
def department_add():
	form = DepartmentNewEdit()
	if form.validate_on_submit():
		dept = Department(name=form.name.data, description=form.description.data, isfin=form.isfin.data, 
			organization=current_user.organization)
		db.session.add(dept)
		db.session.commit()
		flash('Department Added.')
		return redirect(url_for('department_list_all'))
	return render_template('/admin/dept_new.html', form=form)
Exemple #25
0
def create_department():
    #pass the model where the data is to be sent for saving ie department model
    #Pass the form data from the frontend
    form = DepartmentForm(request.form)
    if request.method == 'POST':
        department = Department()
        department.name = form.name.data
        db.session.add(department)
        db.session.commit()
    return render_template('departments/create_department.html', form=form)
Exemple #26
0
def creating_department():
    departments = Department.query.all()
    form = DepartmentForm(request.form)
    if request.method == "POST":
        name = form.name.data
        chief = form.chief.data
        Department.save(Department(name=name, chief=chief))
    return render_template('department.html',
                           departments=departments,
                           form=form)
Exemple #27
0
def init_db():
    # import all modules here that might define models so that
    # they will be registered properly on the metadata.  Otherwise
    # you will have to import them first before calling init_db()
    from models import Department, Employee, Role, User, Project, ContractValue, Questionnaire, Milestone, MilestoneChanges

    Base.metadata.drop_all(bind=engine)
    Base.metadata.create_all(bind=engine)

    # Create the fixtures
    engineering = Department(name='Engineering')
    db_session.add(engineering)

    deborah = Department(name='deborah')
    db_session.add(deborah)

    hr = Department(name='Human Resources')
    db_session.add(hr)

    manager = Role(name='manager')
    db_session.add(manager)
    engineer = Role(name='engineer')
    db_session.add(engineer)

    peter = Employee(name='Peter', department=engineering, role=engineer)
    db_session.add(peter)
    alex = Employee(name='Alex', department=engineering, role=engineer)
    db_session.add(peter)
    roy = Employee(name='Roy', department=engineering, role=engineer)
    db_session.add(roy)

    steven = User(username='******',
                  email='*****@*****.**',
                  phone='+972545239086')
    db_session.add(steven)

    tracy = Employee(name='Tracy', department=hr, role=manager)
    db_session.add(tracy)

    # basic = Project(project_name='November')
    # db_session.add(basic)
    db_session.commit()
Exemple #28
0
def init_db():
    # Create the fixtures
    engineering = Department(name='Engineering')
    engineering.save()

    hr = Department(name='Human Resources')
    hr.save()

    manager = Role(name='manager')
    manager.save()

    engineer = Role(name='engineer')
    engineer.save()

    debug = Task(name='Debug')
    test = Task(name='Test')

    tracy = Employee(
        name='Tracy',
        department=hr,
        roles=[engineer, manager],
        tasks=[]
    )
    tracy.save()

    peter = Employee(
        name='Peter',
        department=engineering,
        leader=tracy,
        roles=[engineer],
        tasks=[debug, test]
    )
    peter.save()

    roy = Employee(
        name='Roy',
        department=engineering,
        leader=tracy,
        roles=[engineer],
        tasks=[debug]
    )
    roy.save()
Exemple #29
0
def add_department():
    if request.method == 'POST':
        department_city = request.form['department_city']
        count_of_workers = request.form['count_of_workers']
        department = \
            Department(DepartmentCity=department_city,
                       CountOfWorkers=count_of_workers)
        db.session.add(department)
        db.session.commit()
        return redirect(url_for('departments'))
    return render_template('add_department.html')
Exemple #30
0
    def setUpClass(cls):

        cls.departments = []
        cls.clients = []
        cls.applications = []
        app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db'

        cls.client = app.test_client()
        cls.client.testing = True
        db.create_all()

        with open(
                f'{os.path.dirname(os.path.realpath(__file__))}/department.csv'
        ) as source:
            reader = csv.DictReader(source)
            for d in reader:
                department = \
                    Department(idDepartment=int(d['idDepartment']),
                               DepartmentCity=d['DepartmentCity'],
                               CountOfWorkers=int(d['CountOfWorkers']))
                db.session.add(department)
                cls.departments.append(department)

        with open(f'{os.path.dirname(os.path.realpath(__file__))}/client.csv'
                  ) as source:
            reader = csv.DictReader(source)
            for c in reader:
                client = \
                    Client(idClient=int(c['idClient']),
                           FirstName=c['FirstName'],
                           LastName=c['LastName'],
                           Education=c['Education'],
                           Passport=c['Passport'],
                           City=c['City'],
                           Age=int(c['Age']),
                           department_id=int(c['Department_idDepartment']))
                db.session.add(client)
                cls.clients.append(client)

        with open(
                f'{os.path.dirname(os.path.realpath(__file__))}/application.csv'
        ) as source:
            reader = csv.DictReader(source)
            for a in reader:
                application = \
                    Application(idApplication=int(a['idApplication']),
                                Sum=int(a['Sum']),
                                CreditState=a['CreditState'],
                                Currency=a['Currency'],
                                client_id=int(a['Client_idClient']))
                db.session.add(application)
                cls.applications.append(application)

        db.session.commit()