예제 #1
0
def HCSLS_Religion():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model("HCSLS_Religion",
                             "base", [["religion_code"]],
                             religion_code=helpers.create_field("text", True),
                             religion_name=helpers.create_field("text", True),
                             ordinal=helpers.create_field("numeric"),
                             note=helpers.create_field("text"),
                             lock=helpers.create_field("bool"),
                             religion_name2=helpers.create_field("text"),
                             created_on=helpers.create_field("text"),
                             created_by=helpers.create_field("date"),
                             modified_on=helpers.create_field("text"),
                             modified_by=helpers.create_field("date"))
        _hasCreated = True
    ret = db_context.collection("HCSLS_Religion")

    return ret
예제 #2
0
def HCSLS_TrainType():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_TrainType",
            "base", [["train_mode_code"]],
            train_mode_code=helpers.create_field("text", True),
            train_mode_name=helpers.create_field("text", True),
            train_mode_name2=helpers.create_field("text"),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
            #department_code=helpers.create_field("text")
        )
        _hasCreated = True
    ret = db_context.collection("HCSLS_TrainType")

    return ret
예제 #3
0
def HCSLS_Marital():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_Marital",
            "base",
            [["marital_code"]],
            marital_code=helpers.create_field("text", True),
            marital_name=helpers.create_field("text", True),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            marital_name2=helpers.create_field("text"),
            created_on=helpers.create_field("text"),
            created_by=helpers.create_field("date"),
            modified_on=helpers.create_field("text"),
            modified_by=helpers.create_field("date")
        )
        _hasCreated=True
    ret = db_context.collection("HCSLS_Marital")

    return ret
def TMLS_Rank():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "TMLS_Rank",
            "base",
            [["rank_code"]],
            rec_id = helpers.create_field('text'),
            valuelist_key = helpers.create_field('numeric'),
            change_object = helpers.create_field('numeric'),
            change_object_name = helpers.create_field('text'),
            priority_no = helpers.create_field('text'),
            note = helpers.create_field('numeric'),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True

    ret = db_context.collection("TMLS_Rank")

    return ret
def HCSLS_TrainTypeDetail():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_TrainTypeDetail",
            "base",
            [["train_detail_code"]],
            train_detail_code=helpers.create_field("text", True),
            train_detail_name=helpers.create_field("text", True),
            train_detail_name2=helpers.create_field("text"),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
            #department_code=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSLS_TrainTypeDetail")

    return ret
예제 #6
0
def auth_user():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "auth_user",
            "base",
            [["username"]],
            username=helpers.create_field("text",True),
            first_name=helpers.create_field("text"),
            last_name=helpers.create_field("text"),
            is_active=helpers.create_field("bool"),
            email=helpers.create_field("text"),
            is_superuser=helpers.create_field("bool"),
            is_staff=helpers.create_field("bool"),
            last_login=helpers.create_field("date"),
            password=helpers.create_field("text"),
            date_joined=helpers.create_field("date")
        )

        _hasCreated=True
    ret = db_context.collection("auth_user")

    return ret
예제 #7
0
def auth_user():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "auth_user",
            "base",
            [["username"]],
            username=helpers.create_field("text",True),
            first_name=helpers.create_field("text"),
            last_name=helpers.create_field("text"),
            is_active=helpers.create_field("bool"),
            email=helpers.create_field("text"),
            is_superuser=helpers.create_field("bool"),
            is_staff=helpers.create_field("bool"),
            last_login=helpers.create_field("date"),
            password=helpers.create_field("text"),
            date_joined=helpers.create_field("date")
        )

        _hasCreated=True
    ret = db_context.collection("auth_user")

    return ret
예제 #8
0
def HCSSYS_DataDomain():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSSYS_DataDomain",
            "base",
            [["dd_code"]],
            dd_code=helpers.create_field("text",True),
            dd_name=helpers.create_field("text"),
            access_mode=helpers.create_field("numeric"),
            description=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
            detail=helpers.create_field("list",False,dict(
                department_code = helpers.create_field("text"),
                ))
        )
        def on_before_insert(data):
            before_process

        def on_before_update(data):
            before_process(data)

        def before_process(data):
            data.update({
                "detail": [{
                        "department_code":x['department_code'],
                        } for x in data.get('detail',[])]
                })

        helpers.events("HCSSYS_DataDomain").on_before_insert(on_before_insert).on_before_update(on_before_update)
        _hasCreated=True
    ret = db_context.collection("HCSSYS_DataDomain")

    return ret
예제 #9
0
def HCSSYS_DataDomain():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSSYS_DataDomain",
            "base",
            [["dd_code"]],
            dd_code=helpers.create_field("text",True),
            dd_name=helpers.create_field("text"),
            access_mode=helpers.create_field("numeric"),
            description=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
            detail=helpers.create_field("list",False,dict(
                department_code = helpers.create_field("text"),
                ))
        )
        def on_before_insert(data):
            before_process

        def on_before_update(data):
            before_process(data)

        def before_process(data):
            data.update({
                "detail": [{
                        "department_code":x['department_code'],
                        } for x in data.get('detail',[])]
                })

        helpers.events("HCSSYS_DataDomain").on_before_insert(on_before_insert).on_before_update(on_before_update)
        _hasCreated=True
    ret = db_context.collection("HCSSYS_DataDomain")

    return ret
def HCSLANG_CollectionInfo():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLANG_CollectionInfo",
            "base",
            [],
            language = helpers.create_field("text",True),
            field_path=helpers.create_field("text",True),
            default_caption=helpers.create_field("text",True),
            custom_caption=helpers.create_field("text"),

            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSLANG_CollectionInfo")
    return ret
예제 #11
0
def tmp_transactions():
    global _hasCreated
    if not _hasCreated:
        helpers.define_model(
            "tmp_transactions",
            [["transaction_id"]],
            transaction_id=helpers.create_field("text", True),
            collection_name=heplers.create_field("text", True),
            path=helpers.create_field("text", True),
            session=helpers.create_field("text", True),
            ordinal=helpers.create_field("numeric"),
            data=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
        )
        _hasCreated = True
    ret = db_context.collection("tmp_transactions")

    return ret
예제 #12
0
def tmp_transactions():
    global _hasCreated
    if not _hasCreated:
        helpers.define_model(
            "tmp_transactions",
            [["transaction_id"]],
            transaction_id=helpers.create_field("text", True),
            collection_name=heplers.create_field("text", True),
            path=helpers.create_field("text", True),
            session=helpers.create_field("text", True),
            ordinal=helpers.create_field("numeric"),
            data=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
        )
        _hasCreated=True
    ret = db_context.collection("tmp_transactions")

    return ret
예제 #13
0
def TMLS_Rank():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "TMLS_Rank",
            "base",
            [["rank_code"]],
            rank_code = helpers.create_field('text', True),
            rank_name = helpers.create_field('text', True),
            rank_name2 = helpers.create_field('text'),
            rank_content = helpers.create_field('text'),
            total_from = helpers.create_field('numeric'),
            total_to = helpers.create_field('numeric'),
            is_change_object = helpers.create_field('bool'),
            ordinal = helpers.create_field('numeric'),
            lock = helpers.create_field('bool'),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
            #TMLS_RankSub
            details=helpers.create_field("list",False,dict(
                rec_id = helpers.create_field('text'),# True),
                rank_code = helpers.create_field('text'),# True),
                change_object = helpers.create_field('numeric'),# True),
                object_level = helpers.create_field('numeric'),
                object_code = helpers.create_field('text'),# True),
                object_name = helpers.create_field('text'),
                priority_no = helpers.create_field('numeric'),
                total_from = helpers.create_field('numeric'),
                total_to = helpers.create_field('numeric'),
                note = helpers.create_field('text'),
                created_on=helpers.create_field("date"),
                created_by=helpers.create_field("text"),
                modified_on=helpers.create_field("date"),
                modified_by=helpers.create_field("text")
            ))
        )
        _hasCreated=True

    ret = db_context.collection("TMLS_Rank")

    return ret
예제 #14
0
def HCSLS_Acadame():
    global _hasCreated
    if not _hasCreated:
        
        """
        #is_fix: Hệ số cố định
        #coeff: #Thiết lập theo
        #coeff: #Ngày bắt đầu tính thâm niên
        """
        helpers.extent_model(
            "HCSLS_Acadame",
            "base",
            [["train_level_code"]],
            train_level_code=helpers.create_field("text",True),
            train_level_name=helpers.create_field("text"),
            range=helpers.create_field("numeric"),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            #train_cof=helpers.create_field("numeric"),
            is_fix=helpers.create_field("numeric"), 
            coeff=helpers.create_field("numeric"), 
            begin_date_cal=helpers.create_field("numeric"),
            lock=helpers.create_field("bool"),
            train_level_name2=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
            details=helpers.create_field("list",False,dict(
                rec_id = helpers.create_field("text"),
                seniority_from = helpers.create_field("numeric"),
                seniority_to = helpers.create_field("numeric"),
                coefficient = helpers.create_field("numeric"),
                salary = helpers.create_field("numeric"),
                created_on=helpers.create_field("date"),
                created_by=helpers.create_field("text"),
                modified_on=helpers.create_field("date"),
                modified_by=helpers.create_field("text")
            ))
        )
        _hasCreated=True
        #def on_before_insert(data):
        #    before_process

        #def on_before_update(data):
        #    before_process(data)

        #def before_process(data):
        #    data.update({
        #        "detail": [{
        #                "department_code":x['_id'],
        #                } for x in data.get('detail',[])]
        #        })

        #helpers.events("HCSLS_Acadame").on_before_insert(on_before_insert).on_before_update(on_before_update)
    ret = db_context.collection("HCSLS_Acadame")

    return ret
예제 #15
0
def HCSLS_Award():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_Award",
            "base",
            [["award_code"]],
            award_code = helpers.create_field("text", True),
            award_name = helpers.create_field("text", True),
            award_name2 = helpers.create_field("text"),
            ordinal = helpers.create_field("numeric"),
            note = helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            award_level_code=helpers.create_field("text"),
            award_place_code = helpers.create_field("text"),
            award_type = helpers.create_field("numeric"),
            is_team = helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True

    ret = db_context.collection("HCSLS_Award")

    return ret
예제 #16
0
def HCSLS_EmployeeType():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_EmployeeType",
            "base",
            [["emp_type_code"]],
            emp_type_code=helpers.create_field("text", True),
            emp_type_name=helpers.create_field("text", True),
            emp_type_name2=helpers.create_field("text"),
            rate_main_sal=helpers.create_field("numeric"),
            rate_soft_sal=helpers.create_field("numeric"),
            true_type=helpers.create_field("numeric", True),
            # probation_time_by=helpers.create_field("numeric"),
            # probation_time=helpers.create_field("text"),
            # is_fix=helpers.create_field("numeric"),
            # coeff=helpers.create_field("text"),
            # begin_date_cal=helpers.create_field("numeric"),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
            #department_code=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSLS_EmployeeType")

    return ret
def HCSSYS_CollectionInfo():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSSYS_CollectionInfo",
            "base",
            [],
            table_name = helpers.create_field("text",True),
            field_name=helpers.create_field("text",True),
            data_type=helpers.create_field("text",True),
            data_length=helpers.create_field("numeric"),
            default_value=helpers.create_field("text"),
            is_unique=helpers.create_field("bool"),
            description=helpers.create_field("text"),
            is_parent=helpers.create_field("bool"),
            parent_field=helpers.create_field("text"),
            field_path=helpers.create_field("text", True),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSSYS_CollectionInfo")
    return ret
예제 #18
0
def HCSSYS_Departments():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSSYS_Departments",
            "base",
            [["department_code"]],
            #id=helpers.create_field("numeric",True),
            department_code=helpers.create_field("text", True),
            department_name=helpers.create_field("text", True),
            department_name2=helpers.create_field("text"),
            department_alias=helpers.create_field("text"),
            #parent_id=helpers.create_field("numeric"),
            parent_code=helpers.create_field("text"),
            level=helpers.create_field("numeric"),
            level_code=helpers.create_field("list"),
            #level_code2=helpers.create_field("text"),
            department_tel=helpers.create_field("text"),
            department_fax=helpers.create_field("text"),
            department_email=helpers.create_field("text"),
            department_address=helpers.create_field("text"),
            #Xem lại kiểu dữ liệu
            nation_code=helpers.create_field("text"),
            province_code=helpers.create_field("text"),
            district_code=helpers.create_field("text"),
            is_company=helpers.create_field("bool"),
            is_fund=helpers.create_field("bool"),
            is_fund_bonus=helpers.create_field("bool"),
            decision_no=helpers.create_field("text"),
            decision_date=helpers.create_field("date"),
            effect_date=helpers.create_field("date"),
            license_no=helpers.create_field("text"),
            tax_code=helpers.create_field("text"),
            lock_date=helpers.create_field("date"),
            logo_image=helpers.create_field("text"),
            manager_code=helpers.create_field("text"),
            secretary_code=helpers.create_field("text"),
            ordinal=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            note=helpers.create_field("text"),
            region_code=helpers.create_field("text"),
            domain_code=helpers.create_field("text"),
            signed_by=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSSYS_Departments")

    return ret
예제 #19
0
def HCSLS_EmployeeType():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_EmployeeType",
            "base",
            [["emp_type_code"]],
            emp_type_code=helpers.create_field("text", True),
            emp_type_name=helpers.create_field("text", True),
            emp_type_name2=helpers.create_field("text"),
            rate_main_sal=helpers.create_field("numeric"),
            rate_soft_sal=helpers.create_field("numeric"),
            true_type=helpers.create_field("numeric", True),
            # probation_time_by=helpers.create_field("numeric"),
            # probation_time=helpers.create_field("text"),
            # is_fix=helpers.create_field("numeric"),
            # coeff=helpers.create_field("text"),
            # begin_date_cal=helpers.create_field("numeric"),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
            #department_code=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSLS_EmployeeType")

    return ret
예제 #20
0
from config import database, helpers, db_context
from ...api import common
import base

helpers.extent_model("TM_SetupProcessApproverDept",
                     "base",
                     [['process_id', 'approve_level', 'department_code']],
                     process_id=helpers.create_field("text", True),
                     approve_level=helpers.create_field("text", True),
                     department_code=helpers.create_field("text", True),
                     appover_code=helpers.create_field("list"))


def TM_SetupProcessApproverDept():
    ret = db_context.collection("TM_SetupProcessApproverDept")
    return ret
예제 #21
0
def HCSSYS_Departments():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSSYS_Departments",
            "base",
            [["department_code"]],
            #id=helpers.create_field("numeric",True),
            department_code=helpers.create_field("text", True),
            department_name=helpers.create_field("text", True),
            department_name2=helpers.create_field("text"),
            department_alias=helpers.create_field("text"),
            #parent_id=helpers.create_field("numeric"),
            parent_code=helpers.create_field("text"),
            level=helpers.create_field("numeric"),
            level_code=helpers.create_field("list"),
            #level_code2=helpers.create_field("text"),
            department_tel=helpers.create_field("text"),
            department_fax=helpers.create_field("text"),
            department_email=helpers.create_field("text"),
            department_address=helpers.create_field("text"),
            #Xem lại kiểu dữ liệu
            nation_code=helpers.create_field("text"),
            province_code=helpers.create_field("text"),
            district_code=helpers.create_field("text"),
            is_company=helpers.create_field("bool"),
            is_fund=helpers.create_field("bool"),
            is_fund_bonus=helpers.create_field("bool"),
            decision_no=helpers.create_field("text"),
            decision_date=helpers.create_field("date"),
            effect_date=helpers.create_field("date"),
            license_no=helpers.create_field("text"),
            tax_code=helpers.create_field("text"),
            lock_date=helpers.create_field("date"),
            logo_image=helpers.create_field("text"),
            manager_code=helpers.create_field("text"),
            secretary_code=helpers.create_field("text"),
            ordinal=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            note=helpers.create_field("text"),
            region_code=helpers.create_field("text"),
            domain_code=helpers.create_field("text"),
            signed_by=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSSYS_Departments")

    return ret
예제 #22
0
# -*- coding: utf-8 -*-
from config import database, helpers, db_context
_hasCreated=False
helpers.extent_model(
            "LMSLS_ExTemplateCategory",
            "base",
            [["category_id"]],
            #id=helpers.create_field("numeric",True),
            category_id=helpers.create_field("text", True),
            category_name=helpers.create_field("text", True),
            category_name2=helpers.create_field("text"),
            parent_id=helpers.create_field("text"),
            parent_code=helpers.create_field("text"),
            level=helpers.create_field("numeric"),
            level_code=helpers.create_field("list"),
            order=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            active=helpers.create_field("bool"),
            moderator=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
        )
def LMSLS_ExTemplateCategory():
    global _hasCreated
    if not _hasCreated:
        _hasCreated=True
    ret = db_context.collection("LMSLS_ExTemplateCategory")

    return ret
예제 #23
0
from config import database, helpers, db_context
import base
helpers.extent_model(
    "LMS_SurQuestionBank",
    "base",
    [["question_id"]],
    question_id=("text", True),
    category_id=("text", True),
    category_type=("numeric", True),
    question_content_1=("text"),
    question_content_2=("text"),
    question_description=("text"),
    ordinal=("numeric"),
    active=("bool"),
    level=helpers.create_field("numeric"),
    level_code=helpers.create_field("list"),
    created_on=("date"),
    created_by=("text"),
    modified_on=("date"),
    modified_by=("text"),
    question_options=("list"),
    question_other_field=("bool"),
    question_random_options=("bool"),
    question_require_answer=("bool"),
    question_note=("text"),
)


def LMS_SurQuestionBank():
    ret = db_context.collection("LMS_SurQuestionBank")
    return ret
예제 #24
0
    user = "******"
    if hasattr(threading.current_thread(),"user"):
        user = threading.current_thread().user.username
    if data.get('created_by',None)==None:
        data.update({
            "created_on":datetime.datetime.now(),
            "created_by":user
            })
def on_before_update(data):
    user = "******"
    if hasattr(threading.current_thread(),"user"):
        user = threading.current_thread().user.username
    if data.get('modified_by',None)==None:
        data.update({
            "modified_on":datetime.datetime.now(),
            "modified_by":user
            })

helpers.define_model(
    "base",
    [],
    dict(
        _id=helpers.create_field("text"),
        created_on=helpers.create_field("date",True),
        created_by=helpers.create_field("text",True),
        modified_on=helpers.create_field("date"),
        modified_by=helpers.create_field("text")
    )
)

helpers.events("base").on_before_insert(on_before_insert).on_before_update(on_before_update)
예제 #25
0
from config import database, helpers, db_context
helpers.extent_model(
            "TM_SetupProcess",
            "base",
            [["process_id"]],
            process_id=helpers.create_field("text", True),
            process_name=helpers.create_field("text", True),
            function_id=helpers.create_field("text"),
            is_not_apply_process=helpers.create_field("bool"),
            max_approve_level=helpers.create_field("numeric"),
            is_approve_by_dept=helpers.create_field("bool"),
            is_require_reason=helpers.create_field("bool"),
            is_require_when_approve=helpers.create_field("bool"),
            is_require_when_reject=helpers.create_field("bool"),
            is_show_list_approver=helpers.create_field("bool"),
            is_reselect_approver=helpers.create_field("bool"),
            is_require_attach_file=helpers.create_field("bool"),
            file_size_limit=helpers.create_field("numeric"),
            exclude_file_types=helpers.create_field("text"),
            is_email_cancel=helpers.create_field("bool"),
            is_email_delete=helpers.create_field("bool"),
            is_email_instead=helpers.create_field("bool"),
            email_send_code=helpers.create_field("text"),
            email_send_to=helpers.create_field("list"),
            email_send_cc=helpers.create_field("list"),
            email_send_more=helpers.create_field("text"),
            email_cancel_code=helpers.create_field("text"),
            email_cancel_to=helpers.create_field("list"),
            email_cancel_cc=helpers.create_field("list"),
            email_cancel_more=helpers.create_field("text"),
            email_delete_code=helpers.create_field("text"),
예제 #26
0
import qmongo


def LMS_VW_Author_Name():
    return qview.create_mongodb_view(
        qmongo.models.LMSLS_MaterialManagement.aggregate.project(
            author_name=1).match("author_name != {0}", None),
        "LMS_VW_Author_Name")


helpers.extent_model(
    "LMSLS_MaterialManagement",
    "base",
    [["material_id"]],
    #id=helpers.create_field("numeric",True),
    material_id=helpers.create_field("text", True),
    material_name=helpers.create_field("text", True),
    material_name2=helpers.create_field("text"),
    material_version=helpers.create_field("list"),
    version=helpers.create_field("text"),
    submit_user_id=helpers.create_field("text"),
    submit_date=helpers.create_field("date"),
    approve_user_id=helpers.create_field("text"),
    approve_date=helpers.create_field("date"),
    ordinal=helpers.create_field("numeric"),
    note=helpers.create_field("text"),
    lock=helpers.create_field("bool"),
    source=helpers.create_field("text"),
    material_format=helpers.create_field("text"),
    folder_id=helpers.create_field("text"),
    author_name=helpers.create_field("text"),
예제 #27
0
def TMLS_RankSub():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "TMLS_RankSub",
            "base",
            [["rank_code"]],
            rec_id = helpers.create_field('text'),
            rank_code = helpers.create_field('text'),
            change_object = helpers.create_field('numeric'),
            object_level = helpers.create_field('numeric'),
            object_code = helpers.create_field('text'),
            object_name = helpers.create_field('text'),
            priority_no = helpers.create_field('numeric'),
            total_from = helpers.create_field('numeric'),
            total_to = helpers.create_field('numeric'),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True

    ret = db_context.collection("TMLS_RankSub")

    return ret
예제 #28
0
def HCSLS_District():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_District",
            "base",
            [["district_code"], ['province_code']],
            district_code = helpers.create_field("text", True),
            province_code = helpers.create_field("text", True),
            district_name = helpers.create_field("text", True),
            district_name2 = helpers.create_field("text"),
            type_code = helpers.create_field("text"),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            org_district_code=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True

    ret = db_context.collection("HCSLS_District")

    return ret
예제 #29
0
def HCSLS_JobWorking():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_JobWorking",
            "base",
            [["job_w_code"]],
            job_w_code = helpers.create_field("text", True),
            job_w_name = helpers.create_field("text", True),
            job_w_name2 = helpers.create_field("text"),
            job_w_duty = helpers.create_field("text"),
            gjw_code = helpers.create_field("text", True),
            ordinal = helpers.create_field("numeric"),
            lock = helpers.create_field("bool"),
            is_job_w_main_staff = helpers.create_field("bool"),
            report_to_job_w=helpers.create_field("text"),
            internal_process = helpers.create_field("text"),
            combine_process = helpers.create_field("text"),
            description = helpers.create_field("text"),
            effect_date = helpers.create_field("date"),
            job_pos_code = helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True

    ret = db_context.collection("HCSLS_JobWorking")

    return ret
예제 #30
0
def SYS_ValueList():
    global _hasCreated
    if not _hasCreated:
        helpers.define_model(
            "SYS_ValueList",
            [["language", "list_name"]],
            language=helpers.create_field("text"),
            list_name=helpers.create_field("text"),
            values=helpers.create_field("list",False,dict(
                value = helpers.create_field("numeric"),
                caption = helpers.create_field("text"),
                custom = helpers.create_field("text")
                )),
            multi_select=helpers.create_field("bool"),
            description=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("SYS_ValueList")

    return ret
예제 #31
0
# -*- coding: utf-8 -*-
from config import database, helpers, db_context
from ...api import common

import datetime
_hasCreated = False
helpers.extent_model(
    "LMSLS_Topic",
    "base",
    [['topic_id']],
    topic_id=helpers.create_field("text", True),
    topic_name=helpers.create_field("text", True),
    topic_name_other=helpers.create_field("text"),
    forum_id=helpers.create_field("text"),
    topic_description=helpers.create_field("text"),
    publish=helpers.create_field("bool"),
    publish_date=helpers.create_field("date"),
    allow_replies=helpers.create_field("bool"),
    topic_replies=float,
    topic_views=float,
    approved_by=helpers.create_field("text"),
    approved_on=helpers.create_field("date"),
    rejected_by=helpers.create_field("text"),
    rejected_on=helpers.create_field("date"),
    feedback=helpers.create_field("text"),
    topic_approved=helpers.create_field("bool"),
    topic_removed=helpers.create_field("bool"),
    topic_pin=helpers.create_field("bool"),
    topic_block=helpers.create_field("bool"),
    created_on=helpers.create_field("date"),
    created_by=helpers.create_field("text"),
예제 #32
0
from config import database, helpers, db_context
from ...api import common

_hasCreated=False
helpers.define_model(
            "LMS_SetupProcessApproveLevel",
            [['rec_id']],
            rec_id =helpers.create_field("text", True),
            process_id=helpers.create_field("int", True),
            approve_level=helpers.create_field("int", True),
            approver_value=helpers.create_field("int"),
            email_approve_code=helpers.create_field("text"),
            email_approve_to=helpers.create_field("int"),
            email_approve_cc=helpers.create_field("text"),
            email_reject_code=helpers.create_field("text"),
            email_reject_to=helpers.create_field("int"),
            email_reject_cc=helpers.create_field("text"),
            default_approver_code=helpers.create_field("text"),
            not_receive_email=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
        )
def LMS_SetupProcessApproveLevel():
    global _hasCreated
    if not _hasCreated:
        def on_before_insert(data):
            data.update({
                "rec_id": common.generate_guid()
                })
예제 #33
0
def HCSEM_Employees():
    global _hasCreated
    if not _hasCreated:
        dict_permission = dict()
        helpers.extent_model(
            "HCSEM_Employees",
            "base",
            [["employee_code"]],
            photo_id=helpers.create_field("text"),
            employee_code=helpers.create_field("text", True),
            last_name=helpers.create_field("text", True),
            first_name=helpers.create_field("text", True),
            extra_name=helpers.create_field("text"),
            gender=helpers.create_field("numeric"),
            birthday=helpers.create_field("date"),
            b_province_code=helpers.create_field("text"),
            nation_code=helpers.create_field("text"),
            ethnic_code=helpers.create_field("text"),
            religion_code=helpers.create_field("text"),
            culture_id=helpers.create_field("numeric"),
            is_retrain=helpers.create_field("numeric"),
            train_level_code=helpers.create_field("text"),
            marital_code=helpers.create_field("text"),
            id_card_no=helpers.create_field("text"),
            issued_date=helpers.create_field("date"),
            issued_place_code=helpers.create_field("text"),
            mobile=helpers.create_field("text"),
            p_phone=helpers.create_field("text"),
            email=helpers.create_field("text"),
            personal_email=helpers.create_field("text"),
            document_no=helpers.create_field("text"),
            join_date=helpers.create_field("date", True),
            official_date=helpers.create_field("date"),
            career_date=helpers.create_field("date"),
            personnel_date=helpers.create_field("date"),
            emp_type_code=helpers.create_field("text"),
            labour_type=helpers.create_field("numeric"),
            department_code=helpers.create_field("text", True),
            job_pos_code=helpers.create_field("text"),
            job_pos_date=helpers.create_field("date"),
            job_w_code=helpers.create_field("text", True),
            job_w_date=helpers.create_field("date"),
            profession_code=helpers.create_field("text"),
            level_management=helpers.create_field("numeric"),
            is_cbcc=helpers.create_field("bool"),
            is_expert_recruit=helpers.create_field("bool"),
            is_expert_train=helpers.create_field("bool"),
            manager_code=helpers.create_field("text"),
            manager_sub_code=helpers.create_field("text"),
            user_id=helpers.create_field("text"),
            job_pos_hold_code=helpers.create_field("text"),
            job_w_hold_code=helpers.create_field("text"),
            department_code_hold=helpers.create_field("text"),
            job_pos_hold_from_date=helpers.create_field("date"),
            job_pos_hold_to_date=helpers.create_field("date"),
            end_date=helpers.create_field("date"),
            retire_ref_no=helpers.create_field("text"),
            signed_date=helpers.create_field("date"),
            signed_person=helpers.create_field("text"),
            active=helpers.create_field("bool"),
            note=helpers.create_field("text"),
            p_address=helpers.create_field("text"),
            p_province_code=helpers.create_field("text"),
            p_district_code=helpers.create_field("text"),
            p_ward_code=helpers.create_field("text"),
            p_hamlet_code=helpers.create_field("text"),
            t_address=helpers.create_field("text"),
            t_province_code=helpers.create_field("text"),
            t_district_code=helpers.create_field("text"),
            t_ward_code=helpers.create_field("text"),
            t_hamlet_code=helpers.create_field("text"),
            foreigner=helpers.create_field("bool"),
            vn_foreigner=helpers.create_field("bool"),
            is_not_reside=helpers.create_field("bool"),
            fo_working=helpers.create_field("numeric"),
            fo_permiss=helpers.create_field("text"),
            fo_begin_date=helpers.create_field("date"),
            fo_end_date=helpers.create_field("date"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )

        _hasCreated=True
    ret = db_context.collection("HCSEM_Employees")

    return ret
def TMSYS_ConfigChangeObjectPriority():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "TMSYS_ConfigChangeObjectPriority",
            "base",
            [[]],
            value_list_key = helpers.create_field('text'),
            change_object = helpers.create_field('numeric'),
            change_object_name = helpers.create_field('text'),
            priority_no = helpers.create_field('numeric'),
            table_name = helpers.create_field('text'),
            note = helpers.create_field('text'),
            language = helpers.create_field('numeric'),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True

    ret = db_context.collection("TMSYS_ConfigChangeObjectPriority")

    return ret
예제 #35
0
from config import database, helpers, db_context
import base
helpers.extent_model("TMPER_AprPeriodRank",
                     "base", [["apr_period", "apr_year", "department_code"]],
                     apr_period=helpers.create_field("numeric", True),
                     apr_year=helpers.create_field("numeric", True),
                     department_code=helpers.create_field("text"),
                     rank_level=helpers.create_field("list"),
                     note=helpers.create_field("text"),
                     created_on=helpers.create_field("date"),
                     created_by=helpers.create_field("text"),
                     modified_on=helpers.create_field("date"),
                     modified_by=helpers.create_field("text"))


def TMPER_AprPeriodRank():
    ret = db_context.collection("TMPER_AprPeriodRank")

    return ret
예제 #36
0
def on_before_insert(data):
    user = "******"
    if hasattr(threading.current_thread(), "user"):
        user = threading.current_thread().user.username
    if data.get('created_by', None) == None:
        data.update({
            "created_on": datetime.datetime.now(),
            "created_by": user
        })


def on_before_update(data):
    user = "******"
    if hasattr(threading.current_thread(), "user"):
        user = threading.current_thread().user.username
    if data.get('modified_by', None) == None:
        data.update({
            "modified_on": datetime.datetime.now(),
            "modified_by": user
        })


helpers.define_model(
    "base", [],
    dict(created_on=helpers.create_field("date", True),
         created_by=helpers.create_field("text", True),
         modified_on=helpers.create_field("date", True),
         modified_by=helpers.create_field("text", True)))

helpers.events("base").on_before_insert(on_before_insert).on_before_update(
    on_before_update)
예제 #37
0
def SYS_FunctionList():
    global _hasCreated
    if not _hasCreated:
        helpers.define_model(
            "SYS_FunctionList",
            [["function_id"]],
            sorting=helpers.create_field("text"),
            description=helpers.create_field("text"),
            custom_name=helpers.create_field("text"),
            style_class=helpers.create_field("text"),
            url=helpers.create_field("text"),
            image=helpers.create_field("text"),
            default_name=helpers.create_field("text", True),
            height=helpers.create_field("text"),
            parent_id=helpers.create_field("text"),
            active=helpers.create_field("bool"),
            function_id=helpers.create_field("text", True),
            type=helpers.create_field("text"),
            width=helpers.create_field("text"),
            icon=helpers.create_field("text"),
            app=helpers.create_field("text"),
            level_code=helpers.create_field("list")
        )
        _hasCreated=True
    ret = db_context.collection("SYS_FunctionList")

    return ret
예제 #38
0
def HCSLS_Nation():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_Nation",
            "base",
            [["nation_code"]],
            nation_code=helpers.create_field("text", True),
            nation_name=helpers.create_field("text", True),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            continents=helpers.create_field("numeric"),
            #eat_amount=helpers.create_field("numeric"),
            #home_amount=helpers.create_field("numeric"),
            #taxi_amount=helpers.create_field("numeric"),
            #sub_days_amount=helpers.create_field("numeric"),
            nation_name2=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
            #department_code=helpers.create_field("text"),
            org_nation_code=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSLS_Nation")

    return ret
예제 #39
0
def HCSLS_Certificate():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_Certificate",
            "base",
            [["cer_code"]],
            cer_code=helpers.create_field("text", True),
            cer_name=helpers.create_field("text", True),
            cer_name2=helpers.create_field("text"),
            expired_time=helpers.create_field("numeric"),
            group_cer_code=helpers.create_field("text"),
            cers_time_limit=helpers.create_field("numeric"),
            scer_code=helpers.create_field("text"),
            cers_replace_code=helpers.create_field("text"),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSLS_Certificate")

    return ret
예제 #40
0
def SYS_ValueList():
    global _hasCreated
    if not _hasCreated:
        helpers.define_model("SYS_ValueList", [["language", "list_name"]],
                             language=helpers.create_field("text"),
                             list_name=helpers.create_field("text"),
                             values=helpers.create_field(
                                 "list", False,
                                 dict(value=helpers.create_field("numeric"),
                                      caption=helpers.create_field("text"),
                                      custom=helpers.create_field("text"))),
                             multi_select=helpers.create_field("bool"),
                             description=helpers.create_field("text"),
                             created_on=helpers.create_field("date"),
                             created_by=helpers.create_field("text"),
                             modified_on=helpers.create_field("date"),
                             modified_by=helpers.create_field("text"))
        _hasCreated = True
    ret = db_context.collection("SYS_ValueList")

    return ret
예제 #41
0
def AD_Roles():
    global _hasCreated
    if not _hasCreated:
        dict_permission = dict()
        helpers.extent_model(
            "AD_Roles",
            "base",
            [["role_code"]],
            role_code=helpers.create_field("text", True),
            role_name=helpers.create_field("text", True),
            dd_code=helpers.create_field("text", True),
            description=helpers.create_field("text"),
            stop=helpers.create_field("bool"),
            #role_type=helpers.create_field("text",True),
            #is_system=helpers.create_field("bool"),
            #administrator=helpers.create_field("numeric"),
            #system_admin=helpers.create_field("numeric"),
            #function_admin=helpers.create_field("text"),
            #security_level=helpers.create_field("text"),
            #start_date=helpers.create_field("date"),
            #end_date=helpers.create_field("text"),
            #note=helpers.create_field("date"),
            permission=helpers.create_field(
                "list", False,
                dict_permission.update({
                    "function_id":
                    helpers.create_field("text"),
                    "read":
                    helpers.create_field("text"),
                    "create":
                    helpers.create_field("text"),
                    "write":
                    helpers.create_field("text"),
                    "delete":
                    helpers.create_field("text"),
                    "export":
                    helpers.create_field("text"),
                    "import":
                    helpers.create_field("text"),
                    "copy":
                    helpers.create_field("text"),
                    "attach":
                    helpers.create_field("text"),
                    "download":
                    helpers.create_field("text"),
                    "created_by":
                    helpers.create_field("text"),
                    "created_on":
                    helpers.create_field("text"),
                    "modified_by":
                    helpers.create_field("text"),
                    "modified_on":
                    helpers.create_field("text")
                })),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"))

        _hasCreated = True
    ret = db_context.collection("AD_Roles")

    return ret
예제 #42
0
def TMLS_RankSub():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model("TMLS_RankSub",
                             "base", [["rank_code"]],
                             rec_id=helpers.create_field('text'),
                             rank_code=helpers.create_field('text'),
                             change_object=helpers.create_field('numeric'),
                             object_level=helpers.create_field('numeric'),
                             object_code=helpers.create_field('text'),
                             object_name=helpers.create_field('text'),
                             priority_no=helpers.create_field('numeric'),
                             total_from=helpers.create_field('numeric'),
                             total_to=helpers.create_field('numeric'),
                             created_on=helpers.create_field("date"),
                             created_by=helpers.create_field("text"),
                             modified_on=helpers.create_field("date"),
                             modified_by=helpers.create_field("text"))
        _hasCreated = True

    ret = db_context.collection("TMLS_RankSub")

    return ret
예제 #43
0
def SYS_FunctionList():
    global _hasCreated
    if not _hasCreated:
        helpers.define_model("SYS_FunctionList", [["function_id"]],
                             sorting=helpers.create_field("text"),
                             description=helpers.create_field("text"),
                             custom_name=helpers.create_field("text"),
                             style_class=helpers.create_field("text"),
                             url=helpers.create_field("text"),
                             image=helpers.create_field("text"),
                             default_name=helpers.create_field("text", True),
                             height=helpers.create_field("text"),
                             parent_id=helpers.create_field("text"),
                             active=helpers.create_field("bool"),
                             function_id=helpers.create_field("text", True),
                             type=helpers.create_field("text"),
                             width=helpers.create_field("text"),
                             icon=helpers.create_field("text"))
        _hasCreated = True
    ret = db_context.collection("SYS_FunctionList")

    return ret
예제 #44
0
def HCSLS_Award():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model("HCSLS_Award",
                             "base", [["award_code"]],
                             award_code=helpers.create_field("text", True),
                             award_name=helpers.create_field("text", True),
                             award_name2=helpers.create_field("text"),
                             ordinal=helpers.create_field("numeric"),
                             note=helpers.create_field("text"),
                             lock=helpers.create_field("bool"),
                             award_level_code=helpers.create_field("text"),
                             award_place_code=helpers.create_field("text"),
                             award_type=helpers.create_field("numeric"),
                             is_team=helpers.create_field("bool"),
                             created_on=helpers.create_field("date"),
                             created_by=helpers.create_field("text"),
                             modified_on=helpers.create_field("date"),
                             modified_by=helpers.create_field("text"))
        _hasCreated = True

    ret = db_context.collection("HCSLS_Award")

    return ret
예제 #45
0
def HCSEM_Employees():
    global _hasCreated
    if not _hasCreated:
        dict_permission = dict()
        helpers.extent_model(
            "HCSEM_Employees",
            "base",
            [["employee_code"]],
            photo_id=helpers.create_field("text"),
            employee_code=helpers.create_field("text", True),
            last_name=helpers.create_field("text", True),
            first_name=helpers.create_field("text", True),
            extra_name=helpers.create_field("text"),
            gender=helpers.create_field("numeric"),
            birthday=helpers.create_field("date"),
            b_province_code=helpers.create_field("text"),
            nation_code=helpers.create_field("text"),
            ethnic_code=helpers.create_field("text"),
            religion_code=helpers.create_field("text"),
            culture_id=helpers.create_field("numeric"),
            is_retrain=helpers.create_field("numeric"),
            train_level_code=helpers.create_field("text"),
            marital_code=helpers.create_field("text"),
            id_card_no=helpers.create_field("text"),
            issued_date=helpers.create_field("date"),
            issued_place_code=helpers.create_field("text"),
            mobile=helpers.create_field("text"),
            p_phone=helpers.create_field("text"),
            email=helpers.create_field("text"),
            personal_email=helpers.create_field("text"),
            document_no=helpers.create_field("text"),
            join_date=helpers.create_field("date", True),
            official_date=helpers.create_field("date"),
            career_date=helpers.create_field("date"),
            personnel_date=helpers.create_field("date"),
            emp_type_code=helpers.create_field("text"),
            labour_type=helpers.create_field("numeric"),
            department_code=helpers.create_field("text", True),
            job_pos_code=helpers.create_field("text"),
            job_pos_date=helpers.create_field("date"),
            job_w_code=helpers.create_field("text", True),
            job_w_date=helpers.create_field("date"),
            profession_code=helpers.create_field("text"),
            level_management=helpers.create_field("numeric"),
            is_cbcc=helpers.create_field("bool"),
            is_expert_recruit=helpers.create_field("bool"),
            is_expert_train=helpers.create_field("bool"),
            manager_code=helpers.create_field("text"),
            manager_sub_code=helpers.create_field("text"),
            user_id=helpers.create_field("text"),
            job_pos_hold_code=helpers.create_field("text"),
            job_w_hold_code=helpers.create_field("text"),
            department_code_hold=helpers.create_field("text"),
            job_pos_hold_from_date=helpers.create_field("date"),
            job_pos_hold_to_date=helpers.create_field("date"),
            end_date=helpers.create_field("date"),
            retire_ref_no=helpers.create_field("text"),
            signed_date=helpers.create_field("date"),
            signed_person=helpers.create_field("text"),
            active=helpers.create_field("bool"),
            note=helpers.create_field("text"),
            p_address=helpers.create_field("text"),
            p_province_code=helpers.create_field("text"),
            p_district_code=helpers.create_field("text"),
            p_ward_code=helpers.create_field("text"),
            p_hamlet_code=helpers.create_field("text"),
            t_address=helpers.create_field("text"),
            t_province_code=helpers.create_field("text"),
            t_district_code=helpers.create_field("text"),
            t_ward_code=helpers.create_field("text"),
            t_hamlet_code=helpers.create_field("text"),
            foreigner=helpers.create_field("bool"),
            vn_foreigner=helpers.create_field("bool"),
            is_not_reside=helpers.create_field("bool"),
            fo_working=helpers.create_field("numeric"),
            fo_permiss=helpers.create_field("text"),
            fo_begin_date=helpers.create_field("date"),
            fo_end_date=helpers.create_field("date"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )

        _hasCreated=True
    ret = db_context.collection("HCSEM_Employees")

    return ret
예제 #46
0
def HCSSYS_SystemConfig():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSSYS_SystemConfig",
            "base",
            [],
            is_has_number=helpers.create_field("bool"),
            num_of_number=helpers.create_field("numeric"),
            is_has_upper_char=helpers.create_field("bool"),
            num_of_upper=helpers.create_field("numeric"),
            is_has_lower_char=helpers.create_field("bool"),
            num_of_lower=helpers.create_field("numeric"),
            is_has_symbols=helpers.create_field("bool"),
            num_of_symbol=helpers.create_field("numeric"),

            is_ad_aut=helpers.create_field("bool"),
            session_timeOut=helpers.create_field("numeric"),
            time_out_expand=helpers.create_field("numeric"),
            minimum_age=helpers.create_field("numeric"),
            password_expiration=helpers.create_field("numeric"),
            will_expire=helpers.create_field("bool"),
            change_after=helpers.create_field("numeric"),
            apply_minimum_age=helpers.create_field("bool"),

            apply_history=helpers.create_field("bool"),
            history=helpers.create_field("numeric"),
            apply_minLength=helpers.create_field("bool"),
            min_len=helpers.create_field("numeric"),
            apply_maxLength=helpers.create_field("bool"),
            max_len=helpers.create_field("numeric"),
            lock_on_failed=helpers.create_field("bool"),
            threshold_to_lock=helpers.create_field("numeric"),
            time_lock=helpers.create_field("numeric"),

            alert_before=helpers.create_field("numeric"),
            is_first_change=helpers.create_field("bool"),
            not_user_in_password=helpers.create_field("bool"),
            date_format=helpers.create_field("text"),
            dec_place_separator=helpers.create_field("text"),
            dec_place_currency=helpers.create_field("numeric"),
            default_language=helpers.create_field("text")
        )

        _hasCreated=True
    ret = db_context.collection("HCSSYS_SystemConfig")

    return ret
예제 #47
0
def TMLS_Rank():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "TMLS_Rank",
            "base",
            [["rank_code"]],
            rank_code=helpers.create_field('text', True),
            rank_name=helpers.create_field('text', True),
            rank_content=helpers.create_field('text'),
            total_from=helpers.create_field('numeric'),
            total_to=helpers.create_field('numeric'),
            is_change_object=helpers.create_field('bool'),
            ordinal=helpers.create_field('numeric'),
            lock=helpers.create_field('bool'),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
            #TMLS_RankSub
            details=helpers.create_field(
                "list", False,
                dict(rec_id=helpers.create_field('text', True),
                     rank_code=helpers.create_field('text', True),
                     change_object=helpers.create_field('numeric', True),
                     object_level=helpers.create_field('numeric'),
                     object_code=helpers.create_field('text', True),
                     object_name=helpers.create_field('text'),
                     priority_no=helpers.create_field('numeric'),
                     total_from=helpers.create_field('numeric'),
                     total_to=helpers.create_field('numeric'),
                     created_on=helpers.create_field("date"),
                     created_by=helpers.create_field("text"),
                     modified_on=helpers.create_field("date"),
                     modified_by=helpers.create_field("text"))))
        _hasCreated = True

    ret = db_context.collection("TMLS_Rank")

    return ret
예제 #48
0
# -*- coding: utf-8 -*-
from config import database, helpers, db_context
_hasCreated=False
helpers.extent_model(
            "LMSLS_ExResultType",
            "base",
            [["result_type_id"]],
            result_type_id=helpers.create_field("text", True),
            result_type1=helpers.create_field("text", True),
            result_type2=helpers.create_field("text"),
            grading_scale=helpers.create_field("list"),
            order=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            active=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            creator = helpers.create_field("text"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
        )
def LMSLS_ExResultType():
    global _hasCreated
    if not _hasCreated:
        _hasCreated=True
    ret = db_context.collection("LMSLS_ExResultType")

    return ret
예제 #49
0
def HCSLS_Hamlet():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model("HCSLS_Hamlet",
                             "base", [["hamlet_code"], ['ward_code']],
                             hamlet_code=helpers.create_field("text", True),
                             ward_code=helpers.create_field("text", True),
                             hamlet_name=helpers.create_field("text", True),
                             hamlet_name2=helpers.create_field("text"),
                             type_code=helpers.create_field("text"),
                             ordinal=helpers.create_field("numeric"),
                             note=helpers.create_field("text"),
                             lock=helpers.create_field("bool"),
                             org_hamlet_code=helpers.create_field("text"),
                             created_on=helpers.create_field("date"),
                             created_by=helpers.create_field("text"),
                             modified_on=helpers.create_field("date"),
                             modified_by=helpers.create_field("text"))
        _hasCreated = True

    ret = db_context.collection("HCSLS_Hamlet")

    return ret
예제 #50
0
def HCSLS_Position():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_Position",
            "base",
            [["job_pos_code"]],
            job_pos_code=helpers.create_field("text",True),
            job_pos_name=helpers.create_field("text", True),
            job_pos_name2=helpers.create_field("text"),
            man_level=helpers.create_field("numeric", True),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            is_fix=helpers.create_field("numeric"),
            coeff=helpers.create_field("numeric"),
            begin_date_cal=helpers.create_field("numeric"),
            lock=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
            details=helpers.create_field("list",False,dict(
                rec_id = helpers.create_field("text"),
                seniority_from = helpers.create_field("numeric"),
                seniority_to = helpers.create_field("numeric"),
                coefficient = helpers.create_field("numeric"),
                salary = helpers.create_field("numeric"),
                created_on=helpers.create_field("date"),
                created_by=helpers.create_field("text"),
                modified_on=helpers.create_field("date"),
                modified_by=helpers.create_field("text")
            ))
        )
        _hasCreated=True
        #def on_before_insert(data):
        #    before_process

        #def on_before_update(data):
        #    before_process(data)

        #def before_process(data):
        #    data.update({
        #        "detail": [{
        #                "department_code":x['_id'],
        #                } for x in data.get('detail',[])]
        #        })

        #helpers.events("HCSLS_Acadame").on_before_insert(on_before_insert).on_before_update(on_before_update)
    ret = db_context.collection("HCSLS_Position")

    return ret
예제 #51
0
def HCSSYS_ComboboxList():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSSYS_ComboboxList",
            "base",
            [["combobox_code"]],
            combobox_code = helpers.create_field("text",True),
            language=helpers.create_field("text", True),
            display_name=helpers.create_field("text"),
            description=helpers.create_field("text"),
            table_name=helpers.create_field("text"),
            table_fields=helpers.create_field("list"),
            display_fields=helpers.create_field("list"),
            predicate=helpers.create_field("list", False, dict(
                column = helpers.create_field("string"),
                operator = helpers.create_field("string")
                )),
            value_field=helpers.create_field("text"),
            caption_field=helpers.create_field("text"),
            sorting_field=helpers.create_field("object"),
            filter_field=helpers.create_field("text"),
            multi_select=helpers.create_field("bool"),
            page_size=helpers.create_field("int"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
        )

        _hasCreated=True
    ret = db_context.collection("HCSSYS_ComboboxList")

    return ret
예제 #52
0
from config import database, helpers, db_context
_hasCreated = False
helpers.define_model("LMSSYS_Value_List", [["language", "list_name"]],
                     language=helpers.create_field("text"),
                     list_name=helpers.create_field("text"),
                     values=helpers.create_field(
                         "list", False,
                         dict(value=helpers.create_field("numeric"),
                              caption=helpers.create_field("text"),
                              custom=helpers.create_field("text"))),
                     multi_select=helpers.create_field("bool"),
                     description=helpers.create_field("text"),
                     created_on=helpers.create_field("date"),
                     created_by=helpers.create_field("text"),
                     modified_on=helpers.create_field("date"),
                     modified_by=helpers.create_field("text"))


def LMSSYS_Value_List():
    global _hasCreated
    if not _hasCreated:
        _hasCreated = True
    ret = db_context.collection("LMSSYS_Value_List")

    return ret
예제 #53
0
def HCSLS_Nation():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_Nation",
            "base",
            [["nation_code"]],
            nation_code=helpers.create_field("text", True),
            nation_name=helpers.create_field("text", True),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            continents=helpers.create_field("numeric"),
            #eat_amount=helpers.create_field("numeric"),
            #home_amount=helpers.create_field("numeric"),
            #taxi_amount=helpers.create_field("numeric"),
            #sub_days_amount=helpers.create_field("numeric"),
            nation_name2=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text"),
            #department_code=helpers.create_field("text"),
            org_nation_code=helpers.create_field("text"))
        _hasCreated = True
    ret = db_context.collection("HCSLS_Nation")

    return ret
예제 #54
0
def HCSSYS_ExcelTemplate():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSSYS_ExcelTemplate",
            "base",
            [["function_id"], ["template_code"], ["detail.field_name", "template_code"]],
            function_id=helpers.create_field("text", True),
            template_code=helpers.create_field("text", True),
            template_name=helpers.create_field("text", True),
            is_default=helpers.create_field("bool"),
            view_name=helpers.create_field("text", True),
            detail=helpers.create_field("list",False,dict(
                field_name = helpers.create_field("text"),
                lookup_data = helpers.create_field("text"),
                lookup_key_field = helpers.create_field("text"),
                lookup_result = helpers.create_field("text"),
                allow_null = helpers.create_field("bool"),
                is_key = helpers.create_field("bool"),
                language = helpers.create_field("text"),
                header_text = helpers.create_field("text"),
                is_visible = helpers.create_field("bool"),
                ordinal = helpers.create_field("numeric")
                )),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("HCSSYS_ExcelTemplate")

    return ret
예제 #55
0
from config import database, helpers, db_context
import datetime
import base
import threading

_hasCreated = False
helpers.extent_model("HCSSYS_DataDomain",
                     "base", [["dd_code"]],
                     dd_code=helpers.create_field("text", True),
                     dd_name=helpers.create_field("text"),
                     access_mode=helpers.create_field("numeric"),
                     description=helpers.create_field("text"),
                     created_on=helpers.create_field("date"),
                     created_by=helpers.create_field("text"),
                     modified_on=helpers.create_field("date"),
                     modified_by=helpers.create_field("text"),
                     detail=helpers.create_field(
                         "list", False,
                         dict(department_code=helpers.create_field("text"), )))


def HCSSYS_DataDomain():
    global _hasCreated
    if not _hasCreated:

        def on_before_insert(data):
            before_process

        def on_before_update(data):
            before_process(data)
예제 #56
0
def HCSLS_Ethnic():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "HCSLS_Ethnic",
            "base",
            [["ethnic_code"]],
            ethnic_code=helpers.create_field("text", True),
            ethnic_name=helpers.create_field("text", True),
            range=helpers.create_field("numeric"),
            ordinal=helpers.create_field("numeric"),
            note=helpers.create_field("text"),
            lock=helpers.create_field("bool"),
            ethnic_name2=helpers.create_field("text"),
            is_ethnic_minority=helpers.create_field("bool"),
            created_on=helpers.create_field("text"),
            created_by=helpers.create_field("date"),
            modified_on=helpers.create_field("text"),
            modified_by=helpers.create_field("date")
        )
        _hasCreated=True
    ret = db_context.collection("HCSLS_Ethnic")

    return ret
예제 #57
0
def auth_user_info():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "auth_user_info",
            "base",
            [["login_account"], ["email"]],
            login_account = helpers.create_field("text",True),
            username=helpers.create_field("text",True),
            display_name=helpers.create_field("text",True),
            role_code=helpers.create_field("text"),
            email=helpers.create_field("text"),
            is_system=helpers.create_field("bool"),
            never_expire=helpers.create_field("bool"),
            manlevel_from=helpers.create_field("numeric"),
            manlevel_to=helpers.create_field("numeric"),
            mobile=helpers.create_field("text"),
            description=helpers.create_field("text"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )

        _hasCreated=True
    ret = db_context.collection("auth_user_info")

    return ret
예제 #58
0
def LMSLS_MaterialFolder():
    global _hasCreated
    if not _hasCreated:
        helpers.extent_model(
            "LMSLS_MaterialFolder",
            "base",
            [["folder_id"]],
            #id=helpers.create_field("numeric",True),
            folder_id=helpers.create_field("text", True),
            folder_name=helpers.create_field("text", True),
            folder_name2=helpers.create_field("text"),
            parent_id=helpers.create_field("text"),
            parent_code=helpers.create_field("text"),
            level=helpers.create_field("numeric"),
            level_code=helpers.create_field("list"),
            ordinal=helpers.create_field("numeric"),
            lock=helpers.create_field("bool"),
            note=helpers.create_field("text"),
            moderator_id=helpers.create_field("text"),
            approver_id=helpers.create_field("text"),
            active=helpers.create_field("bool"),
            approve_type=helpers.create_field("bool"),
            created_on=helpers.create_field("date"),
            created_by=helpers.create_field("text"),
            modified_on=helpers.create_field("date"),
            modified_by=helpers.create_field("text")
        )
        _hasCreated=True
    ret = db_context.collection("LMSLS_MaterialFolder")

    return ret