Merge pull request #1692 from timnyborg/master
Fix #1691: Passing tables to SQLFORM.factory() fails
This commit is contained in:
+4
-2
@@ -1919,8 +1919,10 @@ class SQLFORM(FORM):
|
|||||||
if 'table_name' in attributes:
|
if 'table_name' in attributes:
|
||||||
del attributes['table_name']
|
del attributes['table_name']
|
||||||
|
|
||||||
return SQLFORM(DAL(None).define_table(table_name, *[field.clone() for field in fields]),
|
# Clone fields, while passing tables straight through
|
||||||
**attributes)
|
fields_with_clones = [f.clone() if isinstance(f, Field) else f for f in fields]
|
||||||
|
|
||||||
|
return SQLFORM(DAL(None).define_table(table_name, *fields_with_clones), **attributes)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def build_query(fields, keywords):
|
def build_query(fields, keywords):
|
||||||
|
|||||||
Reference in New Issue
Block a user