[Catalyst-commits] r9294 - Catalyst-Controller-DBIC-API/1.001/branches/json_search/lib/Catalyst/Controller/DBIC

abraxxa at dev.catalyst.perl.org abraxxa at dev.catalyst.perl.org
Fri Feb 13 16:36:50 GMT 2009


Author: abraxxa
Date: 2009-02-13 16:36:50 +0000 (Fri, 13 Feb 2009)
New Revision: 9294

Modified:
   Catalyst-Controller-DBIC-API/1.001/branches/json_search/lib/Catalyst/Controller/DBIC/API.pm
Log:
added docs for json search


Modified: Catalyst-Controller-DBIC-API/1.001/branches/json_search/lib/Catalyst/Controller/DBIC/API.pm
===================================================================
--- Catalyst-Controller-DBIC-API/1.001/branches/json_search/lib/Catalyst/Controller/DBIC/API.pm	2009-02-13 16:28:08 UTC (rev 9293)
+++ Catalyst-Controller-DBIC-API/1.001/branches/json_search/lib/Catalyst/Controller/DBIC/API.pm	2009-02-13 16:36:50 UTC (rev 9294)
@@ -166,11 +166,13 @@
 
 List level action chained from L</setup>. By default populates $c->stash->{response}->{list} with a list of hashrefs representing each object in the class resultset. If the L</list_returns> config param is defined then the hashes will contain only those columns, otherwise all columns in the object will be returned. Similarly L</list_count>, L</list_grouped_by> and L</list_ordered_by> affect the maximum number of rows returned as well as the ordering and grouping. Note that if list_returns, list_count, list_ordered_by or list_grouped_by request parameters are present then these will override the values set on the class.
 
-If not all objects in the resultset are required then it's possible to pass conditions to the method as request parameters. L</CGI::Expand> is used to expand the request parameters into a structure and then $c->req->params->{search} is used as the search condition.
+If not all objects in the resultset are required then it's possible to pass conditions to the method as request parameters. You can use a JSON string as the 'search' parameter for maximum flexibility or use L</CGI::Expand> syntax. In the second case the request parameters are expanded into a structure and then $c->req->params->{search} is used as the search condition.
 
 For example, these request parameters:
 
  ?search.name=fred&search.cd.artist=luke
+ OR
+ ?search='{"name":"fred","cd.artist":"luke"}'
 
 Would result in this search (where 'name' is a column of the schema class, 'cd' is a relation of the schema class and 'artist' is a column of the related class):
 




More information about the Catalyst-commits mailing list