[SQLObject] select distinct; unique composite columns
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: David M. C. <da...@da...> - 2003-12-27 18:13:47
|
* Is it possible to do a select distinct? I want to do something like
Person.select(Address.q.personID=Person.q.id, distinct=1)
(I guess I could just do:
people_with_adresses = [p for p in Person.select() if p.addresses]
Gotta stop thinking "relationally"...
* Is there a way to set a unique constraint on multiple columns (with
autogeneration?) Something like:
class Person(SQLOBject):
lastName = StringCol()
firstName = StringCol()
UNIQUE('lastName', 'firstName')
* How do I access the dbapi Exception classes? Right now I do an
import sqlite as dbapi
to access them, but is there a way do dig down into the connection object
to get them?
Thanks,
Dave Cook
|