>
> But the second topic is Brian's original problem, of the slow select
> generation, and it's the to_field method (or rather its _to_select
> helper) that causes his problem. So I don't think that calling it by
> hand in the template is a solution! It seems to me that it would be good
> for Brian's code to live inside _to_select.
>
It, putting this in _to_select, is desireable but It is tricky because the text
for the option is the stringify of the object so you need the object to get
that EXCEPT if this is set via "columns(Stringify" I believe. So, it seems
there has to be a little more communication between AsForm and the model class
to let _to_select know do this the efficient way ONLY IF the stringify value is
set via a sub. Does this sound about right?
My idea is to make a sql_select_box_data via set_sql that would return id and
columns you want in string to appear in the select box.
Then
if (@select_box_cols = $class->select_box_cols || $class->columns('Stringify')
) {
# Do it efficient way, no object creation
my $sth = $class->sql_select_box_data;
# Someone fill in here
}
else {
# current inefficient way
}
=====
pjs
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT