psqlextra/backend/hstore_unique.py
def _create_hstore_unique(self, model, field, keys):
        """Creates a UNIQUE constraint for the specified hstore keys."""

        name = self._unique_constraint_name(
            model._meta.db_table, field, keys)
        columns = [
            '(%s->\'%s\')' % (field.column, key)
            for key in keys
        ]
        sql = self.sql_hstore_unique_create.format(
            name=self.quote_name(name),
            table=self.quote_name(model._meta.db_table),
            columns=','.join(columns)
        )
        self.execute(sql)
def _create_hstore_unique(self, model, field, keys):
        name = self._unique_constraint_name(
            model._meta.db_table, field, keys)
        columns = [
            '(%s->\'%s\')' % (field.column, key)
            for key in keys
        ]
        sql = self.sql_hstore_unique_create.format(
            name=self.quote_name(name),
            table=self.quote_name(model._meta.db_table),
            columns=','.join(columns)
        )
        self.execute(sql)
def _create_hstore_unique ( self , model , field , keys ) : name = self . _unique_constraint_name ( model . _meta . db_table , field , keys ) columns = [ '(%s->\'%s\')' % ( field . column , key ) for key in keys ] sql = self . sql_hstore_unique_create . format ( name = self . quote_name ( name ) , table = self . quote_name ( model . _meta . db_table ) , columns = ',' . join ( columns ) ) self . execute ( sql )
Creates a UNIQUE constraint for the specified hstore keys.
Creates a UNIQUE constraint for the specified hstore keys .