def get_user_initial_messages(cls, messageOwner): data = Database.find("chat", { "messageOwner": { "$eq": messageOwner }, "replymessageId": { "$eq": None } }) if data is not None: return data
def get_reports_queue(reportOwner): data = base.find("reports", { "reportOwner": { "$eq": reportOwner }, "status": { "$eq": 0 } }) if data is not None: return data.count() + 1
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()
def get_allusers_messages(): data = Database.find("chat", {"instantMessage": {"$eq": 0}}) if data is not None: return list(data)
def get_instantadmin_messages(): data = Database.find("chat", {"instantMessage": {"$eq": 1}}) if data is not None: return list(data)
def get_message_byDate(cls, messageDate): data = Database.find("chat", {"messageDate": messageDate}) if data is not None: return list(data)
def get_message_by_messageOwner(cls, owner): data = Database.find("chat", {"messageOwner": owner}) if data is not None: return list(data)
def get_all_messages(): data = Database.find("chat", {}) if data is not None: return list(data)
def get_all_notification_of_user(cls, Owner): data = base.find("notification", {"notiOwner": {"$eq": Owner}}) return list(data)
def get_rejected_reports_count(): data = base.find("reports", {"status": {"$eq": -1}}) if data is not None: return data.count()
def get_all_reports_count(): data = base.find("reports", {}) if data is not None: return data.count()
def count_users(): data = Database.find("users", {}) if data is not None: return data.count()
def find_reports_by_owner_id(cls, owner_id): return [ post for post in base.find(collection="reports", query={"reportOwner": owner_id}) ]
def get_all_rejected_reports(): data = base.find("reports", {"status": {"$eq": -1}}) if data is not None: return list(data)
def get_all_pending_reports(): data = base.find("reports", {"status": {"$eq": 0}}) if data is not None: return list(data)
def get_all_reports(): data = base.find("reports", {}) if data is not None: return list(data)
def get_unviewed_messages(): data = Database.find("chat", {"viewed": {"$eq": 0}}) if data is not None: return list(data)
def get_notifications_by_owner_id(cls, notiOwner): data = base.find("notification", {"notiOwner": notiOwner}) if data is not None: return list(data)
def get_all_users(): data = Database.find("users", {}) if data is not None: return list(data)
def get_pending_reports_count(): data = base.find("reports", {"status": {"$eq": 0}}) if data is not None: return data.count()