[Maypole] AsForm issues

Tony Bowden tony-maypole@kasei.com
Wed, 21 Jul 2004 11:23:17 +0100


I'm trying to steal the best bits of Maypole for the framework we use in
an attempt to see if we can migrate parts of it to just being Maypole.
Today's experiments are with the templating parts, and particularly
Class::DBI::AsForm (now that it installs cleanly!)

But I'm having a few problems, that I can't tell whether Maypole itself
works around, or just lives with.

1) $class->to_cgi returns a hash rather than a hashref, making it
difficult to use directly in TT. And, as it's a mixin, it's hard to
subclass. I've had to take the nasty approach of
changing MySite::DBI to use base 'MySite::__::DBI' which then does the
use Class::DBI::AsForm, so that in MySite::DBI I can add:
	sub to_cgi { return { shift->SUPER::to_cgi }}

Maypole gets around that by passing it into the template wrapped as a
hashref, and I'll probably end up there, but it seems that AsForm would
be much nicer if it was able to be used more directly in TT.  Am I
missing something obvious?

2) The has_many dropdown is nifty, but I'd really like to be able to
specify how I order the list. Do I really have to override retrieve_all
in the class in question to sort? Is there something that could be added
to the interface for this instead?

Thanks,

Tony