Пример #1
0
        return None

    def logout(self, username):

        try:

            persistence.mongo_decorators.user.User.update(self.users[username])
            
            del self.users[username]
        finally:
            pass
        
if __name__ == "__main__":

    db = mongo_connection.get_default_db()

    db.users.remove({})

    um = get_instance()
    
    ru = um.register_user('fra','fra', 'fra@fra')

    print ru
    
    u = um.login('fra@fra', 'fra')
    print u

    u = um.get_user_by_email('fra@fra')
    print u
Пример #2
0
    def get_collection(cls):

        db = mongo_connection.get_default_db()
        return db[cls.COLLECTION]