max_linked_inline broked, removed
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.10.0-trunk+timestamp.2014.08.20.21.25.43
|
Version 2.10.0-trunk+timestamp.2014.08.21.18.22.13
|
||||||
|
|||||||
+13
-23
@@ -1938,8 +1938,7 @@ class SQLFORM(FORM):
|
|||||||
noconfirm=False,
|
noconfirm=False,
|
||||||
cache_count=None,
|
cache_count=None,
|
||||||
client_side_delete=False,
|
client_side_delete=False,
|
||||||
ignore_common_filters=None,
|
ignore_common_filters=None):
|
||||||
):
|
|
||||||
|
|
||||||
formstyle = formstyle or current.response.formstyle
|
formstyle = formstyle or current.response.formstyle
|
||||||
|
|
||||||
@@ -2446,9 +2445,10 @@ class SQLFORM(FORM):
|
|||||||
left_cols += len(toadd)
|
left_cols += len(toadd)
|
||||||
|
|
||||||
# Include extra column for buttons if needed.
|
# Include extra column for buttons if needed.
|
||||||
include_buttons_column = (details or editable or deletable or
|
include_buttons_column = (
|
||||||
(links and links_in_grid and
|
details or editable or deletable or
|
||||||
not all([isinstance(link, dict) for link in links])))
|
(links and links_in_grid and
|
||||||
|
not all([isinstance(link, dict) for link in links])))
|
||||||
if include_buttons_column:
|
if include_buttons_column:
|
||||||
if buttons_placement in ['right', 'both']:
|
if buttons_placement in ['right', 'both']:
|
||||||
headcols.append(TH(_class=ui.get('default', '')))
|
headcols.append(TH(_class=ui.get('default', '')))
|
||||||
@@ -2730,7 +2730,7 @@ class SQLFORM(FORM):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def smartgrid(table, constraints=None, linked_tables=None,
|
def smartgrid(table, constraints=None, linked_tables=None,
|
||||||
links=None, links_in_grid=True, max_linked_inline=0,
|
links=None, links_in_grid=True,
|
||||||
args=None, user_signature=True,
|
args=None, user_signature=True,
|
||||||
divider='>', breadcrumbs_class='',
|
divider='>', breadcrumbs_class='',
|
||||||
**kwargs):
|
**kwargs):
|
||||||
@@ -2870,10 +2870,11 @@ class SQLFORM(FORM):
|
|||||||
linked_tables = db.tables()
|
linked_tables = db.tables()
|
||||||
if isinstance(linked_tables, dict):
|
if isinstance(linked_tables, dict):
|
||||||
linked_tables = linked_tables.get(table._tablename, [])
|
linked_tables = linked_tables.get(table._tablename, [])
|
||||||
|
|
||||||
|
opts = [OPTION(T('References')+':', _value='')]
|
||||||
|
linked = []
|
||||||
if linked_tables:
|
if linked_tables:
|
||||||
for item in linked_tables:
|
for item in linked_tables:
|
||||||
opts = [OPTION(T('References')+':', _value='')]
|
|
||||||
linked = []
|
|
||||||
tb = None
|
tb = None
|
||||||
if isinstance(item, Table) and item._tablename in check:
|
if isinstance(item, Table) and item._tablename in check:
|
||||||
tablename = item._tablename
|
tablename = item._tablename
|
||||||
@@ -2895,22 +2896,11 @@ class SQLFORM(FORM):
|
|||||||
t = T(tb._plural) if not multiple_links else \
|
t = T(tb._plural) if not multiple_links else \
|
||||||
T(tb._plural + '(' + fieldname + ')')
|
T(tb._plural + '(' + fieldname + ')')
|
||||||
args0 = tablename + '.' + fieldname
|
args0 = tablename + '.' + fieldname
|
||||||
opts.append(OPTION(t,_value=args0))
|
|
||||||
linked.append(
|
linked.append(
|
||||||
lambda row, t=t, nargs=nargs, args0=args0:
|
lambda row, t=t, nargs=nargs, args0=args0:
|
||||||
A(SPAN(t), cid=request.cid, _href=url(
|
A(SPAN(t), cid=request.cid, _href=url(
|
||||||
args=[args0, row[id_field_name]])))
|
args=[args0, row[id_field_name]])))
|
||||||
|
links += linked
|
||||||
if 0 < max_linked_inline < len(opts)-1:
|
|
||||||
links.append(
|
|
||||||
lambda row:
|
|
||||||
SELECT(opts, cid=request.cid, _rowid=row[id_field_name],
|
|
||||||
_onchange="javascript:document.location='"+url()+
|
|
||||||
"/'+this.value+'/'+this.attributes['rowid'].value"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
else: links += linked
|
|
||||||
|
|
||||||
grid = SQLFORM.grid(query, args=request.args[:nargs], links=links,
|
grid = SQLFORM.grid(query, args=request.args[:nargs], links=links,
|
||||||
links_in_grid=links_in_grid,
|
links_in_grid=links_in_grid,
|
||||||
user_signature=user_signature, **kwargs)
|
user_signature=user_signature, **kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user