Beispiel #1
0
def statuslist():
    s = []
    data = Database.find(collection, {})
    if data is not None:
        for i in data:
            print(i['mac'])
            if i['reporte']:
                d = i['reporte']
                e = datetime.now()
                f = e - d
                g = int(f.total_seconds())
                print(g)
                print(lastreach)
                if g <= lastreach:
                    s.append(i['mac'])
        return jsonify({'message': s})
    return {'message': 'None'}
Beispiel #2
0
 def find_groups_by_user(cls, user):
     return [
         cls(**group) for group in Database.find(collection=collection,
                                                 query={'users': user})
     ]