Those errors are fine. request.vars.id is a Reference field to the
newly created record. It can be converted to int and treated as a int
but it is not a int. response.flash should be a string or a helper. If
you pass a Reference without converting to int, it will cause the
problems below.
The trigger must be creating some problem. It may be it interferes
with the machanism used by web2py to get the id of the last inserted
record.

On Jun 27, 7:25 am, Jose <jjac...@gmail.com> wrote:
> On 27 jun, 06:23, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > web2py does not generate those numbers, the database does. Check what
> > is in record 263227
>
> Thank Massimo
>
> Yes, I know. But if I look from the database administrator of web2py,
> the IDs are correct.
>
> Let's see if the following helps.
>
> I tried another table and works well.
>
> If I change the code:
> response.flash = int (form.vars.id)
> by:
> response.flash = form.vars.id
>
> The following error occurs:
>
> Traceback (most recent call last):
>   File "/usr/home/web2py/gluon/restricted.py", line 178, in restricted
>     exec ccode in environment
>   File "/usr/home/web2py/applications/agprueba/views/expedientes/
> subirdocumento.html", line 38, in <module>
>   File "/usr/home/web2py/gluon/globals.py", line 105, in write
>     self.body.write(xmlescape(data))
>   File "/usr/home/web2py/gluon/html.py", line 104, in xmlescape
>     return data.xml()
>   File "/usr/home/web2py/gluon/sql.py", line 1467, in __getattr__
>     self.__allocate()
>   File "/usr/home/web2py/gluon/sql.py", line 1462, in __allocate
>     raise Exception, "undefined record"
> Exception: undefined record
>
> If I change it by:
> response.flash = type(form.vars.id)
> return
> <class 'gluon.sql.Reference'>
>
> The only change made to the table that gives the problem is that it
> triggers have been defined, but this should not affect anything.
> Anyway I will check with the administrator.
>
> Jose

Reply via email to