somewhere you have a recursive select like

row.fieldrefencingtable.fieldofreferencestable

but the value of row.fieldrefencingtable points to a record that does
not exist.

On Sep 6, 6:38 pm, Miguel <goncalvesmig...@gmail.com> wrote:
> Hi
>
> On web2py, version 1.83.2 (2010-08-15 08:16:30) , I have the following
> table:
>
> db.define_table("products",
>     Field("categoryID", db.productCategory, writable=False,
> readable=False, requires=IS_IN_DB(db, "productCategory.id",
> "productCategory.name") ), # reference field
>     Field("RRRating", 'integer', default='0',writable=False,
> readable=False),
>     Field("productName", 'string',length=512,  default=None),
>     Field("author", 'string',length=512,  default=None),
>     Field("productShortDescription", 'text', length=2048,
> default=None),
>     Field("productLongDescription", 'text', default=None),
>     Field("urlProduct", 'string', length=2048, default=None,
> requires=IS_URL() ),
>     Field("urlImageBig", 'string', length=2048, default=None,
> requires=IS_URL()),
>     Field("urlImageSmall", 'string', length=2048, default=None,
> requires=IS_URL()),
>     Field("price", 'double',  default=0),
>     Field("updateDate", 'datetime')
>     )
>
> When the database is empty I can see it in the admin page and add
> products to it
> However when I fill it with data (obtained from rss feeds) and go the
> the admin page to look at the table contents I get the following
> error:
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 186, in restricted
>     exec ccode in environment
>   File "C:/web2py/applications/reviewround/views/appadmin.html", line
> 160, in <module>
>     <strong>{{="%02d" % ram['oldest'][0]}}</strong> hours
>   File "C:\web2py\gluon\globals.py", line 105, in write
>     self.body.write(xmlescape(data))
>   File "C:\web2py\gluon\html.py", line 106, in xmlescape
>     return data.xml()
>   File "C:\web2py\gluon\html.py", line 589, in xml
>     (fa, co) = self._xml()
>   File "C:\web2py\gluon\html.py", line 580, in _xml
>     self.components])
>   File "C:\web2py\gluon\html.py", line 106, in xmlescape
>     return data.xml()
>   File "C:\web2py\gluon\html.py", line 589, in xml
>     (fa, co) = self._xml()
>   File "C:\web2py\gluon\html.py", line 580, in _xml
>     self.components])
>   File "C:\web2py\gluon\html.py", line 106, in xmlescape
>     return data.xml()
>   File "C:\web2py\gluon\html.py", line 589, in xml
>     (fa, co) = self._xml()
>   File "C:\web2py\gluon\html.py", line 580, in _xml
>     self.components])
>   File "C:\web2py\gluon\html.py", line 106, in xmlescape
>     return data.xml()
>   File "C:\web2py\gluon\html.py", line 589, in xml
>     (fa, co) = self._xml()
>   File "C:\web2py\gluon\html.py", line 580, in _xml
>     self.components])
>   File "C:\web2py\gluon\html.py", line 106, in xmlescape
>     return data.xml()
>   File "C:\web2py\gluon\html.py", line 1065, in xml
>     return DIV.xml(self)
>   File "C:\web2py\gluon\html.py", line 589, in xml
>     (fa, co) = self._xml()
>   File "C:\web2py\gluon\html.py", line 580, in _xml
>     self.components])
>   File "C:\web2py\gluon\html.py", line 106, in xmlescape
>     return data.xml()
>   File "C:\web2py\gluon\sql.py", line 1517, in __getattr__
>     self.__allocate()
>   File "C:\web2py\gluon\sql.py", line 1512, in __allocate
>     raise Exception, "undefined record"
> Exception: undefined record
>
> I made sure that I sanitize the different fields when I add to this
> table:
>
> db.products.insert(productName=None if data['name'] == None else
> sanitize(data['name']),
>                        productShortDescription=None if
> data['summary']==None else sanitize(data['summary']),
>                        productLongDescription=None if
> data['content']==None else sanitize(data['content']),
>                        urlProduct=None if data['link']==None else
> sanitize(data['link']),
>                        urlImageBig=None if data['imgPreviewUrl']==None
> else sanitize(data['imgPreviewUrl']),
>                        urlImageSmall= None if
> data['imgPreviewUrl75']==None else sanitize(data['imgPreviewUrl75']),
>                        price=data['price'],
>                        author=None if data['artist']==None else
> sanitize(data['artist']),
>                        updateDate=
> data['updateDate'],
>                        categoryID=63)
>
> Any idea of what is going wrong?
>
> thanks
> -Miguel

Reply via email to