示例#1
0
文件: models.py 项目: HieuMinh67/gdhh
class User(db.Model):
    __tablename__ = 'user__user'
    id = col(db.Integer, primary_key=True)
    email = col(db.String(100), unique=True)
    password = col(db.Text)
    roles = col(db.Text)
    is_active = col(db.Boolean, default=True)
    db.UniqueConstraint(email)

    @property
    def rolenames(self):
        try:
            return self.roles.split(',')
        except Exception:
            return []

    @classmethod
    def lookup(cls, email):
        return cls.query.filter_by(email=email).one_or_none()

    @classmethod
    def identify(cls, id):
        return cls.query.get(id)

    @property
    def identity(self):
        return self.id

    def is_valid(self):
        return self.is_active
示例#2
0
文件: models.py 项目: HieuMinh67/gdhh
class ChristianName(Model):
    __tablename__ = 'hoso__christian_name'

    id = col(db.String(24), primary_key=True)
    sex = col(db.String(6), nullable=False)
    tieng_viet = col(db.String(250))
    tieng_anh = col(db.String(250))
    code = col(db.String(250), unique=True)
    profiles = db.relation('Profile', backref='christianname', lazy=True)
示例#3
0
class Affect:
    affected_group_id: int = col("AffectActionListGroupDefID", nullable=True)
    affected_action_id: int = col("AffectActionDefID", nullable=True)
    affected_task: Task = col("AffectActionTypeID", nullable=True)
    offset: float = col("AffectOffset", nullable=True)
    auto_complete: bool = col("AffectAutoComplete", nullable=True)
    created_action_group_id: int = col("CreateActionActionListGroupDefID",
                                       nullable=True)
    created_action_action_id: int = col("CreateActionActionDefID",
                                        nullable=True)
    created_group_id: int = col("CreateGroupActionListGroupDefID",
                                nullable=True)
示例#4
0
class PartnerTypes:
    id: int = col("PartnerCompanyID")
    type_id: int = col("PartnerTypeID")
示例#5
0
class Partner:
    id: int = col("PartnerCompanyID")
    name: str = col("Name")
示例#6
0
class EmailPartnerTypeRecipient:
    """The partner type that should receive the email"""

    email_id: int = col("ActionEmailTemplateID")
    partner_type_id: int = col("PartnerTypeID")
示例#7
0
class Email:
    id: int = col("ActionEmailTemplateID")
    name: str = col("ActionEmailTemplateName")
    subject: str = col("EmailSubject", nullable=True)
    body: str = col("EmailBody", nullable=True)
    # 0 - neither attach by template or document type
    # 1 - attach by template only
    # 2 - attach by document type
    # 3 - attach by both template and document type
    email_attachment_type: int = col("EmailAttachmentType")
    generate_hud: bool = col("GenerateHUD")
    generate_buyer_statement: bool = col("GenerateBuyerStatement")
    combine_as_pdf: bool = col("CombineAsPDF")
    pdf_name: str = col("PDFName", nullable=True)
    pdf_document_type_id: int = col("PDFDocumentTypeID", nullable=True)
    # 1 = user, 2 = internet orders, 3 = team, 4 = team group, 5 = user's reply to, 6 = issue tracker, 7 = assigned team
    reply_to_type: int = col("ReplyToType")
    transmit_via_xml: bool = col("TransmitViaXML")
    combine_generated_documents_attach_to_email: bool = col(
        "CombineGeneratedDocumentsAttachToEmail")
示例#8
0
class ActionEvent:
    id: int = col("ActionEventDefID")
    name: str = col("Name")
示例#9
0
class GroupAction:
    group_id: int = col("ActionListGroupDefID")
    action_id: int = col("ActionDefID")
    dynamic: bool = col("Dynamic")
示例#10
0
class Action:
    id: int = col("ActionDefID")
    name: str = col("Name")
    display_name: str = col("DisplayName")
    description: str = col("Description", nullable=True)
    hidden: bool = col("Hidden")
示例#11
0
class Trigger(Affect):
    external_action_id: int = col("ExternalActionDefID")
    group_id: int = col("ActionListGroupDefID")
    action_event_id: int = col("ActionEventDefID", nullable=True)
    document_type_id: int = col("DocumentTypeID", nullable=True)
示例#12
0
class ActionEmail:
    action_id: int = col("ActionDefID")
    email_id: int = col("ActionEmailTemplateID")
    task: Task = col("ActionStartComplete",
                     parser=_email_start_complete_to_task)
示例#13
0
class Template:
    id: int = col("TemplateID")
    name: str = col("Name")
    filename: str = col("Filename")
    document_type_id: int = col("DocumentTypeID")
示例#14
0
class EmailTemplate:
    email_id: int = col("ActionEmailTemplateID")
    template_id: int = col("TemplateID")
示例#15
0
class EmailPartnerRestriction:
    partner_id: int = col("PartnerCompanyID", nullable=True)
    email_id: int = col("ActionEmailTemplateID")
    include: bool = col("IncludeExclude")
示例#16
0
class PartnerAutoAdds:
    id: int = col("PartnerCompanyID")
    type_id: int = col("PartnerTypeId")
    auto_add_id: int = col("AutoAddPartnerCompanyID")
    auto_add_type_id: int = col("AutoAddPartnerTypeID")
示例#17
0
class PartnerType:
    id: int = col("PartnerTypeID")
    name: str = col("Name")
示例#18
0
class GroupPartnerRestriction:
    group_id: int = col("ActionListGroupDefID")
    partner_id: int = col("PartnerCompanyID")
    include: bool = col("ActionPartnerAddTypeID",
                        parser=_group_partner_include)
示例#19
0
class ExternalAction:
    id: int = col("ExternalActionDefID")
    name: str = col("Name")
示例#20
0
class Group:
    id: int = col("ActionListGroupDefID")
    name: str = col("ActionListGroupName")
示例#21
0
class DocumentType:
    id: int = col("DocumentTypeID")
    name: str = col("Name")
示例#22
0
class GroupActionAffect(Affect):
    task: Task = col("ActionTypeID", nullable=True)
    group_id: int = col("ActionListGroupDefID")
    action_id: int = col("ActionDefID")
示例#23
0
文件: models.py 项目: HieuMinh67/gdhh
class Profile(Model):
    __tablename__ = 'hoso__thanh_vien'

    id = col(db.Integer, primary_key=True, autoincrement=True)

    id_user = ref('user__user', nullable=True)
    user = rel('User', backref='profile')
    sex = col(db.String(6), nullable=False)
    dob = col(db.Date)
    enabled = col(db.Boolean, default=True)
    so_dien_thoai = col(db.String(15))
    so_dien_thoai_me = col(db.String(15))
    so_dien_thoai_bo = col(db.String(15))
    so_dien_thoai_nha = col(db.String(15))
    dia_chi_tam_tru = col(db.String(255))
    dia_chi_thuong_tru = col(db.String(255))
    firstname = col(db.String(50), nullable=False)
    middlename = col(db.String(50), nullable=False)
    lastname = col(db.String(50), nullable=False)
    id_ten_thanh = db.Column(
        db.String(24),
        db.ForeignKey('hoso__christian_name.id'),
        nullable=False,
    )
    ho_ten_bo = col(db.String(255))
    ho_ten_me = col(db.String(255))
    nghe_nghiep_bo = col(db.String(255))
    nghe_nghiep_me = col(db.String(255))
    # id_ten_thanh_bo = ref('hoso__christian_name')
    # id_ten_thanh_me = ref('hoso__christian_name')
    notes = col(db.Text)
    created_at = col(db.DateTime, nullable=False, default=dt.datetime.utcnow)
    updated_at = col(db.DateTime, nullable=False, default=dt.datetime.utcnow)

    # def __init__(self):
    def __repr__(self) -> str:
        return super().__repr__()

    def create(self):
        db.session.add(self)
        db.session.commit()
        return self
示例#24
0
class ActionList:
    id: int = col("ActionListDefID")
    name: str = col("Name")
示例#25
0
class ActionListGroups:
    id: int = col("ActionListDefId")
    group_id: int = col("ActionListGroupDefId")
    order: int = col("GroupOrder")
    optional: bool = col("Optional")
示例#26
0
class EmailDocument:
    email_id: int = col("ActionEmailTemplateID")
    document_type_id: int = col("DocumentTypeID")