Hi folks,

At some point between 1.94 and 1.96, the DAL seems to have lost the
(presumably supported) ability to select all entries from a keyed
table. Consider the following test:

db = DAL(None)
db.define_table('mytable',
  Field('foo'),
  Field('bar'),
  primarykey=['foo'])

db(db.mytable).select()

In 1.94.3 this returns a Rows object (and when you set up something
similar on a real database, it issues the correct query and returns
sensible results.)

In 1.96.3 the expression db(db.mytable) throws a KeyError on _id (line
4570).

It looks like 1.94.3 would just assign fields[0] as Table._id if no
other id was explicitly listed in your Field list. Evidently 1.96.3
doesn't assign anything to _id when the id is only specified via
primarykey=

Perhaps someone who understands the recent changes to the DAL knows
the best way to address this? If desired, I can take a closer look at
it and suggest a patch.

Cheers,
Kevin

Reply via email to