summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/toastergui/widgets.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py
index 407a0fbe15..3d3c1d10df 100644
--- a/bitbake/lib/toaster/toastergui/widgets.py
+++ b/bitbake/lib/toaster/toastergui/widgets.py
@@ -207,7 +207,8 @@ class ToasterTable(TemplateView):
207 try: 207 try:
208 self.filter_actions[filter_action]() 208 self.filter_actions[filter_action]()
209 except KeyError: 209 except KeyError:
210 print "Filter and Filter action pair not found" 210 # pass it to the user - programming error here
211 raise
211 212
212 def apply_orderby(self, orderby): 213 def apply_orderby(self, orderby):
213 # Note that django will execute this when we try to retrieve the data 214 # Note that django will execute this when we try to retrieve the data
@@ -217,8 +218,7 @@ class ToasterTable(TemplateView):
217 """Creates a query based on the model's search_allowed_fields""" 218 """Creates a query based on the model's search_allowed_fields"""
218 219
219 if not hasattr(self.queryset.model, 'search_allowed_fields'): 220 if not hasattr(self.queryset.model, 'search_allowed_fields'):
220 print "Err Search fields aren't defined in the model" 221 raise Exception("Err Search fields aren't defined in the model")
221 return
222 222
223 search_queries = [] 223 search_queries = []
224 for st in search_term.split(" "): 224 for st in search_term.split(" "):
@@ -228,9 +228,10 @@ class ToasterTable(TemplateView):
228 search_queries.append(reduce(operator.or_, q_map)) 228 search_queries.append(reduce(operator.or_, q_map))
229 229
230 search_queries = reduce(operator.and_, search_queries) 230 search_queries = reduce(operator.and_, search_queries)
231 print "applied the search to the queryset" 231
232 self.queryset = self.queryset.filter(search_queries) 232 self.queryset = self.queryset.filter(search_queries)
233 233
234
234 def get_data(self, request, **kwargs): 235 def get_data(self, request, **kwargs):
235 """Returns the data for the page requested with the specified 236 """Returns the data for the page requested with the specified
236 parameters applied""" 237 parameters applied"""
@@ -318,7 +319,8 @@ class ToasterTable(TemplateView):
318 data['rows'].append(required_data) 319 data['rows'].append(required_data)
319 320
320 except FieldError: 321 except FieldError:
321 print "Error: Requested field does not exist" 322 # pass it to the user - programming-error here
323 raise
322 data = json.dumps(data, indent=2, default=objtojson) 324 data = json.dumps(data, indent=2, default=objtojson)
323 cache.set(cache_name, data, 60*30) 325 cache.set(cache_name, data, 60*30)
324 326