[Maypole] AsForm issues

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


On Wed, Jul 21, 2004 at 11:31:59AM +0100, Simon Cozens wrote:
> You're correct, but changing it to be a hashref would be quite a big interface
> change. I guess I could probably get away with checking wantarry and 
> deprecating list usage with a warning.

I'm not sure how TT will cope with that. Is the default context list or
scalar if I just do  SET var = obj.to_cgi ?

> > 2) The has_many dropdown is nifty, but I'd really like to be able to
> > specify how I order the list. 
> I'm not sure where would be the best place to put this in the interface.
> What would the ->to_field call look like in an ideal world?

I'm not sure either. Especially as I don't call to_field, directly.

In my template I'm just doing:

  SET fields = sale.to_cgi;
  fields.product.as_HTML;

There's no obvious place to hook in there ...

> I'm also open to ways of turning many-to-many relationships into a multiple
> select, now we can get at the relationship metadata more easily.

The simple case (where the linking table is solely a linking table)
should be simple enough. The complex case (where you need extra info in
the linking table - such as a 'character name' column in a Role table
linking Actors and Films) is much more difficult.

Tony