I am making a web service in Web2Py that takes some parameters and inserts them into a table. I get the following error while I insert data into this 1 table
Traceback (most recent call last): File "E:\Development\Python\web2py\gluon\restricted.py", line 192, in restricted exec ccode in environment File "E:/Development/Python/web2py/applications/my_app/controllers/mobi.py", line 96, in <module> File "E:\Development\Python\web2py\gluon\globals.py", line 145, in <lambda> self._caller = lambda f: f() File "E:/Development/Python/web2py/applications/my_app/controllers/mobi.py", line 81, in createwish wish_id = db.t_wish.insert(f_user_id = id, f_category_id = category_id, f_sub_category_id = sub_category_id, f_min_price = min_price, f_max_price = max_price, f_location_range = location_range, f_keywords = keywords) File "E:\Development\Python\web2py\gluon\dal.py", line 4786, in insert return self._db._adapter.insert(self,self._listify(fields)) File "E:\Development\Python\web2py\gluon\dal.py", line 838, in insert query = self._insert(table,fields) File "E:\Development\Python\web2py\gluon\dal.py", line 834, in _insert values = ','.join(self.expand(v,f.type) for f,v in fields) File "E:\Development\Python\web2py\gluon\dal.py", line 834, in <genexpr> values = ','.join(self.expand(v,f.type) for f,v in fields) File "E:\Development\Python\web2py\gluon\dal.py", line 951, in expand return self.represent(expression,field_type) File "E:\Development\Python\web2py\gluon\dal.py", line 1266, in represent obj = obj() TypeError: id() takes exactly one argument (0 given)
Model is
The code for inserting data is
#Creating a wish def createwish(): try: user_id = request.vars['id'] category_id = request.vars['category_id'] sub_category_id = request.vars['sub_category_id'] min_price = request.vars['min_price'] max_price = request.vars['max_price'] location_range = request.vars['loc_range'] keywords = request.vars['keywords'] except: raise HTTP(400, 'BAD REQUEST: Requires all params - id, category_id, sub_category_id, min_price, max_price, loc_range, keywords')
Any ideas?