Which web2py version is that?. Not sure when objects.py was fixed but the fix is there in 2.12.03 for sure.
Regards, Denes On Wednesday, January 13, 2016 at 8:49:34 AM UTC-5, Manuele wrote: > > Hi *, > I got this strange error. Where I have to look for the cuase? > The table object of my query is defined by: > > # Note: defined as class parameter > table = Table(None, table_name, > Field("uuid", unique=True, default=lambda: web2py_uuid()), > Field("service", required=True), > Field("command", required=True), > Field("args", 'json', default={}), > Field("status", default="QUEUED", > requires=IS_IN_SET(task_states)), > Field("command_output", 'json'), > Field("start_time", "datetime"), > Field("end_time", "datetime"), > Field('created_on', 'datetime', default=current.request.now), > Field('updated_on', 'datetime', update=current.request.now), > Field('created_by', 'integer'), > Field('updated_by', 'integer'), > ) > > and > > self.db.define_table(self.table_name, self.table) > > and the exception (cited below) is raides calling the method: > validate_and_update_or_insert > > --------------------------------------------------------------------------- > > AttributeError Traceback (most recent call > last) > /home/manuele/dev/portali/web2py.trunk/applications/teleservice_node/models/utils.py > > > in <module>() > ----> 1 iproot.queue_task("noproot", "test") > > /home/manuele/dev/portali/web2py.trunk/applications/teleservice_node/modules/prootdio.py > > > in queue_task(self, service, command, force_new, **args) > 301 command = command, > 302 status = "QUEUED", > --> 303 args = args > 304 ) > 305 > > /home/manuele/dev/portali/web2py.trunk/applications/teleservice_node/modules/prootdio.py > > > in wrapper(self, *args, **vars) > 94 def wrapper(self, *args, **vars): > 95 self.db[self.table_name].args.requires = [] > ---> 96 return func(self, *args, **vars) > 97 return wrapper > 98 > > /home/manuele/dev/portali/web2py.trunk/applications/teleservice_node/modules/prootdio.py > > > in __validate_and_update_or_insert(self, query, commit, **vars) > 254 res = > self.db[self.table_name].validate_and_update_or_insert( > 255 query, > --> 256 **vars > 257 ) > 258 if commit: self.db.commit() > > /home/manuele/dev/portali/web2py.trunk/gluon/dal/objects.pyc in > validate_and_update_or_insert(self, _key, **fields) > 817 response = self.validate_and_update(_key, **fields) > 818 primary_keys = {} > --> 819 for key in self._primarykey: > 820 primary_keys[key] = getattr(record, key) > 821 response.id = primary_keys > > /home/manuele/dev/portali/web2py.trunk/gluon/dal/objects.pyc in > __getitem__(self, key) > 514 return self._db(self._id == key).select(limitby=(0, > 1), orderby_on_limitby=False).first() > 515 elif key: > --> 516 return ogetattr(self, str(key)) > 517 > 518 def __call__(self, key=DEFAULT, **kwargs): > > AttributeError: 'Table' object has no attribute '_primarykey' > > > Thanks a lot > > Manuele > -- 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.