def add(self, *args, **kwargs):
        """Add the instance tied to the field for the given "value" (via `args`) to the index

        For the parameters, see ``BaseIndex.add``

        """

        check_uniqueness = kwargs.get('check_uniqueness', True)

        key = self.get_storage_key(*args)
        if self.field.unique and check_uniqueness:
            self.check_uniqueness(key=key, *args)

        # Do index => create a key to be able to retrieve parent pk with
        # current field value]
        pk = self.instance.pk.get()
        logger.debug("adding %s to index %s" % (pk, key))
        self.connection.sadd(key, pk)
        self._indexed_values.add(tuple(args))
def add ( self , * args , ** kwargs ) : check_uniqueness = kwargs . get ( 'check_uniqueness' , True ) key = self . get_storage_key ( * args ) if self . field . unique and check_uniqueness : self . check_uniqueness ( key = key , * args ) pk = self . instance . pk . get ( ) logger . debug ( "adding %s to index %s" % ( pk , key ) ) self . connection . sadd ( key , pk ) self . _indexed_values . add ( tuple ( args ) )
Add the instance tied to the field for the given "value" (via `args`) to the index

        For the parameters, see ``BaseIndex.add``