On Aug 4, 3:02 pm, Jose <jjac...@gmail.com> wrote:

I also found the current code still broken, despite my patch to revert
that issue being included.

> This code works well:
>            elif field.type == 'upload':
>                 f = self.vars[fieldname]
>                 fd = fieldname + '__delete'
>                 if f == '':
>                     if self.vars.get(fd, False) or not self.record:
>                         fields[fieldname] = ''
>                     else:
>                         fields[fieldname] = self.record[fieldname]
>                     continue
>                 elif not isinstance(f, (str, unicode)):
>                     (source_file, original_filename) = (f.file,
> f.filename)
>                 else:
>                     ### do not know why this happens, it should not
>                     (source_file, original_filename) = \
>                         (cStringIO.StringIO(f), 'file.txt')
>                 logging.warn('here')
>                 fields[fieldname] = field.store(source_file,
> original_filename)
>                 logging.warn('there')
>                 if field.uploadfield and not field.uploadfield==True:
>                     fields[field.uploadfield] = source_file.read()
>                 continue

Can you send it as a diff?

Copy original sqlhtml.py to sqlhtml.py.orig
Make your changes to sqlhtml.py
Then run:
diff -u gluon\sqlhtml.py.orig gluon\sqlhtml.py > sqlhtml.patch

F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to