def register(self):
        """ put docstring here """
        
        # If object already have 'uid' field update entry otherwise insert new
        if hasattr(self.object, 'uid') and self.object.uid:
            cmd = 'update'
        else:
            cmd = 'insert'

        # autogenerated fields
        uid = xml_models.IntField(xpath="/tasksResponse/%s%sResult/@%s" % (
            cmd, self.__model__, {'insert': 'insertedEntityUid', 'update': 'updatedEntityUid'}[cmd]), default=None)
        lastUpdatedUid = xml_models.CharField(xpath="/tasksResponse/%s%sResult/@lastUpdatedUid" % (cmd, self.__model__))
        errors = xml_models.Collection(Error, order_by="error_type", xpath=(cmd, self.__model__) % "/tasksResponse/%s%sResult/errors/error")
        other_errors = xml_models.Collection(Error, order_by="error_type", xpath="/tasksResponse/errors/error")

        def validate_on_load(cls):
            for e in cls.errors:
                exception = classobj(str(e.error_type), (Exception,), {})
                raise exception, e.error_message
            for e in cls.other_errors:
                exception = classobj(str(e.error_type), (Exception,), {})
                raise exception, e.error_message

        # autogenerated class
        cls = classobj('POSTResponse', (xml_models.Model,), {
            'uid': uid,
            'lastUpdatedUid': lastUpdatedUid,
            'errors': errors,
            'other_errors': other_errors,
            'validate_on_load': validate_on_load,
            })
        #print self.xml
        return cls(xml=self.xml, dom=self.dom)
dataset/ETHPy150Open adlibre/Adlibre-TMS/adlibre_tms/apps/saasu_client/models/base.py/POSTResponseBase.register/swapped operands of `%`