This was posted awhile ago but in case anyone else runs into this, the
problem is the cities and categories fields have both the same name 'name'.
The AutocompleteWidget *keyword* property gets set to the same value. The
solution is to provide distinct *keyword* arguments.
Field('city',
widget=SQLFORM.widgets.autocomplete(request,
db.cities.name,
id_field=db.cities.id,
keyword='_autocomplete_cities_%(fieldname)s')),
Field('category',
widget=SQLFORM.widgets.autocomplete(request,
db.categories.name <http://db.cities.name/>,
id_field=db.categories.id <http://db.cities.id/>,
keyword='_autocomplete_categories_%(fieldname)s')),
I wonder if the default keyword argument should include the table name.
keyword = '_autocomplete_%(tablename)s_%(fieldname)s'
self.keyword = keyword % dict(tablename=field.tablename,
fieldname=field.name)