Exemplo n.º 1
0
def load_data_to_db():
    group = Group("Python")
    GroupController().create(group)

    group = Group("Java")
    GroupController().create(group)

    group = Group("C++")
    GroupController().create(group)

    group = Group("C#")
    GroupController().create(group)

    group = Group("JavaScript")
    GroupController().create(group)

    # --------------------------------
    student = Student("Pavelchak", "Andrii", to_date("09-05-1976"), 1)
    StudentController().create(student)

    student = Student("Yatsuk", "Yuri", to_date("26-04-1983"), 1)
    StudentController().create(student)

    student = Student("Veres", "Zenovii", to_date("19-08-1984"), 2)
    StudentController().create(student)

    student = Student("Ivaniuk", "Oleh", to_date("02-09-1983"), 5)
    StudentController().create(student)

    student = Student("Lopachak", "Oleh", to_date("09-05-1976"), 3)
    StudentController().create(student)

    student = Student("Garaniuk", "Ihor", to_date("09-05-1953"), 2)
    StudentController().create(student)

    student = Student("Mokrenko", "Petro", to_date("09-12-1939"), 4)
    StudentController().create(student)

    student = Student("Kovela", "Ivan", to_date("09-05-1948"), 4)
    StudentController().create(student)
Exemplo n.º 2
0
 def __patch_group(self):
     key = int(raw_input("Input Group->ID:"))
     field_name = raw_input("Input Group->field name:")
     value = raw_input("Input Group->new VALUE:")
     GroupController().patch(key, field_name, value)
Exemplo n.º 3
0
 def __find_by_id_group(self):
     key = int(raw_input("Input Group->ID:"))
     group = GroupController().find_by_id(key)
     print group
Exemplo n.º 4
0
 def __delete_group(self):
     key = int(raw_input("Input Group->ID:"))
     GroupController().delete(key)
Exemplo n.º 5
0
 def __update_group(self):
     key = int(raw_input("Input Group->ID:"))
     name = raw_input("Input Group->new NAME:")
     group = Group(name)
     GroupController().update(key, group)
Exemplo n.º 6
0
 def __create_group(self):
     name = raw_input("Input Group->Name:")
     group = Group(name)
     GroupController().create(group)
     print group.id
Exemplo n.º 7
0
 def __select_group(self):
     print "TABLE Group:"
     groups = GroupController().find_all()
     for group in groups:
         print group