OT: Templating systems (was RE: [Catalyst] New default screen for Catalyst)

John Siracusa siracusa at mindspring.com
Fri Oct 21 16:18:15 CEST 2005


On 10/21/05, Matt S Trout <dbix-class at trout.me.uk> wrote:
> Incidentally, does the RHTMLO form code need any co-operation from the
> ORM? If so, I'll add making DBIx::Class provide such to my list of stuff
> to get round to ...

It doesn't really "need" anything because there's no tight coupling with db
objects in the RHTMLO distribution right now.  The only vaguely ORM-related
methods, object_from_form() and init_with_object(), will really take any
kind of object since they just use can() to pull out values and match them
up with fields of the same name.

In practice, tighter binding is usually done at the application or
"controller" level using the conventions of that environment.  RHTMLO
imposes none of its own.  Over on the RHTMLO list, Bill is exploring a
Class::DBI link to RHTMLO, if you want to see an example.

Another example can be found in the CVS repository for Rose::WebApp,
particularly the CRUD example app.  That code is not close to done, but you
can kind of get a feel for how I plan to link Rose::DB::Object to RHTMLO
inside a typical Rose::WebApp.  Not surprisingly, I find RDBO to be a better
fit for RHTMLO.  Thanks to the richer set of metadata available for each
column, I can auto-generate the appropriate field objects based on the exact
data type of the column, including things like maxlength, making NOT NULL
fields required, etc.  Anyway, URLs:

Rose::HTML::Objects list:

http://lists.sourceforge.net/lists/listinfo/rose-html-objects

Pre-pre-alpha Rose::WebApp CRUD example in CVS:

http://cvs.sourceforge.net/viewcvs.py/rose/rose/modules/Rose-WebApp/lib/Rose
/WebApp/Example/

In particular, take a look at the "auto" forms:

http://cvs.sourceforge.net/viewcvs.py/rose/rose/modules/Rose-WebApp/lib/Rose
/WebApp/Example/CRUD/Form/Search/Auto.pm?view=markup

http://cvs.sourceforge.net/viewcvs.py/rose/rose/modules/Rose-WebApp/lib/Rose
/WebApp/Example/CRUD/Form/Edit/Auto.pm?view=markup

I'm going to refactor the exact implementation of build_form() in those auto
forms examples, but you can get the gist of it.

-John





More information about the Catalyst mailing list