[jifty-devel] sort_order in Jifty::DBI Schema definition ignored

Wolfgang Kinkeldei wolfgang at kinkeldei.de
Mon Oct 30 15:17:05 EST 2006


Am 30.10.2006 um 20:34 schrieb Jesse Vincent:

>
>> looks better and makes the definition more tolerant to a user
>> forgetting to give a value for the sort_order. Right.
>
> It's worth noting that Jifty defaults to setting up a sort order  
> that's
> the same as the order the columns are listed in. So, sort_order is
> really just for overriding the defaults.

Thats right and in most cases nobody would like to manually set the  
sort_order for a database schema when reordering does the job.

However, I like to build forms eg. for a "Update$model" class by  
iterating like that:

% foreach my $field_name ($action->argument_names) {
%   next if (($action->arguments->{$field_name}->{sort_order} || 0) <  
0);
     <% $action->form_field($field_name) %>
% }

This way, I can still see all arguments in the Administration area  
but kind of filter out fields I do not like to see in the web  
frontend by simply using negative sort_orders without manually  
constructing forms.


>> Do you apply this change?
>
> I haven't. Please go right ahead :)

done.

Regards,

Wolfgang

-- 

' /\_/\ ' .print[split??,"".(($/=q|Cms)+-03467:;<=|)=~tr!C-z -B! -z!)x
'( o.o )' .$/]->[hex]foreach split qr<>,qq+1ecd039ad65b025b8063475b+||
' > ^ < ' .q<!-- Wolfgang Kinkeldei - mailto:wolfgang at kinkeldei.de -->





More information about the jifty-devel mailing list