def get_categories(query_dict):
    """
    Returns a list of categories as strings.
    """
    categories = query_dict.get('categories', None)
    if categories is not None:
        categories = categories.split(',')
    else:
        categories = query_dict.getall('category')
        if len(categories) == 0:
            categories = None

    return categories