[Catalyst] Question on Catalyst::Example::InstantCRUD
Zbigniew Lukasiak
zzbbyy at gmail.com
Wed May 31 16:19:37 CEST 2006
Hi Jonas,
I am aware of the constraints of current InstantCRUD. Your list of
changes looks pretty impressive and I would love to incorporate them.
The only thing that I would like to negotiate with you is to make the
changes compatible with the idea of scaffolding. The current state of
InstantCRUD perhaps does not display it very well but my goal for this
project is to make the autogenerated code maximally customizable but
also upgradable. So that the user can use it both as an example, and
learn from it and as a temporary part of his application that
eventually may or may not be replaced by his own code and when he
upgrades InstantCRUD to a newer version this should not break his
application.
The important question here is which changes we simplify and which
not. I thought that changing the error messages is quite a common
modification - that is why I put the column metadata into the
generated controller and not just rely on the database column_info
directly. I am also planning to use Tie::IxHash for the generated
datastructures - so that the order of columns can be manipulated
there. Of course it's all about trade-offs.
--
Zbyszek
http://brudnopis.blogspot.com/
On 5/31/06, Jonas Alves <jonas.alves at gmail.com> wrote:
> 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
> >
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
More information about the Catalyst
mailing list