Ejemplo n.º 1
0
def get_subclasses_verbose_names(cls):
    for subcls in itersubclasses(cls):
        yield ("%s.%s" % (subcls.__module__, subcls.__name__),
               subcls._meta.verbose_name)
Ejemplo n.º 2
0
def get_subclasses_contenttype_qs(cls):
    ids = [ContentType.objects.get_for_model(subcls).id \
           for subcls in itersubclasses(cls)]
    return ContentType.objects.filter(id__in=ids)