I believe the argument to Field.Virtual and Field.Lazy just needs to be a
callable object that takes a Row object as an argument, so you could write
a function and then pass that function.
def myfield(row):
[code to generate field value from row object]
return value
db.mytable.myvirtualfield = Field.Lazy(myfield)
Anthony
On Thursday, May 3, 2012 11:32:34 AM UTC-4, Marcello wrote:
>
> Hello,
>
> I need to implement a lazy field, that should have some lines of code,
> with some conditions...
> The new style example in the book, just have simple calculation fields...
>
> Can someone point me some example on it's syntax ??
>
> I could make it with the old way, but would like to do with new style...
>
>
> Thanks
> Marcello
>