I try:

*- virtual fields in grid*

My model:

db.define_table("test",
                Field("person","integer"),
                #Field.Virtual("doublep", lambda r: r.person*2),
                )


My function:

def index():
   return dict(grid=SQLFORM.grid(db.test.id>0))


No problem without the virtual field.

With the virtual field I get an error - what is wrong?

Error ticket for "gridtest4"Ticket ID

127.0.0.1.2013-12-10.10-35-17.a9bd4da1-9432-4778-8711-33307e8f0503
<type 'exceptions.AttributeError'> 'Row' object has no attribute 'doublep'
Version web2py™Version 2.8.2-stable+timestamp.2013.11.28.13.54.07 Traceback


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.


Traceback (most recent call last):
  File "H:\web2py\gluon\restricted.py", line 217, in restricted

    exec ccode in environment
  File "H:/web2py/applications/gridtest4/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/gridtest4/controllers/default.py>,
line 70, in <module>

  File "H:\web2py\gluon\globals.py", line 372, in <lambda>

    self._caller = lambda f: f()

  File "H:/web2py/applications/gridtest4/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/gridtest4/controllers/default.py>,
line 14, in index

    return dict(grid=SQLFORM.grid(db.test.id>0))

  File "H:\web2py\gluon\sqlhtml.py", line 2446, in grid

    value = row[str(field)]
  File "H:\web2py\gluon\dal.py", line 7267, in __getitem__

    raise ae
AttributeError: 'Row' object has no attribute 'doublep'


Regards, Martin


2013/12/3 Dave S <snidely....@gmail.com>

> On Monday, December 2, 2013 10:24:57 PM UTC-8, Massimo Di Pierro wrote:
>>
>> Please open a ticket about this. We can do it.
>>
>>
> Done.
> <http://code.google.com/p/web2py/issues/detail?id=1798>
>
>
>
>> On Monday, 2 December 2013 22:02:10 UTC-6, Dave S wrote:
>>>
>>> On Wednesday, November 27, 2013 12:31:05 PM UTC-8, Massimo Di Pierro
>>> wrote:
>>>>
>>>> Changelog
>>>>
>>>>
>>>> - no more winservice (use nssm instead)
>>>> - better imap support in DAL
>>>> - db().select().as_tree()
>>>> - bootstrap 2.3.2
>>>> - codemirror 3.19
>>>> - virtual fields in grid
>>>> - improved  mongoDB support, thanks Alan
>>>> - support for wiki custom render function
>>>> - Wiki(...groups=['x','y']) allows bypassing default permissions
>>>> - fixed websocket_messaging.py to support newer Tornado
>>>> - NDB support for GAE, thanks Quint
>>>> - fixed major concurrecy issue with MEMDB
>>>> - blocked generic.jsonp for security reasons
>>>> - many bug fixes, thanks Niphlod, Michele, Anthony, Tim, and many
>>>> others.
>>>>
>>>
>>>
>>> Upgrade from 2.7.2 via button went pretty well, but I had read the posts
>>> about clearing sessions.
>>>
>>> Suggestions for the upgrade button:
>>>   +   In addition to the flash message to restart the server, the
>>> update/upgrade button could maybe turn into a "restart  server" button
>>>   +  Change the background color of the flash to RED, at least if
>>> default css is used (almost didn't see the flash msg)
>>>   +  Display a checklist (tied to the release notes) of things to do
>>> between server shutdown and server restart;
>>>       such as clearing sessions
>>>       (and since it will take a while for all the pre-2.6.1 servers to
>>> be upgraded, detect the older server and  show the 2.6.1 checklist)
>>>
>>> So far so good with my simple setup, though
>>> (creaky old Fedora 16 in a VMware Player, W2P+Rocket in a Terminal
>>> window with Bash, clients all on local net, SOAP and simple grids)
>>> (no clients were harmed in this upgrade)
>>>
>>> /dps
>>>
>>>
>>>  --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to