Example #1
0
 def to_sql_filter(self):
     if self.value is None:
         return None
     if self.value.startdate is None:
         return LTFilter(self.filter.field, '%s_enddate' % self.filter.slug)
     elif self.value.enddate is None:
         return GTFilter(self.filter.field,
                         '%s_startdate' % self.filter.slug)
     else:
         return BetweenFilter(self.filter.field,
                              '%s_startdate' % self.filter.slug,
                              '%s_enddate' % self.filter.slug)
Example #2
0
 def to_sql_filter(self):
     if self.value is None:
         return ""
     return BetweenFilter(self.filter.field, 'startdate', 'enddate')