def _add_geom(self, style, db_table):
        sql = (style.SQL_KEYWORD('SELECT ') +
               style.SQL_TABLE('AddGeometryColumn') + '(' +
               style.SQL_TABLE(gqn(db_table)) + ', ' +
               style.SQL_FIELD(gqn(self.column)) + ', ' +
               style.SQL_FIELD(str(self.srid)) + ', ' +
               style.SQL_COLTYPE(gqn(self.geom_type)) + ', ' +
               style.SQL_KEYWORD(str(self.dim)) + ');')

        if not self.null:
            # Add a NOT NULL constraint to the field
            sql += ('\n' +
                    style.SQL_KEYWORD('ALTER TABLE ') +
                    style.SQL_TABLE(qn(db_table)) +
                    style.SQL_KEYWORD(' ALTER ') +
                    style.SQL_FIELD(qn(self.column)) +
                    style.SQL_KEYWORD(' SET NOT NULL') + ';')
        return sql
Disposes of the contents of an editor.
dataset/ETHPy150Open CollabQ/CollabQ/vendor/django/contrib/gis/db/backend/postgis/field.py/PostGISField._add_geom--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/list_editor.py/SimpleEditor.dispose