versions/v2/business.py
def read_all_businesses():
    """Reads all Businesses
    user can search for business via business name
    response is paginated per limit
    """
    params = {
        'page': request.args.get('page', default=1, type=int),
        'limit': request.args.get('limit', default=5, type=int),
        'location': request.args.get('location', default=None, type=str),
        'category': request.args.get('category', default=None, type=str),
        '_query': request.args.get('q', default=None, type=str)
    }

    businesses = Business().Search(params)

    if businesses:
        return jsonify({
            'businesses': [
                {   'id': business.id,
                    'name': business.name,
                    'logo': business.logo,
                    'location': business.location,
                    'category': business.category,
                    'bio': business.bio,
                    'owner': business.owner.username,
                    'created_at': business.created_at,
                    'updated_at': business.updated_at
                } for business in businesses
            ]
        }), 200
    return jsonify({'warning': 'No Businesses, create one first'}), 200
Reads all Businesses
    user can search for business via business name
    response is paginated per limit
    
Reads all Businesses
user can search for business via business name
response is paginated per limit
Reads all Businesses user can search for business via business name response is paginated per limit
def read_all_businesses():
    params = {
        'page': request.args.get('page', default=1, type=int),
        'limit': request.args.get('limit', default=5, type=int),
        'location': request.args.get('location', default=None, type=str),
        'category': request.args.get('category', default=None, type=str),
        '_query': request.args.get('q', default=None, type=str)
    }
    businesses = Business().Search(params)
    if businesses:
        return jsonify({
            'businesses': [
                {   'id': business.id,
                    'name': business.name,
                    'logo': business.logo,
                    'location': business.location,
                    'category': business.category,
                    'bio': business.bio,
                    'owner': business.owner.username,
                    'created_at': business.created_at,
                    'updated_at': business.updated_at
                } for business in businesses
            ]
        }), 200
    return jsonify({'warning': 'No Businesses, create one first'}), 200
def read_all_businesses ( ) : params = { 'page' : request . args . get ( 'page' , default = 1 , type = int ) , 'limit' : request . args . get ( 'limit' , default = 5 , type = int ) , 'location' : request . args . get ( 'location' , default = None , type = str ) , 'category' : request . args . get ( 'category' , default = None , type = str ) , '_query' : request . args . get ( 'q' , default = None , type = str ) } businesses = Business ( ) . Search ( params ) if businesses : return jsonify ( { 'businesses' : [ { 'id' : business . id , 'name' : business . name , 'logo' : business . logo , 'location' : business . location , 'category' : business . category , 'bio' : business . bio , 'owner' : business . owner . username , 'created_at' : business . created_at , 'updated_at' : business . updated_at } for business in businesses ] } ) , 200 return jsonify ( { 'warning' : 'No Businesses, create one first' } ) , 200
Reads all Businesses
user can search for business via business name
response is paginated per limit
Reads all Businesses user can search for business via business name response is paginated per limit
"""Reads all Businesses
    user can search for business via business name
    response is paginated per limit
    """