Re: [SQLObject] alternateMethodName and creating SQL
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2003-03-13 04:18:45
|
On Wed, 2003-03-12 at 15:22, Luke Opperman wrote: > Of course, maybe part of the reason this hasn't been implemented yet is because > the semantics are more difficult that the implementation: What does the user > expect if there are really more than one returned by that query? What if there > are none? If alternateID is set in the Column, is it SQLObject's responsibility > to enforce uniqueness? It's a little fuzzy. Some exception will be raised if nothing is returned. Ambiguous results are silently ignored right now, which probably isn't good. Ideally you should declare the column UNIQUE in your table schema. If SQLObject ever generates table schemas (maybe not far off) then it would add UNIQUE based on this, but would otherwise let the database do the work of ensuring that. It might be good to define the exception that's raised when nothing's found, though... KeyError? IndexError? ValueError? Ian |