Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'django-split-tree' of cgitftp:wmsmash into django-split…

…-tree

Conflicts:
	nrcgit/wmsmash/relay/__init__.py
  • Loading branch information...
commit 84bd62f7b84cd46a7d7be1fb2e977bd5e623d0ad 2 parents fbd4a3f + d0a1e78
@monoid authored
View
6 nrcgit/wmsmash/core/__init__.py
@@ -58,10 +58,10 @@ def __init__(self, id, name, title, abstract, keywords, remote_name,
self.latlngbb = parseJuliaLatLngBB(latlngbb)
else:
self.latlngbb = BoundingBox()
- if cap is not None:
- self.cap = etree.XML(cap)
- else:
+ if cap is None:
self.cap = etree.Element("Layer")
+ else:
+ self.cap = etree.XML(cap)
self.cleanCap()
View
10 nrcgit/wmsmash/relay/__init__.py
@@ -14,7 +14,7 @@ def getCapabilitiesData(dbpool, user, set_name):
If layerset does not exists, None is returned."""
# Get layerset info: name, title, abastract, author name
lset = yield dbpool.runQuery(
-"""SELECT editor_set.name, title, abstract, auth_user.username FROM editor_set JOIN auth_user ON auth_user.id = editor_set.author_id WHERE auth_user.username = %s AND editor_set.name = %s
+"""SELECT editor_set.name, title, abstract, auth_user.username, editor_set.id FROM editor_set JOIN auth_user ON auth_user.id = editor_set.author_id WHERE auth_user.username = %s AND editor_set.name = %s
""", (user, set_name,))
# Fetch layers in the layerset and return a tuple (layersetData, layerdata)
if lset:
@@ -22,17 +22,17 @@ def getCapabilitiesData(dbpool, user, set_name):
# reconstruct whole tree.
layers = yield dbpool.runQuery(
"""SELECT editor_layertree.id, editor_namedlayertree.name,
- editor_layer.title, editor_layer.abstract, editor_namedlayer.name,
+ editor_layertree.title, editor_layer.abstract, editor_namedlayer.name,
editor_server.url,
editor_layertree.parent_id, editor_layertree.first_id, editor_layertree.nxt_id,
editor_layer.latlngbb, editor_layer.capablilities
- FROM editor_layertree JOIN editor_set ON editor_layertree.lset_id = editor_set.id
+ FROM editor_layertree
LEFT JOIN editor_layer ON editor_layertree.layer_id = editor_layer.id
LEFT JOIN editor_server ON editor_layer.server_id = editor_server.id
LEFT JOIN editor_namedlayertree ON editor_namedlayertree.id = editor_layertree.named_id
LEFT JOIN editor_namedlayer ON editor_namedlayer.id = editor_layer.named_id
- WHERE editor_set.name = %s
-ORDER BY parent_id ASC, nxt_id DESC""", (set_name,))
+ WHERE editor_layertree.lset_id = %s
+ORDER BY parent_id ASC, nxt_id DESC""", (lset[0][4],))
defer.returnValue((lset[0], layers))
else:
defer.returnValue(None)
Please sign in to comment.
Something went wrong with that request. Please try again.