Hi Jeff,

I believe you need web2py 2.3.1 or higher for that.



On Monday, December 24, 2012 1:36:25 AM UTC-5, Jeff Kusi wrote:
>
> I am attempting to use the virtual Methods of the dal but I am running 
> into this issue. Here's my code
> db.define_table('Posts',
>                 db.Field('zipcode'),
>                 db.Field.Method('distance',lambda row, loc_zip=33333:abs(
> row.zipcode-loc_zip))
>                 )
>
>
> But I am running into the following error:
> "AttributeError: type object 'Field' has no attribute 'Method'"
> I am running  
> web2py™(2, 2, 1, datetime.datetime(2012, 10, 21, 16, 57, 4), 'stable')
> PythonPython 2.7.3: /home/yolo/python
> Am I doing something wrong?  I looked into the web2py code and all I saw 
> the FieldVirtual method definitions( not Field.Virtual as described in the 
> book). 
> Am I using the wrong version?  Any help would be appreciated.
>
> thanks.
>

-- 



Reply via email to