#87 0.6.1: _fromDatabase and UNIQUE should result in alternateID

open
nobody
General (126)
5
2013-01-18
2005-05-25
jared jennings
No

I've got a table which has a UNIQUE column:
CREATE TABLE groups (
id serial PRIMARY KEY,
name varchar(256) UNIQUE
);

When I make it into a class, like so:
class Groups(SQLObject):
_fromDatabase = True

Given that the name column is unique, it's useful and
possible to have the byName method be created, which,
in the absence of _fromDatabase, is done when a Col's
constructor has keyword argument alternateID.

Attached is a patch that does this for PostgreSQL.

Discussion

  • jared jennings
    jared jennings
    2005-05-25

    Automatic alternateID creation for PostgreSQL