def parse_generation(generation):
    """
    Parses a generation, returning both the name and the dynamic parameter
    the generation is based on.

    So parse_generation("nav:user_id") => ("nav", "user_id")
    and parse_generation("nav") => ("nav", None)
    """
    parts = generation.split(':')
    if len(parts) == 1:
        return parts[0], None
    else:
        return tuple(parts)
