(self)
Returns the devices and groups with which the device can be synced

        Groups are represented as lists of devices
Returns the devices and groups with which the device can be synced
Returns the devices and groups with which the device can be synced
def get_sync_targets(self):
        """Returns the devices and groups with which the device can be synced

        Groups are represented as lists of devices"""

        user = UserProxy.objects.from_user(self.user)
        for group in user.get_grouped_devices():

            if self in group.devices and group.is_synced:
                # the device's group can't be a sync-target
                continue

            elif group.is_synced:
                yield group.devices

            else:
                # every unsynced device is a sync-target
                for dev in group.devices:
                    if not dev == self:
                        yield dev
def get_sync_targets ( self ) : user = UserProxy . objects . from_user ( self . user ) for group in user . get_grouped_devices ( ) : if self in group . devices and group . is_synced : # the device's group can't be a sync-target continue elif group . is_synced : yield group . devices else : # every unsynced device is a sync-target for dev in group . devices : if not dev == self : yield dev