(self)
return kinds
Returns the names of kinds of things that are currently using
        this instance. Used for informing users, and determining whether
        the instance can be deleted.
Returns the names of kinds of things that are currently using
        this instance. Used for informing users, and determining whether
        the instance can be deleted.
Returns the names of kinds of things that are currently using this instance . Used for informing users and determining whether the instance can be deleted .
def used_by(self):
        """
        Returns the names of kinds of things that are currently using
        this instance. Used for informing users, and determining whether
        the instance can be deleted.
        """
        from corehq.motech.repeaters.models import Repeater

        kinds = set()
        if self.incrementalexport_set.exists():
            kinds.add(_('Incremental Exports'))
        if self.sqldatasetmap_set.exists():
            kinds.add(_('DHIS2 DataSet Maps'))
        if any(r.connection_settings_id == self.id
                for r in Repeater.by_domain(self.domain)):
            kinds.add(_('Data Forwarding'))

        # TODO: Check OpenmrsImporters (when OpenmrsImporters use ConnectionSettings)

        return kinds
def used_by ( self ) : from corehq . motech . repeaters . models import Repeater kinds = set ( ) if self . incrementalexport_set . exists ( ) : kinds . add ( _ ( 'Incremental Exports' ) ) if self . sqldatasetmap_set . exists ( ) : kinds . add ( _ ( 'DHIS2 DataSet Maps' ) ) if any ( r . connection_settings_id == self . id for r in Repeater . by_domain ( self . domain ) ) : kinds . add ( _ ( 'Data Forwarding' ) ) # TODO: Check OpenmrsImporters (when OpenmrsImporters use ConnectionSettings) return kinds