Re: 'sequence' table?
[prev]
[thread]
[next]
[Date index for 2004/09/20]
On Mon, Sep 20, 2004 at 01:08:47PM +0100, Dave Howorth wrote:
> >>FWIW, I would prefer to call the table 'sequences' and the column
> >>'sequences_id', or better yet 'sequence_id'. But I can't!
> >Why not?
> Suppose I do. Then I'd like to say:
> __PACKAGE__->has_a(sequence => 'Sequences');
> so that I can say print $obj->sequence->length for example.
> That isn't supported, but I'm not clear what a reasonable idiom is to
> get that effect.
You can't say that, as the first argument to has_a is your column, and
you don't have a column called sequence.
You need to say
__PACKAGE__->has_a(sequence_id => 'Sequences');
print $obj->sequence_id->length
If you really want to have the method be sequence() then use
accessor_name() to change it.
> >>CDBI needs FK columns to be the same as table names.
> >No, it doesn't.
> Sorry, it's Class::DBI::Loader::Relationship that wants the names to be
> the same.
I've never used that, and don't know anything about it. I'd suggest
taking this up with the author of that, or, perhaps, not using it, and
declaring the relationships another way.
> Maypole calls Lingua::EN::Inflect::PL on the table name. According to
> LEI's docs "The results of passing a plural form are undefined (and
> unlikely to be correct)."
> (Due to the peculiarities of English in most cases you get what looks
> like a reasonable singular from a plural noun, because LEI classifies
> the word as a singlar verb and returns the plural form :) But in the
> Maypole application, this means the phrases generated in the HTML aren't
> correct.
Then, again, perhaps you should skip the magic, and do things by hand.
Tony
|
(message missing)
|