To follow-up, switching from Sqlite to Postgresql gets this similar
error, which I believe comes from dal (MATERIAU should be without
"()"):

Traceback (most recent call last):
  File "C:\Users\Andre\Documents\web2py\gluon\restricted.py", line
188, in restricted
    exec ccode in environment
  File "C:/Users/Andre/Documents/web2py/applications/soltrans/
controllers/default.py", line 89, in <module>
  File "C:\Users\Andre\Documents\web2py\gluon\globals.py", line 95, in
<lambda>
    self._caller = lambda f: f()
  File "C:\Users\Andre\Documents\web2py\gluon\tools.py", line 2332, in
f
    return action(*a, **b)
  File "C:/Users/Andre/Documents/web2py/applications/soltrans/
controllers/default.py", line 75, in ntransport
    id = db.Materiau.insert(**db.Materiau._filter_fields(form.vars))
  File "C:\Users\Andre\Documents\web2py\gluon\dal.py", line 3885, in
insert
    return self._db._adapter.insert(self,self._listify(fields))
  File "C:\Users\Andre\Documents\web2py\gluon\dal.py", line 704, in
insert
    raise e
ProgrammingError: ERREUR:  erreur de syntaxe sur ou près de « ) »
LINE 1: INSERT INTO Materiau() VALUES ();


On 6 jan, 16:56, dederocks <[email protected]> wrote:
> I have a field with the 'list:reference xxx' type. Using it gets the
> following error (I think):
>
> Traceback (most recent call last):
>   File "C:\Users\Andre\Documents\web2py\gluon\restricted.py", line
> 188, in restricted
>     exec ccode in environment
>   File "C:/Users/Andre/Documents/web2py/applications/soltrans/
> controllers/default.py", line 89, in <module>
>   File "C:\Users\Andre\Documents\web2py\gluon\globals.py", line 95, in
> <lambda>
>     self._caller = lambda f: f()
>   File "C:\Users\Andre\Documents\web2py\gluon\tools.py", line 2332, in
> f
>     return action(*a, **b)
>   File "C:/Users/Andre/Documents/web2py/applications/soltrans/
> controllers/default.py", line 75, in ntransport
>     id = db.Materiau.insert(**db.Materiau._filter_fields(form.vars))
>   File "C:\Users\Andre\Documents\web2py\gluon\dal.py", line 3885, in
> insert
>     return self._db._adapter.insert(self,self._listify(fields))
>   File "C:\Users\Andre\Documents\web2py\gluon\dal.py", line 704, in
> insert
>     raise e
> OperationalError: near ")": syntax error
>
> And in the form generated by SQLFORM, it is possible to select
> multiple entries: is this expected?
>
> For information, here is the DB model:
>
> db.define_table('Lieu',Field('Nom', label="Lieu de stockage",
> requires=IS_NOT_EMPTY()), format='%(Nom)s')
>
> db.define_table('Materiau',Field('Type','list:string'),Field('Nom'))
> db.Materiau.Type.requires=IS_IN_SET(('Tête','Armoire','Chassis'))
>
> db.define_table('Transport',
>     Field('Date','datetime', default=request.now, readable=False,
> writable=False),
>     Field('Transporteur', db.auth_user, default=auth.user_id,
> readable=False, writable=False),
>     Field('Objet',db.Materiau),
>     Field('DateChargement','datetime', default=request.now,
> label='Date de prise en charge'),
>     Field('Source','list:reference Lieu', label='Lieu de prise en
> charge'),
>     Field('Destination','list:reference Lieu', label='Lieu de
> livraison'),
>     Field('DateLivraison','datetime', label='Date de livraison'),)
>
> Best regards,
>
> Andre

Reply via email to