[html-formfu] Extended DBIC::Select on SVN

Mario Minati mario.minati at googlemail.com
Mon Oct 15 19:01:55 GMT 2007


On Monday 15 October 2007 12:41:22 Carl Franks wrote:
> On 13/10/2007, Mario Minati <mario.minati at googlemail.com> wrote:
> > I just uploaded an updated version of DBIC::Select to SVN.
> >
> > There is now support for sorting the data ascending or descending with a
> > separate search filed or the default name field.
> >
> > The documentation has been extended accordingly.
>
> Can this not already be achieved with search_attrs() ?
>
>     search_attrs:
>       order_by: 'field_name'
>
> I haven't tested it - but I think it should work.
> It also provides the flexibility of being able to sort by the visible
> label or by id.

Yes it works, but you can only use it on DB columns. I was facing the 
situation that I needed to sort on a value that is calculated from a column 
in conunction with an other table.

Maybe it could be done by a complex multi table join, but this way was more 
clear as I use this value all over in my app.


> By the way, I think name_field() should probably be renamed
> label_field() to match the Select elements conventions.

Shall I just rename it or provide a stub named 'name_field' that creates a 
warning that it will be removed soon?

> It might also be worth, like the Date element, adding an accessor to
> allow switching from a Select element to a RadioGroup element, as they
> both use the same base class.

I'll look into that after I'm done with nested.

Greets,
Mario



More information about the HTML-FormFu mailing list