Re: [SQLObject] fetch instance using column other than ID
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Luke O. <lu...@me...> - 2004-03-11 16:18:16
|
Sounds like you might be looking for the alternateID=True argument for columns:
email = StringCol(alternateID=True)
will add an access method to Person so that:
user = Person.byEmail('ab...@xy...')
will work.
- Luke
Quoting charles brandt <li...@st...>:
> user = Person.select(Person.q.email=="ab...@xy...", connection=req.conn)[0]
>
> but that seems rather unintuitive compared to Person(10) (or Person.get(10)
> now).
|