Switch to using a different db cursor type for full-row lookups

The only user of full-row database lookups is the admin interface,
dumping information from various tables.

Using the default cursor type of NamedTupleCursor is fine when we're
returning one or two items, but is rubbish when we're grabbing an
entire row. On the other side of the IPC layer, the names in the named
tuple are lost and we have to track fields by hand using just
positional logic.

Instead, add a second cursor using RealDictCursor for full-row
lookups. That passes through the IPC layer cleanly and we can refer to
the dict entries by name which is much cleaner.

Change-Id: I6076d4d75dd657e804320f77e0d9ac0cc9aae9ba
2 files changed