(domain)
return upstream_list, downstream_list
Return 2 lists of keywords
    The upstream_list contains keywords that originated in the specified domain
    The downstream_list contains keywords that have been pulled from a domain upstream of the specified domain
Return 2 lists of keywords
    The upstream_list contains keywords that originated in the specified domain
    The downstream_list contains keywords that have been pulled from a domain upstream of the specified domain
Return 2 lists of keywords The upstream_list contains keywords that originated in the specified domain The downstream_list contains keywords that have been pulled from a domain upstream of the specified domain
def get_upstream_and_downstream_keywords(domain):
    """
    Return 2 lists of keywords
    The upstream_list contains keywords that originated in the specified domain
    The downstream_list contains keywords that have been pulled from a domain upstream of the specified domain
    """
    upstream_list = {}
    downstream_list = {}
    keywords = Keyword.objects.filter(domain=domain)
    for keyword in keywords:
        if keyword.upstream_id:
            downstream_list[str(keyword.id)] = keyword
        else:
            upstream_list[str(keyword.id)] = keyword
    return upstream_list, downstream_list
def get_upstream_and_downstream_keywords ( domain ) : upstream_list = { } downstream_list = { } keywords = Keyword . objects . filter ( domain = domain ) for keyword in keywords : if keyword . upstream_id : downstream_list [ str ( keyword . id ) ] = keyword else : upstream_list [ str ( keyword . id ) ] = keyword return upstream_list , downstream_list