Ejemplo n.º 1
0
 def get_user_initial_messages(cls, messageOwner):
     data = Database.find("chat", {
         "messageOwner": {
             "$eq": messageOwner
         },
         "replymessageId": {
             "$eq": None
         }
     })
     if data is not None:
         return data
Ejemplo n.º 2
0
 def get_reports_queue(reportOwner):
     data = base.find("reports", {
         "reportOwner": {
             "$eq": reportOwner
         },
         "status": {
             "$eq": 0
         }
     })
     if data is not None:
         return data.count() + 1
Ejemplo n.º 3
0
 def get_report_status_per_user(cls, reportOwner, state):
     data = base.find("reports", {
         "reportOwner": {
             "$eq": reportOwner
         },
         "status": {
             "$eq": state
         }
     })
     if data is not None:
         return data.count()
Ejemplo n.º 4
0
 def get_allusers_messages():
     data = Database.find("chat", {"instantMessage": {"$eq": 0}})
     if data is not None:
         return list(data)
Ejemplo n.º 5
0
 def get_instantadmin_messages():
     data = Database.find("chat", {"instantMessage": {"$eq": 1}})
     if data is not None:
         return list(data)
Ejemplo n.º 6
0
 def get_message_byDate(cls, messageDate):
     data = Database.find("chat", {"messageDate": messageDate})
     if data is not None:
         return list(data)
Ejemplo n.º 7
0
 def get_message_by_messageOwner(cls, owner):
     data = Database.find("chat", {"messageOwner": owner})
     if data is not None:
         return list(data)
Ejemplo n.º 8
0
 def get_all_messages():
     data = Database.find("chat", {})
     if data is not None:
         return list(data)
Ejemplo n.º 9
0
 def get_all_notification_of_user(cls, Owner):
     data = base.find("notification", {"notiOwner": {"$eq": Owner}})
     return list(data)
Ejemplo n.º 10
0
 def get_rejected_reports_count():
     data = base.find("reports", {"status": {"$eq": -1}})
     if data is not None:
         return data.count()
Ejemplo n.º 11
0
 def get_all_reports_count():
     data = base.find("reports", {})
     if data is not None:
         return data.count()
Ejemplo n.º 12
0
 def count_users():
     data = Database.find("users", {})
     if data is not None:
         return data.count()
Ejemplo n.º 13
0
 def find_reports_by_owner_id(cls, owner_id):
     return [
         post for post in base.find(collection="reports",
                                    query={"reportOwner": owner_id})
     ]
Ejemplo n.º 14
0
 def get_all_rejected_reports():
     data = base.find("reports", {"status": {"$eq": -1}})
     if data is not None:
         return list(data)
Ejemplo n.º 15
0
 def get_all_pending_reports():
     data = base.find("reports", {"status": {"$eq": 0}})
     if data is not None:
         return list(data)
Ejemplo n.º 16
0
 def get_all_reports():
     data = base.find("reports", {})
     if data is not None:
         return list(data)
Ejemplo n.º 17
0
 def get_unviewed_messages():
     data = Database.find("chat", {"viewed": {"$eq": 0}})
     if data is not None:
         return list(data)
Ejemplo n.º 18
0
 def get_notifications_by_owner_id(cls, notiOwner):
     data = base.find("notification", {"notiOwner": notiOwner})
     if data is not None:
         return list(data)
Ejemplo n.º 19
0
 def get_all_users():
     data = Database.find("users", {})
     if data is not None:
         return list(data)
Ejemplo n.º 20
0
 def get_pending_reports_count():
     data = base.find("reports", {"status": {"$eq": 0}})
     if data is not None:
         return data.count()