[html-formfu] nested_name and order_by

Christian Lackas christian at lackas.net
Wed Jun 23 14:05:46 GMT 2010


* Benjamin Martin <benjamin at opusvl.com> [100623 13:13]:

Hi Benjamin,

> I am using a Repeatable element to build a form based on a DBIx::Class 
> object and its has_many relationship. (using 'nested_name')
> It works real well but I can't seem to get the form to list the related 
> items in a defined order?

don't know if that helps you in the mean time, but you could specify an
order_by attribute for the has_many relationship itself:

    __PACKAGE__->has_many( images => 'MyApp::Schema::Images', 'seriesid', 
        { order_by => 'instancenumber' } );

This does assume you want this particular order in all places or can
overwrite the order more easily elsewhere.

Christian

-- 
http://www.invicro.com



More information about the HTML-FormFu mailing list