Look for... Richard
On Fri, Jul 22, 2011 at 12:03 PM, Richard Vézina < [email protected]> wrote: > Can't reproduce the problem in a simple app... Look like it come from my > update function code... What should I like for? > > Thanks > > Richard > > > On Fri, Jul 22, 2011 at 10:21 AM, Richard Vézina < > [email protected]> wrote: > >> I think that web2py determine that the field name has change : >> >> >> >> >> 4674. >> 4675. >> 4676. >> 4677. >> 4678. >> >> >> 4679. >> >> 4680. >> 4681. >> 4682. >> 4683. >> >> new_fields = [] >> >> >> new_fields_names = [] >> >> >> for name in fields: >> >> >> if not name in self.fields: >> >> >> if name != 'id': >> >> >> >> raise SyntaxError, 'Field %s does not belong to the >> table' % name >> >> >> else: >> >> >> new_fields.append((self[name],fields[name])) >> >> >> new_fields_names.append(name) >> >> >> for ofield in self: >> >> Variables builtinSyntaxError <type 'exceptions.SyntaxError'> >> name'field1_newfilename' >> >> >> field1_blob become field1_newfilename... >> >> There is a problem in the code somewhere. >> >> Richard >> >> >> On Fri, Jul 22, 2011 at 9:55 AM, Richard Vézina < >> [email protected]> wrote: >> >>> Not working... :-( >>> >>> Richard >>> >>> >>> On Fri, Jul 22, 2011 at 9:43 AM, Massimo Di Pierro < >>> [email protected]> wrote: >>> >>>> Can you please try: >>>> >>>> Field('field1','upload',uploadfield='field1_blob'), >>>> >>>> Field('field1_blob','blob',deafult='',writable=False,readable=False), >>>> >>>> this should work even if you omit the blob field. >>>> >>>> On Jul 22, 8:30 am, Richard <[email protected]> wrote: >>>> > My email won't get into my mail box... And I get no answer... So >>>> > excuse the duplication if you get it twice... >>>> > >>>> > Hello, >>>> > >>>> > I get errors on update. 2 differents errors are return depending if >>>> > the file is attach before update or at the update of the form. >>>> > >>>> > Model definition field >>>> > Field('field1','upload',uploadfield='field1_blob'), >>>> > Field('field1_blob','blob'), >>>> > >>>> > Error1 (file already attached when record was create) : >>>> > >>>> > Traceback (most recent call last): >>>> > >>>> > File "/version_197-1/web2py/gluon/restricted.py", line 192, in >>>> > restricted >>>> > >>>> > exec ccode in environment >>>> > >>>> > File "/version_197-1/web2py/applications/sgddms/controllers/ >>>> > test.py", line 1338, in <module> >>>> > >>>> > File "/version_197-1/web2py/gluon/globals.py", line 137, in <lambda> >>>> > >>>> > self._caller = lambda f: f() >>>> > >>>> > File "/version_197-1/web2py/gluon/tools.py", line 2448, in f >>>> > >>>> > return action(*a, **b) >>>> > >>>> > File "/version_197-1/web2py/applications/sgddms/controllers/ >>>> > test.py", line 465, in update >>>> > >>>> > if form.accepts(request.vars, session): >>>> > >>>> > File "/version_197-1/web2py/gluon/sqlhtml.py", line 1203, in accepts >>>> > >>>> > self.table._db(self.table._id == self.record.id).update(**fields) >>>> > >>>> > File "/version_197-1/web2py/gluon/dal.py", line 5403, in update >>>> > >>>> > fields = self.db[tablename]._listify(update_fields,update=True) >>>> > >>>> > File "/version_197-1/web2py/gluon/dal.py", line 4679, in _listify >>>> > >>>> > raise SyntaxError, 'Field %s does not belong to the table' % name >>>> > >>>> > SyntaxError: Field field1__delete does not belong to the table >>>> > >>>> > Error2 (file is attached when record was verify on a update form an >>>> > already created record) : >>>> > >>>> > Traceback (most recent call last): >>>> > >>>> > File "/version_197-1/web2py/gluon/restricted.py", line 192, in >>>> > restricted >>>> > >>>> > exec ccode in environment >>>> > >>>> > File "/version_197-1/web2py/applications/sgddms/controllers/ >>>> > test.py", line 1338, in <module> >>>> > >>>> > File "/version_197-1/web2py/gluon/globals.py", line 137, in <lambda> >>>> > >>>> > self._caller = lambda f: f() >>>> > >>>> > File "/version_197-1/web2py/gluon/tools.py", line 2448, in f >>>> > >>>> > return action(*a, **b) >>>> > >>>> > File "/version_197-1/web2py/applications/sgddms/controllers/ >>>> > test.py", line 465, in update >>>> > >>>> > if form.accepts(request.vars, session): >>>> > >>>> > File "/version_197-1/web2py/gluon/sqlhtml.py", line 1203, in accepts >>>> > >>>> > self.table._db(self.table._id == self.record.id).update(**fields) >>>> > >>>> > File "/version_197-1/web2py/gluon/dal.py", line 5403, in update >>>> > >>>> > fields = self.db[tablename]._listify(update_fields,update=True) >>>> > >>>> > File "/version_197-1/web2py/gluon/dal.py", line 4679, in _listify >>>> > >>>> > raise SyntaxError, 'Field %s does not belong to the table' % name >>>> > >>>> > SyntaxError: Field field1_newfilename does not belong to the table >>>> > >>>> > Is there something to change with the model definition for attachement >>>> > with 1.97.1 or is it a issue? >>>> > >>>> > Thanks >>>> > >>>> > Richard >>>> >>> >>> >> >

