          call_command('sqlall', 'myapp')
      """
      try:
          app_name = get_commands()[name]
          klass = load_command_class(app_name, name)
      except KeyError:
          raise CommandError, "Unknown command: %r" % name
      return klass.execute(*args, **options)
      
  class LaxOptionParser(OptionParser): 
 
</s> remove             klass = load_command_class(app_name, subcommand)
 </s> add             if isinstance(app_name, BaseCommand): 
                # If the app_name is already loaded, use it directly.
                klass = app_name
            else:
                klass = load_command_class(app_name, subcommand)
        if isinstance(app_name, BaseCommand): 
            # If the command is already loaded, use it directly.
            klass = app_name
        else:
            klass = load_command_class(app_name, subcommand)
          call_command('sqlall', 'myapp')
      """
      try:
          app_name = get_commands()[name]
        if isinstance(app_name, BaseCommand): 
            # If the command is already loaded, use it directly.
            klass = app_name
        else:
            klass = load_command_class(app_name, subcommand)
      except KeyError:
          raise CommandError, "Unknown command: %r" % name
      return klass.execute(*args, **options)
      
  class LaxOptionParser(OptionParser): 
keep keep keep keep replace keep keep keep keep keep
 Fixed #5564 -- Fixed handling of the ProjectCommand used by startapp.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6402 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/core/management/__init__.py