Skip Menu |

This queue is for tickets about the Class-DBI-AsForm CPAN distribution.

Report information
The Basics
Id: 11656
Status: new
Priority: 0/
Queue: Class-DBI-AsForm

People
Owner: Nobody in particular
Requestors: peterspeltz [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Date: Thu, 24 Feb 2005 15:19:15 -0800 (PST)
From: Peter Speltz <peterspeltz [...] yahoo.com>
Subject: additional AsForm Functionality
To: bug-Class-DBI-AsForm [...] rt.cpan.org
Hi Tony. I have made some additions to my local AsForm that I think would be useful to others. I've discussed it and posted some rough code as proof of concept several times on list cause people were interested. I'm wondering the best way to get this code to people that could use it, ie -- AsForm patch or Class::DBI::Plugin::AsForm or new module Class::DBI::AsFormImproved. Here's breakdown of subs i've implemented and what they do: Most are called by to_cgi depending on column_type or relationship: _to_foreign_inputs -- makes input boxes for the columns of related class. If relation is has_one (might_have without the might) then it ===== pjs Show quoted text
__________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250
Date: Thu, 24 Feb 2005 15:50:32 -0800 (PST)
From: Peter Speltz <peterspeltz [...] yahoo.com>
Subject: additional AsForm Functionality
To: bug-Class-DBI-AsForm [...] rt.cpan.org
sorry. sent that on accident before i was done. Hi Tony. I have made some additions to my local AsForm that I think would be useful to others. I'd appreciate your thoughts on this. I've discussed it and posted some rough proof of concept code several times on list cause people were interested. I'm cleaning it up now and I'm wondering the best way to get this code to people that could use it, ie -- AsForm patch or Class::DBI::Plugin::AsForm or new module Class::DBI::AsFormImproved. Here's breakdown of subs i've implemented and what they do: Most are called by to_cgi depending on column_type or relationship: _to_foreign_inputs -- This is most crucial thing several people thought were missing from AsForm. It makes input boxes for the columns of related class and puts hashref to them in the accessor's slot (as opposed to single input element). This does it's thing if _maybe_foreign_inputs returns true. In my latest implementation i specify a "one_to_one => 1" arg in my has_a and might_have declarations if i want form inputs for those classes and check for that. This is most useful now because i have implemented a sub -- untaint_create_all_from_cgi -- that can process and create and relate all objects specified on a form with foreign inputs. I use maypole as you know and now every object and addnew form in my database with same code. _to_enum_select -- pretty self explanaotry _to_bool_select -- .. to_select_from_many -- public method not used in AsForm to make a select box to choose among a group of has_many objects. _to_select -- made it not create objects so its faster. My implementation looks for class->columns('SelectBox') , 'Stringify', 'Essential' in that order to to dtermine what to make option text out of. It then calls class->stringify_select_box or joins them on ' '. This could be improved but works. to_cgi -- take a columns argument option to use instead of class->columns to_field -- makes use of new _to_* methods I've made other changes but i wait too hear if you are interested in discussing this or not. thanks ===== pjs Show quoted text
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[peterspeltz@yahoo.com - Thu Feb 24 18:53:20 2005]: Show quoted text
> sorry. sent that on accident before i was done. > > Hi Tony. I have made some additions to my local AsForm that I think > would be > useful to others. I'd appreciate your thoughts on this. I've > discussed it and > posted some rough proof of concept code several times on list cause > people were > interested. I'm cleaning it up now and I'm wondering the best way to > get this > code to people that could use it, ie -- AsForm patch or > Class::DBI::Plugin::AsForm or new module Class::DBI::AsFormImproved. >
why not attach a patch for Class::DBI:AsForm? regards, Roland