code: def scoped(base_class, base_dn):
          
          class Meta:
              proxy = True
              verbose_name = base_class._meta.verbose_name
              verbose_name_plural = base_class._meta.verbose_name_plural
          import re
          suffix = re.sub('[=,]', '_', base_dn)
          name = "%s_%s" % (base_class.__name__, str(suffix))
          new_class = type(str(name), (base_class,), {
              'base_dn': base_dn, '__module__': base_class.__module__,
              'Meta': Meta})
          return new_class
docs: Returns a copy of the current class with a different base_dn.