oth_ref.py
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import sys
from datetime import datetime
from sqlalchemy import (
Column,
Integer,
BigInteger,
Float,
Text,
DateTime,
ForeignKey,
UniqueConstraint,
String,
SmallInteger,
types,
func,
ForeignKeyConstraint,
literal_column,
and_
)
from sqlalchemy.orm import aliased
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.orm import (
relationship,
backref,
)
import re
from .tools import as_timezone
# from ..models import NamaModel, DefaultModel, DBSession, Base
ARGS = {'extend_existing': True, 'schema': 'public'}
# class PbbPelayanan(Base, NamaModel):
# __tablename__ = 'pbb_pelayanan'
# kode = Column(String(2))
# nama = Column(String(50))
# __table_args__ = (ARGS)
# @classmethod
# def query_kode(kode):
# return cls.query().filter_by(kode=kode)
# class PbbSyarat(Base, NamaModel):
# __tablename__ = 'pbb_syarat'
# kode = Column(String(2))
# nama = Column(String(50))
# __table_args__ = (ARGS)
# @classmethod
# def query_kode(kode):
# return cls.query().filter_by(kode=kode)
# class PbbSyaratPelayanan(Base, DefaultModel):
# __tablename__ = 'pbb_syarat_pelayanan'
# pelayanan_id = Column(Integer, ForeignKey(PbbPelayanan.id))
# syarat_id = Column(Integer, ForeignKey(PbbSyarat.id))
# __table_args__ = (ARGS)