def handle(self, *trackable_model_specs, **options):
     for model_spec in trackable_model_specs:
         print "Processing messages for trackable model %s" % (model_spec)
         try:
             app_label,model = model_spec.split('.')
             model_cls = get_model(app_label,model)
             if model_cls is None:
                 raise CommandError("Unknown model: %s.%s" % (app_label,model))
         except ValueError:
             raise CommandError("Use full appname.ModelName specification for argument %s" % model_spec)
         try:
             site.get_parent( model_cls )
         except NotRegistered, e:
             raise CommandError( str(e) )
         cnt = connection.process_messages(model_cls=model_cls)
Ejemplo n.º 2
0
 def run(self, **kwargs):
     logger = self.get_logger(**kwargs)
     return connection.process_messages(logger=logger)