def gen_specialization(self): specialization = self.Specialization_postgres( specialization_id=self.id, specialization_name=generate_name_string("spec ", 5), ) self.id = self.id + 1 return specialization
def gen_subdivision(self, d_faculty_id): subdivision = self.Subdivision_postgres( subdivision_id=self.id, subdivision_name=generate_name_string("subdivision ", 12), d_faculty_id=d_faculty_id) self.id = self.id + 1 return subdivision
def gen_faculty(self, f_university_id): faculty = self.Faculty_postgres(faculty_id=self.id, faculty_name=generate_name_string( "Faculty ", 12), f_university_id=f_university_id) self.id = self.id + 1 return faculty
def gen_university(self): st = ["standart", "original"] university = self.University_postgres( university_id=self.id, university_name=generate_name_string("ITMO", 2), university_standart_type=st[randrange(len(st))]) self.id = self.id + 1 return university
def gen_student_group(self, gr_subdivision, gr_specialization): group = self.Student_group_postgres( group_id=self.id, group_name=generate_name_string("14", 3), year=postgres_date( random_date( datetime.strptime('01/01/1980 01:00 AM', '%m/%d/%Y %I:%M %p'), datetime.strptime('01/01/2019 01:00 AM', '%m/%d/%Y %I:%M %p'))), group_subdivision=gr_subdivision, group_specialization=gr_specialization, course_number=randrange(4)) self.id = self.id + 1 return group
def gen_subject(self): subject = self.Subject_postgres(subject_id=self.id, subject_name=generate_name_string( "Foundations of ", 10)) self.id = self.id + 1 return subject