where to change the sql.py??
thanks
On Feb 11, 4:35 am, Kacper Krupa <pageno...@gmail.com> wrote:
> AFAIK you can replace double exception to:
> except (ValueError,TypeError):
> ...
>
> On 10 Lut, 15:29, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
>
>
> > Try replace in sql.py
>
> > def is_integer(x):
> > try:
> > long(x)
> > except ValueError:
> > return False
> > return True
>
> > with
>
> > def is_integer(x):
> > try:
> > long(x)
> > except ValueError:
> > return False
> > exceptTypeError:
> > return False
> > return True
>
> > Massimo
>
> > On Feb 10, 1:01 am, INeedHelp <zhang.kil...@gmail.com> wrote:
>
> > > sorry. should be this one
>
> > > Traceback (most recent call last): File "/Users/mdipierro/web2py/
> > > gluon/restricted.py", line 98, in restricted File "C:/Documents and
> > > Settings/__/Desktop/web2py_win/web2py/applications/cynoteDup/
> > > controllers/rep.py", line 31, in <module> File "/Users/mdipierro/
> > > web2py/gluon/globals.py", line 74, in <lambda> File "C:/Documents and
> > > Settings/__/Desktop/web2py_win/web2py/applications/cynoteDup/
> > > controllers/rep.py", line 18, in import_sync File "/Users/mdipierro/
> > > web2py/gluon/sql.py", line 850, in import_from_csv_file File "/Users/
> > > mdipierro/web2py/gluon/sql.py", line 1318, in import_from_csv_file
> > > File "/Users/mdipierro/web2py/gluon/sql.py", line 968, in __getitem__
> > > File "/Users/mdipierro/web2py/gluon/sql.py", line 914, in
> > > is_integerTypeError: long() argument must be astringor a number, not
> > > 'list'
>
> > > On Feb 10, 3:00 pm, INeedHelp <zhang.kil...@gmail.com> wrote:
>
> > > > Traceback (most recent call last): File "/Users/mdipierro/web2py/
> > > > gluon/restricted.py", line 98, in restricted File "C:/Documents and
> > > > Settings/__/Desktop/web2py_win/web2py/applications/cynoteDup/
> > > > controllers/zip.py", line 24, in <module> File "/Users/mdipierro/
> > > > web2py/gluon/globals.py", line 74, in <lambda> File "C:/Documents and
> > > > Settings/__/Desktop/web2py_win/web2py/applications/cynoteDup/
> > > > controllers/zip.py", line 10, in zipTypeError:coercingtoUnicode:
> > > >needstringorbuffer,listfound
>
> > > > On Feb 10, 2:39 pm, INeedHelp <zhang.kil...@gmail.com> wrote:
>
> > > > > what do you mean?
>
> > > > > On Feb 10, 1:58 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > > Do you have the traceback from the ticket?
>
> > > > > > Massimo
>
> > > > > > On Feb 9, 11:51 pm, INeedHelp <zhang.kil...@gmail.com> wrote:
>
> > > > > > > def import_file():
> > > > > > > form=FORM(INPUT(_type='file',_name='data'),INPUT
> > > > > > > (_type='submit'))
> > > > > > > if form.accepts(request.vars):
> > > > > > > db.import_from_csv_file(form.vars.data.file)
> > > > > > > # for every table
> > > > > > > for table in db.tables: # for every uuid,
> > > > > > > delete
> > > > > > > all but the most
> > > > > > > items = db(db[table].id>0).select(db[table].id,
> > > > > > > db[table].uuid,orderby=~db[table].modified_on,
> > > > > > > groupby=db[table].uuid)
> > > > > > > for item in items:
> > > > > > > db((db[table].uuid==item.uuid)&(db[table].id!=
> > > > > > > item.id)).delete
> > > > > > > return dict(form=form)
>
> > > > > > > with error:
> > > > > > >TypeError: long() argument must be astringor a number, not 'list'-
> > > > > > >Hide quoted text -
>
> > > > > > - Show quoted text -- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---