Exemple #1
0
    def get_recovery(cls, _id=None):
        """
        Fetches a list of the all the Recovery objects in the given collection
        :param _id: The specific ID of a particular collection
        :return: List of Recovery objects or one specific Recovery object
        """
        if _id is None:
            return [
                cls(**recovery) for recovery in Database.find(COLLECTION, {})
            ]

        else:
            return [cls(Database.find_one(COLLECTION, {'_id': _id}))]
Exemple #2
0
 def from_blog(email):
     return [
         stats for stats in Database.find(collection='baseball',
                                          query={'email': email})
     ]
Exemple #3
0
 def find_by_author_id(cls, author_id):
     blog_data = Database.find(collection='blogs',
                               query={'author_id': author_id})
     return [blog for blog in blog_data]
Exemple #4
0
 def get_one(user_id, project_id):
     return [post for post in Database.find(collection='projects', query={'user_id':user_id, 'project_id':project_id})]
Exemple #5
0
 def from_user(user_id):
     data = [post for post in Database.find(collection='projects', query={'user_id':user_id})]
     return data
Exemple #6
0
 def from_blog(id):
     return [
         post for post in Database.find(collection='posts',
                                        query={'blog_id': id})
     ]