Browse files

fixed: depends update error

  • Loading branch information...
1 parent de933e2 commit f237837466d153e0f7f515567524920abfae7c96 @jianingy committed May 29, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 sitebase/backend/postgres.py
View
8 sitebase/backend/postgres.py
@@ -76,8 +76,8 @@ class PostgresBackend(object):
SQL_SELECT_REFERERS = "SELECT id FROM nodes \
WHERE manifest = ANY(%(referers)s) AND value->%(field)s = %(value)s"
- SQL_SELECT_DEPENDS = "SELECT id FROM nodes \
-WHERE depends @> %(depends)s"
+ SQL_SELECT_DEPENDS = "SELECT depends FROM node_cache \
+WHERE id = %(id)s LIMIT 1"
SQL_SELECT_CACHE_EX = """SELECT id, (each(value)).key, \
(each(value)).value FROM (SELECT id, (value \
@@ -465,13 +465,13 @@ def _select_referers(self, c, node_id):
@defer.inlineCallbacks
def _select_depends(self, c, node_id):
- c = yield c.execute(self.SQL_SELECT_NODE_BASIC, dict(id=node_id))
+ c = yield c.execute(self.SQL_SELECT_DEPENDS, dict(id=node_id))
nodes = c.fetchall()
if not nodes:
defer.returnValue([])
- node_id, manifest, cn, depends = nodes[0]
+ depends = nodes[0]
if depends:
defer.returnValue(depends)
else:

0 comments on commit f237837

Please sign in to comment.