

class BaseFilter(object):

    model = None
    column_name = ''
    name = ''
    widget = None
  
  
    def __init__(self, model, column, name='', widget=None):
        """
            Constructor.

            :param model:
                The Backend Model 
            :param column_name:
                Model field name
            :param name:
                Display name of the filter
            :param widget:
                widget to use on the template
        """
        self.column = column

class FilterStartsWith(BaseFilter):
    name = 'Starts with'
    
    def apply(self, query, value):
         return query.filter(getattr(self.model,self.name).like(value + '%'))
         

@@ -1,13 +1,12 @@
-%0A
 %0Aclass BaseF
@@ -25,25 +25,8 @@
 ):%0A%0A
-    model = None%0A
     
@@ -106,15 +106,8 @@
 elf,
- model,
  col
@@ -176,69 +176,8 @@
 r.%0A%0A
-            :param model:%0A                The Backend Model %0A
     
@@ -512,16 +512,23 @@
 , query,
+ model,
  value):
@@ -524,25 +524,24 @@
 el, value):%0A
- 
         retu
@@ -564,21 +564,16 @@
 getattr(
-self.
 model,se
@@ -606,12 +606,467 @@
 )%0A         %0A
+%0Aclass FilterEqual(BaseFilter):%0A    name = 'Equals'%0A    %0A    def apply(self, query, model, value):%0A        return query.filter(getattr(model,self.name) == value)%0A%0Aclass FilterGreater(BaseFilter):%0A    def apply(self, query, model, value):%0A        return query.filter(getattr(model,self.name) %3E value)%0A        %0Aclass FilterSmaller(BaseFilter):%0A    def apply(self, query, model, value):%0A        return query.filter(getattr(model,self.name) %3C value)%0A        %0A

Update filters.py