def add_status_query_managers(sender, **kwargs):
 if (not issubclass(sender, StatusModel)):
  return
 for (value, display) in getattr(sender, u'STATUS', ()):
  try:
   sender._meta.get_field(value)
   raise ImproperlyConfigured((u"StatusModel: Model '%s' has a field named '%s' which conflicts with a status of the same name." % (sender.__name__, value)))
  except FieldDoesNotExist:
   pass
  sender.add_to_class(value, QueryManager(status=value))

def add_status_query_managers ( sender , ** kwargs ) : if ( not issubclass ( sender , StatusModel ) ) : return for ( value , display ) in getattr ( sender , u'STATUS' , ( ) ) : try : sender . _meta . get_field ( value ) raise ImproperlyConfigured ( ( u"StatusModel: Model '%s' has a field named '%s' which conflicts with a status of the same name." % ( sender . __name__ , value ) ) ) except FieldDoesNotExist : pass sender . add_to_class ( value , QueryManager ( status = value ) )
add a querymanager for each status item dynamically .