better logic in appadmin csv, thanks Paolo Betti

This commit is contained in:
mdipierro
2012-08-19 10:12:31 -05:00
parent c9360194c0
commit cb0ccd5f3b
4 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-08-19 10:03:24) dev
Version 2.00.0 (2012-08-19 10:12:29) dev
+4 -3
View File
@@ -222,14 +222,15 @@ def select():
(rows, nrows) = ([], 0)
response.flash = DIV(T('Invalid Query'),PRE(str(e)))
# begin handle upload csv
if table:
csv_table = table or request.vars.table
if csv_table:
formcsv = FORM(str(T('or import from csv file'))+" ",
INPUT(_type='file',_name='csvfile'),
INPUT(_type='hidden',_value=table,_name='table'),
INPUT(_type='hidden',_value=csv_table,_name='table'),
INPUT(_type='submit',_value=T('import')))
else:
formcsv = None
if formcsv and formcsv.process().accepted and request.vars.csvfile:
if formcsv and formcsv.process().accepted:
try:
import_csv(db[request.vars.table],
request.vars.csvfile.file)
@@ -222,14 +222,15 @@ def select():
(rows, nrows) = ([], 0)
response.flash = DIV(T('Invalid Query'),PRE(str(e)))
# begin handle upload csv
if table:
csv_table = table or request.vars.table
if csv_table:
formcsv = FORM(str(T('or import from csv file'))+" ",
INPUT(_type='file',_name='csvfile'),
INPUT(_type='hidden',_value=table,_name='table'),
INPUT(_type='hidden',_value=csv_table,_name='table'),
INPUT(_type='submit',_value=T('import')))
else:
formcsv = None
if formcsv and formcsv.process().accepted and request.vars.csvfile:
if formcsv and formcsv.process().accepted:
try:
import_csv(db[request.vars.table],
request.vars.csvfile.file)
+4 -3
View File
@@ -222,14 +222,15 @@ def select():
(rows, nrows) = ([], 0)
response.flash = DIV(T('Invalid Query'),PRE(str(e)))
# begin handle upload csv
if table:
csv_table = table or request.vars.table
if csv_table:
formcsv = FORM(str(T('or import from csv file'))+" ",
INPUT(_type='file',_name='csvfile'),
INPUT(_type='hidden',_value=table,_name='table'),
INPUT(_type='hidden',_value=csv_table,_name='table'),
INPUT(_type='submit',_value=T('import')))
else:
formcsv = None
if formcsv and formcsv.process().accepted and request.vars.csvfile:
if formcsv and formcsv.process().accepted:
try:
import_csv(db[request.vars.table],
request.vars.csvfile.file)