示例#1
0
def get_sex_choose_list():
    return [
        ChooseModel(value='male',
                    choose_text_list=[{
                        'text': 'male',
                        'width': None
                    }],
                    icon=resource.get_pic('icon', 'male.png')),
        ChooseModel(value='female',
                    choose_text_list=[{
                        'text': 'female',
                        'width': None
                    }],
                    icon=resource.get_pic('icon', 'female.png')),
    ]
示例#2
0
class Person(Entity):
    user_login = CharField(column_name='user_login', null=False)
    user_pwd = CharField(column_name='user_pwd', null=False)
    first_name = CharField(column_name='first_name', null=True)
    last_name = CharField(column_name='last_name', null=True)
    full_name = CharField(column_name='full_name', null=True)
    cn_name = CharField(column_name='cn_name', null=True)
    sex = CharField(column_name='sex', default='male')
    email = CharField(column_name='email', null=True)
    active = BooleanField(column_name='active', default=1)
    join_date = DateField(column_name='join_date', default=datetime.date.today())
    leave_date = DateField(column_name='leave_date', null=True)
    last_login_time = DateTimeField(column_name='last_login_time', default=datetime.datetime.now())

    thumbnail = dm.fk(fk_model_name='File', column_name='thumbnail_id', field='id',
                                 null=True)
    department = dm.fk(fk_model_name='Department', column_name='department_id', field='id', backref='persons',
                                 null=True)
    permission_group = dm.fk(fk_model_name='PermissionGroup', column_name='permission_id', field='id',
                                       backref='persons', null=True)

    class Meta:
        db_table = 'human_users'

    icon = resource.get_pic('icon', 'Persons.png')

    @property
    def department_name(self):
        if self.department:
            return self.department.code
        return None

    @department_name.setter
    def department_name(self, value):
        self.department = Department.get(code=value)

    @property
    def permission_group_name(self):
        if self.permission_group:
            return self.permission_group.code
        return None

    @permission_group_name.setter
    def permission_group_name(self, value):
        self.permission_group = PermissionGroup.get(code=value)

    @property
    def project_objects(self):
        return {'objects': self.projects, 'object_label_attr': 'code'}

    @property
    def group_objects(self):
        return {'objects': self.groups, 'object_label_attr': 'code'}

    @property
    def label_name(self):
        return self.user_login
示例#3
0
class PipelineStep(Entity):
    name = CharField(column_name='name', null=False)
    full_name = CharField(column_name='full_name', null=True)
    color = BigIntegerField(column_name='color', null=True)
    description = TextField(column_name='description', null=True)

    class Meta:
        db_table = 'pipeline_steps'

    icon = resource.get_pic('icon', 'PipelineSteps.png')
示例#4
0
class Group(Entity):
    code = CharField(column_name='code', null=False)
    full_name = CharField(column_name='full_name', null=True)
    description = TextField(column_name='description', null=True)

    persons = dm.mtm(model_name='Person', through_model_name='GroupPersonConnection', backref='groups')

    class Meta:
        db_table = 'groups'

    icon = resource.get_pic('icon', 'Groups.png')
示例#5
0
class Sequence(ModelBase):
    name = CharField(column_name='name', null=False)
    description = TextField(column_name='description', null=True)

    project = ForeignKeyField(column_name='project_id', model=Project, field='id', backref='sequences', null=False)

    class Meta:
        db_table = 'sequences'

    icon = resource.get_pic('icon', 'Sequences.png')
    status = 'wip'  # temp
示例#6
0
class Department(Entity):
    code = CharField(column_name='code', null=False)
    full_name = CharField(column_name='full_name', null=False)
    description = TextField(column_name='description', null=True)
    color = BigIntegerField(column_name='color', null=True)

    class Meta:
        db_table = 'departments'

    icon = resource.get_pic('icon', 'Departments.png')

    @property
    def person_objects(self):
        return {'objects': self.persons, 'object_label_attr': 'full_name'}
示例#7
0
class Sequence(Entity):
    name = CharField(column_name='name', null=False)
    description = TextField(column_name='description', null=True)
    status = CharField(column_name='status', default='wts')

    project = dm.fk(fk_model_name='Project', column_name='project_id', field='id', backref='sequences', null=False)

    class Meta:
        db_table = 'sequences'

    icon = resource.get_pic('icon', 'Sequences.png')

    @property
    def children(self):
        return self.shots
示例#8
0
def get_department_choose_list():
    choose_list = []
    for department in Department.select():
        name = department.code
        full_name = department.full_name
        color = department.color
        choose_list.append(
            ChooseModel(value=name,
                        choose_text_list=[{
                            'text': name,
                            'width': 40
                        }, {
                            'text': full_name,
                            'width': None
                        }],
                        color=color,
                        icon=resource.get_pic('icon', 'Departments.png'),
                        tooltip=full_name))
    return choose_list
示例#9
0
    def __init__(self):
        super(TestTabWindow, self).__init__()

        testList = QListWidget()
        testList.addItems(["aa", "bb", "cc"])

        self.add_tab(QLabel("Artist"), MainTabButton("Artist"), "Artist")
        self.add_tab(QLabel("Project"),
                     MainTabButton("Project", pulldown=TestProjectTable()),
                     "Project")
        self.add_tab(
            QLabel("Media"),
            MainTabButton("Media",
                          icon=resource.get_pic("button/playButton_blue.png"),
                          parent=self), "Media")
        self.add_head(MainTabButton("LOGO"))
        self.add_tail(QLineEdit())
        self.add_tail(MainTabButton("ZZZ"))
        self.load_tab()