CROSS JOIN, thanks jotbe
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.9.9-stable+timestamp.2014.09.14.11.58.10
|
Version 2.9.9-stable+timestamp.2014.09.14.14.57.06
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ def bg_graph_model():
|
|||||||
if hasattr(db[tablename],'_meta_graphmodel'):
|
if hasattr(db[tablename],'_meta_graphmodel'):
|
||||||
meta_graphmodel = db[tablename]._meta_graphmodel
|
meta_graphmodel = db[tablename]._meta_graphmodel
|
||||||
else:
|
else:
|
||||||
meta_graphmodel = dict(group='Undefined', color='#ECECEC')
|
meta_graphmodel = dict(group=request.application, color='#ECECEC')
|
||||||
|
|
||||||
group = meta_graphmodel['group'].replace(' ', '')
|
group = meta_graphmodel['group'].replace(' ', '')
|
||||||
if not subgraphs.has_key(group):
|
if not subgraphs.has_key(group):
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ def bg_graph_model():
|
|||||||
if hasattr(db[tablename],'_meta_graphmodel'):
|
if hasattr(db[tablename],'_meta_graphmodel'):
|
||||||
meta_graphmodel = db[tablename]._meta_graphmodel
|
meta_graphmodel = db[tablename]._meta_graphmodel
|
||||||
else:
|
else:
|
||||||
meta_graphmodel = dict(group='Undefined', color='#ECECEC')
|
meta_graphmodel = dict(group=request.application, color='#ECECEC')
|
||||||
|
|
||||||
group = meta_graphmodel['group'].replace(' ', '')
|
group = meta_graphmodel['group'].replace(' ', '')
|
||||||
if not subgraphs.has_key(group):
|
if not subgraphs.has_key(group):
|
||||||
|
|||||||
+5
-3
@@ -1766,18 +1766,20 @@ class BaseAdapter(ConnectionPool):
|
|||||||
query = self.common_filter(query, tablenames_for_common_filters)
|
query = self.common_filter(query, tablenames_for_common_filters)
|
||||||
sql_w = ' WHERE ' + self.expand(query) if query else ''
|
sql_w = ' WHERE ' + self.expand(query) if query else ''
|
||||||
|
|
||||||
|
JOIN = ' CROSS JOIN '
|
||||||
|
|
||||||
if inner_join and not left:
|
if inner_join and not left:
|
||||||
# Wrap table references with parenthesis (approach 1)
|
# Wrap table references with parenthesis (approach 1)
|
||||||
# sql_t = ', '.join([self.table_alias(t)
|
# sql_t = ', '.join([self.table_alias(t)
|
||||||
# for t in iexcluded + itables_to_merge.keys()])
|
# for t in iexcluded + itables_to_merge.keys()])
|
||||||
# sql_t = '(%s)' % sql_t
|
# sql_t = '(%s)' % sql_t
|
||||||
# or approach 2: Use 'JOIN' instead comma:
|
# or approach 2: Use 'JOIN' instead comma:
|
||||||
sql_t = ' JOIN '.join([self.table_alias(t)
|
sql_t = JOIN.join([self.table_alias(t)
|
||||||
for t in iexcluded + itables_to_merge.keys()])
|
for t in iexcluded + itables_to_merge.keys()])
|
||||||
for t in ijoinon:
|
for t in ijoinon:
|
||||||
sql_t += ' %s %s' % (icommand, t)
|
sql_t += ' %s %s' % (icommand, t)
|
||||||
elif not inner_join and left:
|
elif not inner_join and left:
|
||||||
sql_t = ' JOIN '.join([self.table_alias(t)
|
sql_t = JOIN.join([self.table_alias(t)
|
||||||
for t in excluded + tables_to_merge.keys()])
|
for t in excluded + tables_to_merge.keys()])
|
||||||
if joint:
|
if joint:
|
||||||
sql_t += ' %s %s' % (command,
|
sql_t += ' %s %s' % (command,
|
||||||
@@ -1790,7 +1792,7 @@ class BaseAdapter(ConnectionPool):
|
|||||||
tables_in_joinon = set(joinont + ijoinont)
|
tables_in_joinon = set(joinont + ijoinont)
|
||||||
tables_not_in_joinon = \
|
tables_not_in_joinon = \
|
||||||
all_tables_in_query.difference(tables_in_joinon)
|
all_tables_in_query.difference(tables_in_joinon)
|
||||||
sql_t = ' JOIN '.join([self.table_alias(t) for t in tables_not_in_joinon])
|
sql_t = JOIN.join([self.table_alias(t) for t in tables_not_in_joinon])
|
||||||
for t in ijoinon:
|
for t in ijoinon:
|
||||||
sql_t += ' %s %s' % (icommand, t)
|
sql_t += ' %s %s' % (icommand, t)
|
||||||
if joint:
|
if joint:
|
||||||
|
|||||||
Reference in New Issue
Block a user