示例#1
0
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())
示例#2
0
 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()
示例#3
0
    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>'
            '&lt;LoginData&gt;<br>'
            '&nbsp;&nbsp;&nbsp;&nbsp;&lt;ip&gt;데이터베이스 서버 아이피&lt;/ip&gt;<br>'
            '&nbsp;&nbsp;&nbsp;&nbsp;&lt;port&gt;포트&lt;/port&gt;<br>'
            '&nbsp;&nbsp;&nbsp;&nbsp;&lt;loginDB&gt;관리자 아이디 테이블 이름&lt;/loginDB&gt;<br>'
            '&nbsp;&nbsp;&nbsp;&nbsp;&lt;dataDB&gt;작업자 테이블 이름&lt;/dataDB&gt;<br>'
            '&lt;/LoginData&gt;<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_()
示例#4
0
    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()
示例#5
0
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)
示例#6
0
    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()