python - Odoo - How to acess recordsets on web controller -


i using web controller in odoo 8 make rest api data , return values database. problem not able database builtin orm.
tried call osv.pool.get() gave me error:

attributeerror: type object 'model' has no attribute 'pool'

odoo 8 apparently uses recordsets, can't use too, , couldn't find usefull on docs.

how can browse database data on web controller?

my code:

class testwebservice(http.controller):     @http.route('/test', type='http', auth='none')     def test(self):        objects = osv.osv.pool.get("some_table")        # need objects some_table , search them        return "hello world" 

try following

myobj = request.env['some.table'] 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -