Log Message: |
* Thuban/UI/dbdialog.py (ChooseDBTableDialog.__init__): Rework how
the dialog is constructed. Add combo boxes to select id and
geometry column. Rename some instance variables.
(ChooseDBTableDialog.GetTable): Return id and geometry column
names
(ChooseDBTableDialog.OnTableSelect): New. Event handler for
selections in the table list
* Thuban/UI/mainwindow.py (MainWindow.AddDBLayer): Use id_column
and geometry_column
* Thuban/Model/session.py (Session.OpenDBShapeStore): Add the new
parameters for id_column and geometry column of PostGISShapeStore
here as well.
* Thuban/Model/postgisdb.py (type_map): Add ROWID psycog type.
(_raw_type_map): New. Map raw PostgreSQL type ints to thuban types
(PostGISConnection.GeometryTables): Use a better query to
determine which relations in the database might be usable for
shapestores. Now supports views as well but is more PostgreSQL
specific
(PostGISConnection.table_columns): New. Somewhat experimental
method to let the db dialogs provide lists of columns to users so
that they can select id and geometry columns.
(PostGISTable.__init__): The default value of the id_column
parameter is now None it still means "gid" effectively, though.
(PostGISTable.IDColumn): New introspection method to return a
column object for the id column
(PostGISShapeStore.GeometryColumn): New introspection method to
return a column object for the geometry column
* test/test_postgis_db.py
(TestPostGISConnection.test_gis_tables_non_empty):
Removed. Subsumed by the new:
(TestPostGISConnection.test_gis_tables_with_views_and_tables):
New. Tes the GeometryTables and table_columns methods with actual
tables and views.
(PointTests.test_id_column, PointTests.test_geometry_column):
New. tests for the new methods.
(TestPostGISShapestorePoint.setUp)
(TestPostGISShapestorePointSRID.setUp)
(TestPostGISShapestorePointExplicitGIDColumn.setUp): Fill the
instance variables needed by the new tests
|