def __init__(self,role,db_path):
     role_list = ['admin','school','teacher','course','course_to_teacher','classes','student','score']
     if role not in role_list:
         raise Exception('用户角色错误,选项:%s' % ','.join(role_list))
     self.role = role
     self.uuid = commons.create_uuid()
     self.db_path = db_path
Exemplo n.º 2
0
    def __init__(self, role):
        """
        该对象用于标识唯一ID
        :param role: 角色名称
        """
        if role not in settings.DB_DIR_DICT:
            raise Exception('用户角色定义错误,选项为:%s' % ','.join(settings.DB_DIR_DICT))

        self.role = role
        self.uuid = commons.create_uuid()
        self.db_path = settings.DB_DIR_DICT[role]
Exemplo n.º 3
0
 def __init__(self, role, db_path):
     """
     该对象用于标识唯一ID
     :param role: 角色:school,teacher,
     :return:
     """
     role_list = [
         'admin', 'school', 'teacher', 'course', 'course_to_teacher', 'classes', 'student'
     ]
     if role not in role_list:
         raise Exception('用户角色定义错误,选项为:%s' % ','.join(role_list))
     self.role = role
     self.uuid = commons.create_uuid()
     self.db_path = db_path
Exemplo n.º 4
0
    def __init__(self, role, db_path):
        """
        标识唯一ID
        :param role:
        :param db_path:
        """
        role_list = [
            'admin', 'school', 'teacher', 'course', 'course_to_teacher',
            'classes', "student"
        ]

        if role not in role_list:
            raise Exception('用户角色错误,选择为:%s' % ",".join(role_list))

        self.role = role
        self.uuid = commons.create_uuid()
        self.db_path = db_path
Exemplo n.º 5
0
 def __init__(self, name):
     self.name = name
     self.id = create_uuid()
     self.save()
Exemplo n.º 6
0
 def __init__(self, role, db_path):
     self.role = role
     self.db_path = db_path
     self.uuid = commons.create_uuid()