[jifty-devel] how to do it ?

Jesse Vincent jesse at bestpractical.com
Tue Feb 20 11:51:43 EST 2007

On Feb 19, 2007, at 4:27 PM, mraptor wrote:

> hi,
> Last days I was experimenting creating a complex form in many  
> different
> ways w/o finding a good solution... :(
> What I want to do is a form with approximately 60-70 fields which then
> have to be written in 5-6 different tables.
> The slowest and most obvious way to do it should be to
> define the fields into the Model, then define them in the Action

Perhaps your action should be introspecting the model to build its  
datastructure (As Jifty automatically does for regular record actions  
with Jifty::Action::Record)

> and
> finally because the FORM has to be divided into sections, list them
> in every section in the template i.e. :

Perhaps you should be definining the different categories of field in  
your model or action classes as a subroutine that returns a list of  
field names.

> for my $fieldName (qw(f1 f2 f7 f12..)) { .... }
> and so on for each separate sections..so that I can order them in nice
> html-tables.
> As you may see this way is not that scalable. For any small change I
> have to edit at a minimum 3 files ! Possibility for error is great.
> The problem goes even bigger when I have to redefine field that may
> contain 5-10 <options> (even worse if i want to specify them like
> a hash-pairs display/value }

You really, really want to be introspecting your model class to get  
that stuff. If you're repeating things at all, you're going to lose.

> Let me remind you that I cant just inherit Jifty::Record (so that i  
> also
> inherit some of the schema-definition) bacause I will have 5-6
> different record-objects.
> So in short these are my questions ;)
> ----
> PS. One more quick question. Do you have any quick method to switch  
> from
> 'valid'-list -to-> "refers_to db-table"
> -- 
> Gee I don't have signature
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070220/e1717132/PGP.pgp

More information about the jifty-devel mailing list