Пример #1
0
 def get_by_id(id, fresh=False):
     if fresh == True:
         db_session.remove()
     sensor =\
         db_session.query(Sensor).\
             filter(Sensor.id == id).first()
     return sensor
Пример #2
0
 def get_all(fresh=False):
     """Returns all the nodes in the database
     """
     if fresh == True:
         db_session.remove()
     accounts = db_session.query(Account).all()
     return accounts
Пример #3
0
 def get_by_name(name, fresh=False):
     if fresh == True:
         db_session.remove()
     account =\
         db_session.query(Account).\
             filter(Account.account_name == name).first()
     return account
Пример #4
0
 def get_all(fresh=False):
     """Returns all the nodes in the database
     """
     if fresh == True:
         db_session.remove()
     nodes = db_session.query(Node).all()
     return nodes
Пример #5
0
    def get_printers():
        """Retrieve all printers in the database
        :returns: TODO

        """
        db_session.remove()
        l = []
        for printer in db_session.query(Printer):
            l.append(printer)
        return l
Пример #6
0
    def get_by_id(id, fresh=False):
        """Returns a job based on id
        :id: ID of job to be found
        :returns: Job if id is found, None if didn't exist

        """
        if fresh == True:
            db_session.remove()
        job =\
            db_session.query(Job).filter(Job.id == id).first()
        return job
Пример #7
0
    def get_by_id(id, fresh=False):
        """Returns a node based on id
        :id: ID of node to be found
        :returns: Node if id is found, None if didn't exist

        """
        if fresh == True:
            db_session.remove()
        node =\
            db_session.query(Node).\
                filter(Node.id == id).first()
        return node
Пример #8
0
    def get_by_webid(webid, fresh=False):
        """Returns a printer based on webid
        :webid: ID that the web interface uses
        :returns: Printer if webid is found, None if didn't exist

        """
        if fresh == True:
            db_session.remove()
        printer =\
            db_session.query(Printer).\
                filter(Printer.webid == webid).first()
        return printer
Пример #9
0
    def get_by_id(id, fresh=False):
        """Returns a printer based on id
        :id: ID of printer to be found
        :returns: Printer if id is found, None if didn't exist

        """
        if fresh == True:
            db_session.remove()
        printer =\
            db_session.query(Printer).\
                filter(Printer.id == id).first()
        return printer
Пример #10
0
    def get_by_webid(webid, fresh=False):
        """Returns a job based on webid
        :webid: WebID of job to be found
        :returns: Job if webid is found, None if didn't exist

        """
        if fresh == True:
            db_session.remove()
        job =\
            db_session.query(Job).\
                filter(Job.webid == webid).first()
        return job
Пример #11
0
 def get_all(fresh=False):
     if fresh == True:
         db_session.remove()
     printers = db_session.query(Printer).all()
     return printers