You have..:

if len(request.vars):
        categoria = request.vars.values()[0]
    rubros = db(db.rubros_clasificados.id_categoria ==
categoria).select()

and truns out categoria is not an integer.


On Sep 18, 12:47 pm, Jose <[email protected]> wrote:
> Hello,
>
> Maybe it's something obvious, but can not find the problem (or
> solution). The worst thing is that it was working.
>
> Model:http://pastebin.com/m492daf9a
>
> Controler:http://pastebin.com/m79a1b876
>
> we see that:
> db.clasificados.foto.requires = IS_NULL_OR(IS_IMAGE())
>
> if I send the empty foto field, works well. However, when I upload a
> photo the next error occurs:
>
> Traceback (most recent call last):
>   File "/usr/home/jose/web2py/gluon/restricted.py", line 178, in
> restricted
>     exec ccode in environment
>   File "/usr/home/jose/web2py/applications/norterural/controllers/
> clasificados.py", line 131, in <module>
>   File "/usr/home/jose/web2py/gluon/globals.py", line 102, in <lambda>
>     self._caller = lambda f: f()
>   File "/usr/home/jose/web2py/applications/norterural/controllers/
> clasificados.py", line 101, in publicar
>     form[0].insert(0, TR("Rubro:", DIV(get_rubros(),
> _id='div_rubros'), ''))
>   File "/usr/home/jose/web2py/applications/norterural/controllers/
> clasificados.py", line 26, in get_rubros
>     rubros = db(db.rubros_clasificados.id_categoria ==
> categoria).select()
>   File "/usr/home/jose/web2py/gluon/sql.py", line 1662, in __eq__
>     return Query(self, '=', value)
>   File "/usr/home/jose/web2py/gluon/sql.py", line 2038, in __init__
>     right = sql_represent(right, left.type, left._db._dbname)
>   File "/usr/home/jose/web2py/gluon/sql.py", line 390, in
> sql_represent
>     return str(int(obj))
>   File "/usr/local/lib/python2.6/cgi.py", line 522, in __getattr__
>     raise AttributeError, name
> AttributeError: __trunc__
>
> What I find strange is that no relationship between the error that
> occurs with the foto field.
>
> Jose
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to