from sqlalchemy import JSON, Sequence, Column, Integer, String,ForeignKey,Boolean import persistence __db_Base = persistence.get_db_base() class isp(__db_Base) : __tablename__ = 'tIsp' id = Column(Integer, Sequence('isp_id_seq'), primary_key=True,nullable=False) name = Column(String(50)) description = Column(String(500)) class user_account(__db_Base) : __tablename__ = 'tUser_accounts' id = Column(Integer, Sequence('user_accounts_id_seq'), primary_key=True,nullable=False) nickname = Column(String(50), primary_key=True, nullable=False) description = Column(String(500)) password = Column(String) is_super_admin = Column(Boolean, default=False) custom_data = Column(JSON) privileges_data = Column(JSON) # for privilege we can use an int in the used as a bitset later for an array of privilege class user_account_isp_link(__db_Base): __tablename__ = 'tUser_account_isp_links' link_id = Column(Integer, Sequence('tUser_account_isp_links_seq'), primary_key=True,nullable=False) user_account_id = Column(Integer, ForeignKey('tUser_accounts.id')) isp_id = Column(Integer, ForeignKey('tIsp.id')) note = Column(String(500)) contact_mail = Column(String(100)) contact_number = Column(String(100))