It prints:

INSERT INTO
user_jogo(user,jogo,versao_jogo,disponivel_troca,condicao,comentario,valor,troco_por,status,avaliacao_vendedor,avaliacao_comprador,date_on)
VALUES (2,1,'Asia','T','Novo','sdaskjdklsajdkas ljklasj dklsajdlksajkldjsakl
j',80,,'Aberto','Positiva','Positiva','2010-12-18 11:14:12');


This problem just happens if I do not select any value on the list:reference
field... If I select one or more items it works...

Thanks,

Tito

On Sat, Dec 18, 2010 at 4:15 AM, mdipierro <mdipie...@cs.depaul.edu> wrote:

> before
>
> db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))
>
> please add
>
> print db.user_jogo._insert(**db.user_jogo._filter_fields(form.vars))
>
> What does it print when the problem occurs?
>
> On Dec 17, 11:14 pm, Bruno Rocha <rochacbr...@gmail.com> wrote:
> > I ran with the same issue with the new dal.
> >
> > https://groups.google.com/forum/#!topic/web2py-developers/RU5yUhu_2pU<https://groups.google.com/forum/#%21topic/web2py-developers/RU5yUhu_2pU>
> >
> > Jus to to remember:
> > Also Virtual fields:
> https://groups.google.com/forum/#!topic/web2py-developers/IPoWmlKoFOQ<https://groups.google.com/forum/#%21topic/web2py-developers/IPoWmlKoFOQ>
> > And the load charts on applet:
> https://groups.google.com/forum/#!topic/web2py-developers/eOW2wktnlsQ<https://groups.google.com/forum/#%21topic/web2py-developers/eOW2wktnlsQ>
> >
> > 2010/12/18 Tito Garrido <titogarr...@gmail.com>
> >
> >
> >
> > > When I try to create record that has an list:reference field I'm
> getting
> > > the following error:
> >
> > > MODEL:
> > > Field('troco_por', 'list:reference jogo', label='Troco por qualquer um
> > > destes jogos', comment='Use a tecla Ctrl para selecionar mais de um
> jogo'),
> >
> > > CONTROLLER:
> > > db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))
> >
> > >  File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/controllers/default.py"
> <http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py>,
> line 103, in meus_jogos
> >
> > >     form.vars.id =
> db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))
> >
> > >   File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py",
> line 3750, in insert
> >
> > >     return self._db._adapter.insert(self,self._listify(fields))
> >
> > >   File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py",
> line 701, in insert
> >
> > >     raise e
> > > OperationalError: near ",": syntax error
> >
> > > And when I try to update:
> >
> > > db(db.user_jogo.id
> > > ==anuncio_id).update(**db.user_jogo._filter_fields(form.vars))
> >
> > > It raises an error:
> > >   File
> > >
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/controllers/default.py",
> > > line 127, in anunciar
> > >     form.vars.id = db(db.user_jogo.id
> > > ==anuncio_id).update(**db.user_jogo._filter_fields(form.vars))
> > >   File
> > >
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py",
> > > line 4389, in update
> > >     return self.db._adapter.update(tablename,self.query,fields)
> > >   File
> > >
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py",
> > > line 848, in update
> > >     self.execute(sql)
> > >   File
> > >
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py",
> > > line 1055, in execute
> > >     return self.log_execute(*a, **b)
> > >   File
> > >
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py",
> > > line 1052, in log_execute
> > >     return self.cursor.execute(*a,**b)
> > > OperationalError: near "WHERE": syntax error
> >
> > > It was working before I update web2py... so probably something wrong on
> new
> > > dal?
> >
> > > Regards,
> >
> > > Tito
> >
> > > --
> >
> > > Linux User #387870
> > > .........____
> > > .... _/_õ|__|
> > > ..º[ .-.___.-._| . . . .
> > > .__( o)__( o).:_______
> >
> > --
> >
> > Bruno Rochahttp://about.me/rochacbruno/bio
>



-- 

Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______

Reply via email to