OK, I finally got it to work.
Use
db(db.table.id>0).select().as_list()
OR perform an Object update instead
rows.__dict__.update(r)
If there are better (or more correct/faster ways) to perform this behavior,
I welcome your guidance and feedback. Thanks!
On Tuesday, August 21, 2012 11:26:18 P
To clarify my abve post,
I am using this code, and it fails without a ticket:
def myfunc():
rows = db(db.table.id>0).select()
dummy = []
for r in rows:
if some_condition:
r.item=False
dummy.append(r)
else:
dummy.append(r)
return dummy
And I get a not serializable
I have just grabbed a copy of trunk about 12 hours ago. I have just grabbed
it again 5 mins ago.
Now it won't even let me access the page? I'm quite confused. It doesn't
even generate a ticket...
On Safari it says the operation cannot be completed.
On Tuesday, August 21, 2012 10:54:46 PM UTC+8,
Make sure you have the latest trunk.
On Tuesday, 21 August 2012 09:37:56 UTC-5, lyn2py wrote:
>
> When I perform:
>
> rows = db(db.table.id>0).select()
> return rows
>
> It is OK
>
> But when I perform:
> rows = db(db.table.id>0).select()
> dummy = []
> for r in rows:
> if some_condition:
>
I must add that the below code are working when as a normal function
that means
def myfunc():
rows = db(db.table.id>0).select()
dummy = []
for r in rows:
if some_condition:
r.item=False
dummy.append(r)
else:
dummy.append(r)
return dummy
is OK
But
@service.json
def
5 matches
Mail list logo