@classmethod
    def get_for(cls, model, type_names=None):
        result = []

        try:
            for type_name, attributes in cls.__registry[model].iteritems():
                if not type_names or type_names in type_name:
                    result.extend(attributes)

            return result
        except IndexError:
            # We were passed a model instance, try again using the model of
            # the instance

            # If we are already in the model class, exit with an error
            if model.__class__ == models.base.ModelBase:
                raise

            return cls.get_for[type(model)]
dataset/ETHPy150Open mayan-edms/mayan-edms/mayan/apps/common/classes.py/ModelAttribute.get_for/swapped operands of `in`