@classmethod
def find_by_id(cls, _id):
    result = mongo.db.user.find_one({'_id': _id})
    if result:
        user = cls(_id=result['_id'], username=result['username'], password=result['password'])
    else:
        user = None
    return user
@classmethod
def find_by_id(cls, _id):
    result = mongo.db.user.find_one({'_id': _id})
    if result:
        user = cls(_id=result['_id'], username=result['username'], password=result['password'])
    else:
        user = None
    return user