[SQLObject] Proposal: change .get(int) to .get_id(int)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Mike W. <li...@mi...> - 2004-07-22 03:10:37
|
Proposal: change .get(int) to .get_id(int) It would be nice to be able to add common pythonic methods to our SQLObject objects without running into collisions. i.e. for a dict-like object, it might be nice to hand a SQLObject instance which has def get(key): def items(): def values(): def has_key(): etc. That first one is the killer, .get() is used inside SQLObject, returns the an object by the "id" relation. Occasionally I've got a SQL relation where I don't want anyone to think/see or smell the serial int identity column - a unique string as key is what I"m after, very dict like. 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. Too little sleep, not enough time lately, if I've missed something here please slap me gently. Mike |