(self)
return not (self.attachment_src or self.attachment_from)
Helper method to see if this is a delete vs. update

        The spec says "no attributes, empty - This will remove the attachment."
        This implementation only considers `src` and `from` values since that
        should be sufficient to detect a deletion. However, technically the
        `name` value could be considered as well, although having a non-empty
        `name` with empty `src` and `from` is an undefined state.
        https://github.com/dimagi/commcare-core/wiki/casexml20#case-action-elements

        This property is named differently from
        `casexml.apps.case.sharedmodels.CommCareCaseAttachment.is_present`
        to disambiguate the interface of that class from this one since
        they are not the same but are used in very similar contexts.
Helper method to see if this is a delete vs. update
Helper method to see if this is a delete vs . update
def is_delete(self):
        """
        Helper method to see if this is a delete vs. update

        The spec says "no attributes, empty - This will remove the attachment."
        This implementation only considers `src` and `from` values since that
        should be sufficient to detect a deletion. However, technically the
        `name` value could be considered as well, although having a non-empty
        `name` with empty `src` and `from` is an undefined state.
        https://github.com/dimagi/commcare-core/wiki/casexml20#case-action-elements

        This property is named differently from
        `casexml.apps.case.sharedmodels.CommCareCaseAttachment.is_present`
        to disambiguate the interface of that class from this one since
        they are not the same but are used in very similar contexts.
        """
        return not (self.attachment_src or self.attachment_from)
def is_delete ( self ) : return not ( self . attachment_src or self . attachment_from )