Tony Nelson
unread,May 24, 2011, 9:08:13 PM5/24/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ColdMVC
I'm thinking about adding an enhancement but wanted to get opinions
before I started work on it. I'm thinking about adding default sort
and order values for models using annotations.
For example, you might have a Product model that looks like this:
/**
* @extends coldmvc.Model
* @persistent true
* @sort name
* @order asc
*/
component {
property id;
property name;
property description;
property category;
}
Currently to list out all products and sort them by name, you'd write:
var products = _Product.list({sort="name", order="asc"});
With the @sort and @order annotations, it could simply be:
var products = _Product.list();
Thoughts? Is it worth adding, or is it just more stuff you need to
know?