app/request.py
def process_sources(source_list):
    """
    We now want to process the dictionary and
    output a list of objects - news_results.
    We process results will transform our dictionary into a list of objects.
    """
    news_results = []
    for source in source_list:
        id = source.get('id')
        print(id)
        name = source.get('name')
        print(name)
        description = source.get('description')
        url = source.get('url')
        category = source.get('category')
        country = source.get('country')
        if url:
            source_object = Source(id,
                                   name,
                                   description,
                                   url,
                                   category,
                                   country)

            news_results.append(source_object)

    return news_results

    We now want to process the dictionary and
    output a list of objects - news_results.
    We process results will transform our dictionary into a list of objects.
    
We now want to process the dictionary and
output a list of objects - news_results.
We process results will transform our dictionary into a list of objects.
We now want to process the dictionary and output a list of objects - news_results . We process results will transform our dictionary into a list of objects .
def process_sources(source_list):
    news_results = []
    for source in source_list:
        id = source.get('id')
        print(id)
        name = source.get('name')
        print(name)
        description = source.get('description')
        url = source.get('url')
        category = source.get('category')
        country = source.get('country')
        if url:
            source_object = Source(id,
                                   name,
                                   description,
                                   url,
                                   category,
                                   country)
            news_results.append(source_object)
    return news_results
def process_sources ( source_list ) : news_results = [ ] for source in source_list : id = source . get ( 'id' ) print ( id ) name = source . get ( 'name' ) print ( name ) description = source . get ( 'description' ) url = source . get ( 'url' ) category = source . get ( 'category' ) country = source . get ( 'country' ) if url : source_object = Source ( id , name , description , url , category , country ) news_results . append ( source_object ) return news_results
We now want to process the dictionary and
output a list of objects - news_results.
We now want to process the dictionary and output a list of objects - news_results .
"""
    We now want to process the dictionary and
    output a list of objects - news_results.
    We process results will transform our dictionary into a list of objects.
    """
source_list