Renamed wrregion_id to region_id.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 18 Nov 2013 22:34:49 +0000 (22:34 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 18 Nov 2013 22:34:49 +0000 (22:34 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@1825 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrpylib/wrmwcache.py
wrpylib/wrmwdb.py

index 4b3df610d72329eb7f6cf50f1aa0ee265149e97d..12f66e731c7838b3f8d97ab3be90613dadd13a59 100644 (file)
@@ -229,7 +229,7 @@ def update_wrregioncache(connection):
     connection.execute(wrregioncache.delete())
     
     # Query all combinations of sledruns and regions
-    sel = select([wrregion.c.id.label('wrregion_id'), wrregion.c.border.label('border'), wrsledruncache.c.page_id, wrsledruncache.c.position_longitude, wrsledruncache.c.position_latitude], geofunc.gcontains(wrregion.c.border, sqlfunc.point(wrsledruncache.c.position_longitude, wrsledruncache.c.position_latitude))) 
+    sel = select([wrregion.c.id.label('region_id'), wrregion.c.border.label('border'), wrsledruncache.c.page_id, wrsledruncache.c.position_longitude, wrsledruncache.c.position_latitude], geofunc.gcontains(wrregion.c.border, sqlfunc.point(wrsledruncache.c.position_longitude, wrsledruncache.c.position_latitude))) 
     ins = wrregioncache.insert()
 
     # Refill wrregioncache
@@ -238,7 +238,7 @@ def update_wrregioncache(connection):
     for row in result:
         point.SetPoint(0, row.position_longitude, row.position_latitude)
         if point.Within(ogr.CreateGeometryFromWkb(row.border.geom_wkb)):
-            connection.execute(ins.values(wrregion_id=row.wrregion_id, page_id=row.page_id))
+            connection.execute(ins.values(region_id=row.region_id, page_id=row.page_id))
 
     # commit
     transaction.commit()
index b946eb0fc8dd3cf9cce3d6bea7e700297d661a9f..52f8e09d89e1d40d91850a81a91026b63194a3f8 100644 (file)
@@ -157,7 +157,7 @@ def wrregioncache_table(metadata):
     """
     return Table("wrregioncache", metadata,
     Column("id", types.Integer, primary_key=True),
-    Column("wrregion_id", types.Integer, schema.ForeignKey('wrregin.id')),
+    Column("region_id", types.Integer, schema.ForeignKey('wrregin.id')),
     Column("page_id", types.Integer)
     )