def add_timeframed_query_manager(sender, **kwargs):
 if (not issubclass(sender, TimeFramedModel)):
  return
 try:
  sender._meta.get_field(u'timeframed')
  raise ImproperlyConfigured((u"Model '%s' has a field named 'timeframed' which conflicts with the TimeFramedModel manager." % sender.__name__))
 except FieldDoesNotExist:
  pass
 sender.add_to_class(u'timeframed', QueryManager(((models.Q(start__lte=now) | models.Q(start__isnull=True)) & (models.Q(end__gte=now) | models.Q(end__isnull=True)))))

def add_timeframed_query_manager ( sender , ** kwargs ) : if ( not issubclass ( sender , TimeFramedModel ) ) : return try : sender . _meta . get_field ( u'timeframed' ) raise ImproperlyConfigured ( ( u"Model '%s' has a field named 'timeframed' which conflicts with the TimeFramedModel manager." % sender . __name__ ) ) except FieldDoesNotExist : pass sender . add_to_class ( u'timeframed' , QueryManager ( ( ( models . Q ( start__lte = now ) | models . Q ( start__isnull = True ) ) & ( models . Q ( end__gte = now ) | models . Q ( end__isnull = True ) ) ) ) )
add a querymanager for a specific timeframe .