logo       

Re: convenience wrapper for looping through columns?: msg#00012

lang.perl.modules.dbi.rose-db-object

Subject: Re: convenience wrapper for looping through columns?

On 6/1/06, Jonathan Vanasco <rosedb-GYD5gbT+W3w@xxxxxxxxxxxxxxxx> wrote:
> On Jun 1, 2006, at 1:11 PM, John Siracusa wrote:
>> That's bad code because it assumes that the column accessor name is
>> the same as the column name, which is not always the case.
>
> in my code it is... i enforce that for simplicity, and then have '_'
> prepended accessor names for non-column name accessors

Okay, but at least comment the code:

# This assumes that column names match method names

so your future-self will be reminded of this constraint :)

> i want to clone the data/row representation of the db for user and
> serialization by non-rosedb code -- the clone methods look like they
> will include the object class, meta data, and rosedb associated
> items. i really just need a 'dict' / hash of the column_name/
> column_value pairs.

Ah, gotcha.

-John


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise