[Catalyst] Question on Catalyst::Example::InstantCRUD
Jonas Alves
jonas.alves at gmail.com
Wed May 31 15:30:31 CEST 2006
Hi, i'm working on a patch to IntantCRUD that handles that
automatically.
It isn't finished yet, but already do the following:
- Updated to DBIC::Schema::Loader to automatically handle
relationships (belongs_to, has_many and many_to_many)
- Generate all the column_info metadata in the schema classes.
(useful if you would like to use DBIC deploy features)
- Adds the 'use overload '""' => sub { shift->$primary_key },
fallback=> 1;' line to the schema classes.
- Constraints goes in the column_info metadata instead of the
controller method.
- Added a 'widget_element' attribute to the column_info metadata that
defines the HTML::Widget::Element and respective attributes that
should be used to represent that column in the form.
- Forms can insert and update related columns one level deep.
- If the column name matches 'password' or 'passwd', automatically
turn the widget element in a password type and creates a form field
to confirm the password.
TODO:
- Default to HTML::Widget::Element::Dojo::Date in all the columns
where type equals Date.
- Show related columns in the table list.
- Show related columns in the items view.
- Automatically create constraints to date types
- Use Ajax and/or HTML::Widget::Javascript to validate the forms.
I can post the patch here if the community is interested.
--Jonas
On 2006/05/30, at 14:35, Zbigniew Lukasiak wrote:
> Hi,
>
> Try adding stringification to the classes:
>
> use overload '""' => sub { shift->name }, fallback=> 1;
>
> It should work for 'belong_to' relations.
> --
> Zbyszek
>
> On 5/30/06, Mauro Andreolini <andreoli at weblab.ing.unimo.it> wrote:
>> On Tue, 2006-05-30 at 00:11 +0100, Matt S Trout wrote:
>>
>> Hi all,
>>
>> I have just installed Catalyst::Example::InstantCRUD for a CRUD-
>> like Web
>> application, and I was wondering whether it could do relationships
>> that
>> is, instead of displaying id numbers, displaying the corresponding
>> elements in the tables. Is it at all possible? What effort is
>> required
>> to modify InstantCRUD to achieve this?
>>
>> Best regards
>> --
>> Ing. Mauro Andreolini - Ph.D., Research Associate
>> Dipartimento di Ingegneria dell'Informazione
>> Università di Modena e Reggio Emilia - Italia
>> e-mail: andreolini.mauro at unimore.it
>> www: http://weblab.ing.unimo.it/people/andreolini/
>> tel: +39 059 2056256, fax: +39 059 2056129
>>
>>
>> _______________________________________________
>> Catalyst mailing list
>> Catalyst at lists.rawmode.org
>> http://lists.rawmode.org/mailman/listinfo/catalyst
>>
>
>
> --
> Zbigniew Lukasiak
> http://brudnopis.blogspot.com/
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
More information about the Catalyst
mailing list