
Property changes on: .
___________________________________________________________________
Name: svn:ignore
   - build
dist
*.egg-info
MANIFEST
*.pyc

   + build
dist
*.egg-info
MANIFEST
*.pyc
.settings
.project
.pydevproject


Index: django/core/management/__init__.py
===================================================================
--- django/core/management/__init__.py	(revision 6708)
+++ django/core/management/__init__.py	(working copy)
@@ -135,6 +135,32 @@
     """
     def error(self, msg):
         pass
+    
+    def _process_args(self, largs, rargs, values):
+        """overrides OptionParser._process_args to just handle default
+        options and ignore args and other options. With the super class's
+        version, parsing stops at the first unrecognized option.
+        """
+        while rargs:
+            arg = rargs[0]
+            try:
+                if arg[0:2] == "--" and len(arg) > 2:
+                    # process a single long option (possibly with value(s))
+                    # the superclass code pops the arg off rargs
+                    self._process_long_opt(rargs, values)
+                elif arg[:1] == "-" and len(arg) > 1:
+                    # process a cluster of short options (possibly with
+                    # value(s) for the last one only)
+                    # the superclass code pops the arg off rargs
+                    self._process_short_opts(rargs, values)
+                else:
+                    # it's either a non-default option or an arg
+                    # either way, add it to the args list so we can keep
+                    # dealing with options
+                    del rargs[0]
+                    raise error
+            except:
+                largs.append(arg)
 
 class ManagementUtility(object):
     """
Index: tests/regressiontests/core_management/__init__.py
===================================================================
Index: tests/regressiontests/core_management/tests.py
===================================================================
--- tests/regressiontests/core_management/tests.py	(revision 0)
+++ tests/regressiontests/core_management/tests.py	(revision 0)
@@ -0,0 +1,14 @@
+"""
+# Tests for LaxOptionParser
+
+# make sure --settings and --pythonpath are gotten even if they're not first.
+
+>>> from django.core.management import LaxOptionParser, get_version
+>>> from django.core.management.base import BaseCommand
+>>> parser = LaxOptionParser(version=get_version(), option_list=BaseCommand.option_list)
+>>> options, args = parser.parse_args('django-admin.py command --option --settings=settingsmodule --pythonpath=/home/user/django-dir'.split())
+>>> print options
+{'pythonpath': '/home/user/django-dir', 'settings': 'settingsmodule'}
+>>> args
+['django-admin.py', 'command', '--option']
+"""
\ No newline at end of file
Index: tests/regressiontests/core_management/models.py
===================================================================
