Re: [SQLObject] Proposal: change .get(int) to .get_id(int)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Jeremy F. <je...@go...> - 2004-07-22 09:13:59
|
On Wed, 2004-07-21 at 20:10 -0700, Mike Watkins wrote: > So it would be handy, and mildly stylish to be able to define our own > get() without breaking the insides of SQLObject. Admittedly it will be > more cumbersome to type three more digits when we are really after the > "id" attribute/relation. > > default - no "get()" > > current "get()" changes to "get_id()" or something else. I personally think the transition from .new -> .get is a step backwards. It feels wrong to me that instantiating a SQLObject has the side effect of creating a new table row, since I don't see SQLObjects as being synonymous with table rows - I see them as just being useful local handles for table rows. Therefore it makes most sense to me that Foo (id) creates a local reference to foo.id in the database, and Foo.new() creates a new row. Also, I get things a lot more than I create them, so adding .get() everywhere is a fair amount of extra typing. J |