Skip to content
Browse files

Filter embedded tables correctly

  • Loading branch information...
1 parent 10385ab commit 0fd4463ca33fc1538f513836a130b342cf2b7e3a @brendonh committed Dec 17, 2012
Showing with 7 additions and 1 deletion.
  1. +2 −1 warp/crud/render.py
  2. +5 −0 warp/templates/crud/bootstrap/list.mak
View
3 warp/crud/render.py
@@ -136,7 +136,7 @@ def bootstrapListJSON(self, request):
# XXX Todo -- Search
sortCol = getattr(self.model,
- self.crudModel.listColumns[int(params["iSortCol_0"])])
+ self.crudModel.listColumns[int(params["iSortCol_0"])])
if isinstance(sortCol, Reference):
sortCol = sortCol._local_key[0]
@@ -148,6 +148,7 @@ def bootstrapListJSON(self, request):
end = start + int(params["iDisplayLength"])
conditions = self.crudModel.listConditions(self.model, request)
+
totalResults = request.store.find(self.model, *conditions).count()
results = list(request.store.find(self.model, *conditions).order_by(sortCol)[start:end])
View
5 warp/templates/crud/bootstrap/list.mak
@@ -44,6 +44,11 @@ $(document).ready(function(){
"bFilter": false,
"bServerSide": true,
"sAjaxSource": "${url(crudNode, 'list_json')}",
+ % if presets:
+ "fnServerParams": function(aoData) {
+ aoData.push({"name": "where", "value": ${json.dumps(presets)} });
+ },
+ % endif
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},

0 comments on commit 0fd4463

Please sign in to comment.
Something went wrong with that request. Please try again.