def __getattr__(self, attr):
        """
        Get an attribute. If the attribute does not exist, return None
        """

        if attr not in self._fields and attr not in self._internal:
            raise pytxAttributeError("%s is not a valid attribute" % attr)

        try:
            return object.__getattribute__(self, attr)
        except:
            return None
Beispiel #2
0
    def __getattr__(self, attr):
        """
        Get an attribute. If the attribute does not exist, return None
        """

        if attr not in self._fields + self._internal + self._unique:
            raise pytxAttributeError('%s is not a valid attribute' % attr)

        try:
            return object.__getattribute__(self, attr)
        except:
            return None