Did this issue get solved im facing it too
On Monday, September 5, 2011 at 11:47:01 AM UTC+2, brushek wrote:
>
> Hello,
>
> I have following table with custom type (database: postgres):
> from gluon.sql import SQLCustomType
> inet = SQLCustomType ( type='string', native='inet', encoder=lambda x:
> repr(str(x)))
> db.define_table("serwery",
> Field("id_klienci",db.klienci),
> Field("ip_serwera",type=inet,requires = IS_IPV4()))
>
> When I try to use SQLFORM.grid, like this:
>
> @auth.requires_login()
> def dodajserwer():
> response.flash = T('Serwery')
> form=SQLFORM.grid(db.serwery)
>
> if form.accepts(request.vars, session):
> response.flash='Serwer dodany'
> elif form.errors:
> response.flash = 'popraw'
>
> return dict(form=form)
>
> I get following error:
> Traceback (most recent call last):
> File "/home/users/brushek/web2py/gluon/restricted.py", line 194, in
> restricted
> exec ccode in environment
> File "/home/users/brushek/web2py/applications/welcome/controllers/
> default.py", line 138, in <module>
> File "/home/users/brushek/web2py/gluon/globals.py", line 145, in
> <lambda>
> self._caller = lambda f: f()
> File "/home/users/brushek/web2py/gluon/tools.py", line 2510, in f
> return action(*a, **b)
> File "/home/users/brushek/web2py/applications/welcome/controllers/
> default.py", line 60, in dodajserwer
> form=SQLFORM.grid(db.serwery)
> File "/home/users/brushek/web2py/gluon/sqlhtml.py", line 1430, in
> grid
> T = current.T
> TypeError: reduce() of empty sequence with no initial value
>
> Where can be problem ?
>
> regards
> brushek
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.