'Fetch tags by namespace, or collate all into namespaces'

def all_ns(self, namespace=None):

    tags = self.all()
    if (namespace == ''):
        return tags.exclude(name__contains=':')
    if (namespace is not None):
        results = []
        for tag in tags:
            if tag.name.startswith(namespace):
                results.append(tag)
        return results
    ns_tags = {}
    for tag in tags:
        (ns, name) = self._parse_ns(tag)
        if (ns not in ns_tags):
            ns_tags[ns] = [tag]
        else:
            ns_tags[ns].append(tag)
    return ns_tags
