class Base(DB.Model): __abstract__ = True id = DB.Column(DB.Integer, primary_key=True) date_created = DB.Column(DB.DateTime, default=DB.func.current_timestamp()) date_modified = DB.Column(DB.DateTime, default=DB.func.current_timestamp(), onupdate=DB.func.current_timestamp())
def __init__(self, img1, img2, img3, img4, img5): super().__init__(root) DB.DB() self.add_tab_img = tk.PhotoImage(file=img1) self.add_cli_img = tk.PhotoImage(file=img2) self.out_tab_img = tk.PhotoImage(file=img3) self.add_an_img = tk.PhotoImage(file=img4) self.add_series_img = tk.PhotoImage(file=img5) self.init_main()
return result if __name__ == '__main__': pipe.info = getAccount() pipe.app = QtWidgets.QApplication(sys.argv) pipe.app.setWindowIcon(QtGui.QIcon('res/icon.ico')) if pipe.info is None: errMsg = QtWidgets.QErrorMessage() errMsg.setFixedHeight(320) errMsg.setFixedWidth(480) errMsg.showMessage( 'res/data.xml이 없거나 data.xml 파일이 존재하지 않습니다.<br>' '이 경우 res 폴더에 data.xml을 아래와 같은 방식으로 만들어주십시오.<br>' '<LoginData><br>' ' <ip>데이터베이스 서버 아이피</ip><br>' ' <port>포트</port><br>' ' <loginDB>관리자 아이디 테이블 이름</loginDB><br>' ' <dataDB>작업자 테이블 이름</dataDB><br>' '</LoginData><br>') else: pipe.db = DB.DB(ip=pipe.info['ip'], port=pipe.info['port'], table=pipe.info['loginDB']) pipe.window = QtWidgets.QWidget() pipe.ui = signIn.Ui_Form() pipe.ui.setupUi(pipe.window) pipe.window.show() pipe.app.exec_()
name = DB.Column(DB.Text(), nullable=False) description = DB.Column(DB.Text(), nullable=False) source = DB.Column(DB.Text(), nullable=False) date = DB.Column(DB.Float(), nullable=False) path = DB.Column(DB.Text(), nullable=False) personal = DB.Column(DB.Boolean(), nullable=False) userSubmitted = DB.Column(DB.Boolean(), nullable=False) # New instance instantiation procedure def __init__(self, name, description, source, path, date, personal, userSubmitted): self.name = name self.description = description self.source = source self.date = date self.path = path self.personal= personal self.userSubmitted = userSubmitted def to_dict(self): return dict(id=self.id, name=self.name, description=self.description, source=self.source, path=self.path, date=self.date, personal=self.personal, userSubmitted=self.userSubmitted) #DB.drop_all() DB.create_all()
class Dataset(Base): __tablename__ = 'datasets' name = DB.Column(DB.Text(), nullable=False) description = DB.Column(DB.Text(), nullable=False) source = DB.Column(DB.Text(), nullable=False) date = DB.Column(DB.Float(), nullable=False) path = DB.Column(DB.Text(), nullable=False) personal = DB.Column(DB.Boolean(), nullable=False) userSubmitted = DB.Column(DB.Boolean(), nullable=False) # New instance instantiation procedure def __init__(self, name, description, source, path, date, personal, userSubmitted): self.name = name self.description = description self.source = source self.date = date self.path = path self.personal = personal self.userSubmitted = userSubmitted def to_dict(self): return dict(id=self.id, name=self.name, description=self.description, source=self.source, path=self.path, date=self.date, personal=self.personal, userSubmitted=self.userSubmitted)
source = DB.Column(DB.Text(), nullable=False) date = DB.Column(DB.Float(), nullable=False) path = DB.Column(DB.Text(), nullable=False) personal = DB.Column(DB.Boolean(), nullable=False) userSubmitted = DB.Column(DB.Boolean(), nullable=False) # New instance instantiation procedure def __init__(self, name, description, source, path, date, personal, userSubmitted): self.name = name self.description = description self.source = source self.date = date self.path = path self.personal = personal self.userSubmitted = userSubmitted def to_dict(self): return dict(id=self.id, name=self.name, description=self.description, source=self.source, path=self.path, date=self.date, personal=self.personal, userSubmitted=self.userSubmitted) #DB.drop_all() DB.create_all()