trouble with stringify
[prev]
[thread]
[next]
[Date index for 2005/04/24]
I have (essentially):
Role->columns(Primary => qw(film actor));
Role->columns(All => qw(film person role_title));
Role->has_a(film => 'Film');
Role->has_a(person => 'Person');
Film->columns(Primary => /film_id/);
Film->columns(Stringify => /film_name/);
Person->columns(Primary => /person_id/);
Person->columns(Stringify => /person_name/);
I've had cases where I am holding a $role that hasn't been entire
fleshed out, and then I stringify the $film or $person (for display).
And when I go back to get $role->role_title, it blows up. The SQL
shows me that it's trying to use the *stringified* versions of the
$film and $person to perform another retrieve of the additional column
of $role.
My workaround is
Role->columns(Essential => qw(film person role_title));
but why is it breaking this way?
I know you're not supposed to have a has_a on your primary key,
because the inflation there will throw it off.
But I've never seen any admonition not to stringify a column of your
primary key. Is this also broken for the same reasons? If so, can
the docs be fixed? If not, can the code be fixed?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
|
(message missing)
|
|
|
trouble with stringify
merlyn (Randal L. Schwartz) 23:56 on 24 Apr 2005
|