for row in news:
    db.news_temp.insert(**db.news_temp._filter_fields(row))

Anthony

On Thursday, March 10, 2016 at 5:37:36 AM UTC-5, Yibing Liu wrote:
>
> Hello everyone, I have an existing table named db.news. I want to insert 
> multiple rows which are selected from the existing db.news to another 
> table. My code is like following:
> news=db(db.news.id>=0).select(orderby=~db.news.release_time)[0:15]
> db.news_temp.truncate()
> db.news_temp.insert(news)
> This raise an error and I can't find any other solution but looping the 
> db.news.insert(somefileds=news.field). Could someone give some help?
>
>

-- 
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/d/optout.

Reply via email to