Ticket #16584: 16584.diff

File 16584.diff, 20.7 KB (added by Bernhard Essl, 13 years ago)
  • django/http/__init__.py

     
    282282
    283283    def _get_upload_handlers(self):
    284284        if not self._upload_handlers:
    285             # If thre are no upload handlers defined, initialize them from settings.
     285            # If there are no upload handlers defined, initialize them from settings.
    286286            self._initialize_handlers()
    287287        return self._upload_handlers
    288288
  • django/test/_doctest.py

     
    552552        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
    553553        """, re.VERBOSE | re.MULTILINE | re.DOTALL)
    554554
    555     # A callable returning a true value iff its argument is a blank line
     555    # A callable returning a true value if its argument is a blank line
    556556    # or contains a single comment.
    557557    _IS_BLANK_OR_COMMENT = re.compile(r'^[ ]*(#.*)?$').match
    558558
  • django/conf/global_settings.py

     
    1313TEMPLATE_DEBUG = False
    1414
    1515# Whether the framework should propagate raw exceptions rather than catching
    16 # them. This is useful under some testing siutations and should never be used
     16# them. This is useful under some testing situations and should never be used
    1717# on a live site.
    1818DEBUG_PROPAGATE_EXCEPTIONS = False
    1919
     
    389389# Boolean that sets whether to add thousand separator when formatting numbers
    390390USE_THOUSAND_SEPARATOR = False
    391391
    392 # Number of digits that will be together, when spliting them by
     392# Number of digits that will be together, when splitting them by
    393393# THOUSAND_SEPARATOR. 0 means no grouping, 3 means splitting by thousands...
    394394NUMBER_GROUPING = 0
    395395
     
    506506# MESSAGES #
    507507############
    508508
    509 # Class to use as messges backend
     509# Class to use as messages backend
    510510MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
    511511
    512512# Default values of MESSAGE_LEVEL and MESSAGE_TAGS are defined within
  • django/db/models/deletion.py

     
    217217            self.data[model] = sorted(instances, key=attrgetter("pk"))
    218218
    219219        # if possible, bring the models in an order suitable for databases that
    220         # don't support transactions or cannot defer contraint checks until the
     220        # don't support transactions or cannot defer constraint checks until the
    221221        # end of a transaction.
    222222        self.sort()
    223223
  • django/forms/formsets.py

     
    213213                    return (1, 0) # +infinity, larger than any number
    214214                return (0, k[1])
    215215            self._ordering.sort(key=compare_ordering_key)
    216         # Return a list of form.cleaned_data dicts in the order spcified by
     216        # Return a list of form.cleaned_data dicts in the order specified by
    217217        # the form data.
    218218        return [self.forms[i[0]] for i in self._ordering]
    219219    ordered_forms = property(_get_ordered_forms)
  • django/forms/models.py

     
    117117        if exclude and f.name in exclude:
    118118            continue
    119119        if isinstance(f, ManyToManyField):
    120             # If the object doesn't have a primry key yet, just use an empty
     120            # If the object doesn't have a primary key yet, just use an empty
    121121            # list for its m2m fields. Calling f.value_from_object will raise
    122122            # an exception.
    123123            if instance.pk is None:
     
    288288            # Exclude empty fields that are not required by the form, if the
    289289            # underlying model field is required. This keeps the model field
    290290            # from raising a required error. Note: don't exclude the field from
    291             # validaton if the model field allows blanks. If it does, the blank
     291            # validation if the model field allows blanks. If it does, the blank
    292292            # value may be included in a unique check, so cannot be excluded
    293293            # from validation.
    294294            else:
  • django/core/management/commands/syncdb.py

     
    140140
    141141        if verbosity >= 1:
    142142            print "Installing indexes ..."
    143         # Install SQL indicies for all newly created models
     143        # Install SQL indices for all newly created models
    144144        for app_name, model_list in manifest.items():
    145145            for model in model_list:
    146146                if model in created_models:
  • django/core/management/sql.py

     
    1111
    1212    if connection.settings_dict['ENGINE'] == 'django.db.backends.dummy':
    1313        # This must be the "dummy" database backend, which means the user
    14         # hasn't set ENGINE for the databse.
     14        # hasn't set ENGINE for the database.
    1515        raise CommandError("Django doesn't know which syntax to use for your SQL statements,\n" +
    1616            "because you haven't specified the ENGINE setting for the database.\n" +
    1717            "Edit your settings file and change DATBASES['default']['ENGINE'] to something like\n" +
  • django/contrib/gis/db/backends/spatialite/operations.py

     
    9090        'contains' : SpatiaLiteFunction('Contains'),
    9191        'intersects' : SpatiaLiteFunction('Intersects'),
    9292        'relate' : (SpatiaLiteRelate, basestring),
    93         # Retruns true if B's bounding box completely contains A's bounding box.
     93        # Returns true if B's bounding box completely contains A's bounding box.
    9494        'contained' : SpatiaLiteFunction('MbrWithin'),
    9595        # Returns true if A's bounding box completely contains B's bounding box.
    9696        'bbcontains' : SpatiaLiteFunction('MbrContains'),
  • django/contrib/gis/db/backends/postgis/operations.py

     
    536536                    op = op(self.geom_func_prefix, value[1])
    537537                elif lookup_type in self.distance_functions and lookup_type != 'dwithin':
    538538                    if not field.geography and field.geodetic(self.connection):
    539                         # Geodetic distances are only availble from Points to
     539                        # Geodetic distances are only available from Points to
    540540                        # PointFields on PostGIS 1.4 and below.
    541541                        if not self.connection.ops.geography:
    542542                            if field.geom_type != 'POINT':
  • django/contrib/gis/geos/prototypes/io.py

     
    207207thread_context = ThreadLocalIO()
    208208
    209209# These module-level routines return the I/O object that is local to the
    210 # the thread. If the I/O object does not exist yet it will be initialized.
     210# thread. If the I/O object does not exist yet it will be initialized.
    211211def wkt_r():
    212212    if not thread_context.wkt_r:
    213213        thread_context.wkt_r = _WKTReader()
  • django/contrib/gis/maps/google/zoom.py

     
    4141            # Getting the degrees and radians per pixel, and the 1/2 the number of
    4242            # for every zoom level.
    4343            self._degpp.append(z / 360.) # degrees per pixel
    44             self._radpp.append(z / (2 * pi)) # radians per pixl
     44            self._radpp.append(z / (2 * pi)) # radians per pixel
    4545            self._npix.append(z / 2) # number of pixels to center of tile
    4646
    4747            # Multiplying `z` by 2 for the next iteration.
  • django/contrib/gis/tests/relatedapp/tests.py

     
    130130
    131131        # Now creating a second Parcel where the borders are the same, just
    132132        # in different coordinate systems.  The center points are also the
    133         # the same (but in different coordinate systems), and this time they
     133        # same (but in different coordinate systems), and this time they
    134134        # actually correspond to the centroid of the border.
    135135        c1 = b1.centroid
    136136        c2 = c1.transform(2276, clone=True)
  • django/contrib/gis/tests/geoapp/tests.py

     
    671671               '12.40500 43.94833,12.40889 43.95499,12.41580 43.95795)))')
    672672        sm = Country.objects.create(name='San Marino', mpoly=fromstr(wkt))
    673673
    674         # Because floating-point arithmitic isn't exact, we set a tolerance
     674        # Because floating-point arithmetic isn't exact, we set a tolerance
    675675        # to pass into GEOS `equals_exact`.
    676676        tol = 0.000000001
    677677
  • django/contrib/gis/gdal/envelope.py

     
    5050            else:
    5151                raise TypeError('Incorrect type of argument: %s' % str(type(args[0])))
    5252        elif len(args) == 4:
    53             # Individiual parameters passed in.
     53            # Individual parameters passed in.
    5454            #  Thanks to ww for the help
    5555            self._from_sequence(map(float, args))
    5656        else:
     
    125125            # An x and an y parameter were passed in
    126126                return self.expand_to_include((args[0], args[1], args[0], args[1]))
    127127        elif len(args) == 4:
    128             # Individiual parameters passed in.
     128            # Individual parameters passed in.
    129129            return self.expand_to_include(args)
    130130        else:
    131131            raise OGRException('Incorrect number (%d) of arguments.' % len(args[0]))
  • django/contrib/formtools/wizard/views.py

     
    152152                # if not, add the form with a zero based counter as unicode
    153153                init_form_list[unicode(i)] = form
    154154
    155         # walk through the ne created list of forms
     155        # walk through the new created list of forms
    156156        for form in init_form_list.itervalues():
    157157            if issubclass(form, formsets.BaseFormSet):
    158158                # if the element is based on BaseFormSet (FormSet/ModelFormSet)
  • django/contrib/comments/views/moderation.py

     
    8787        )
    8888
    8989# The following functions actually perform the various flag/aprove/delete
    90 # actions. They've been broken out into seperate functions to that they
     90# actions. They've been broken out into separate functions to that they
    9191# may be called from admin actions.
    9292
    9393def perform_flag(request, comment):
  • django/contrib/comments/views/comments.py

     
    8787            # preview templates, so we have to preserve that format.
    8888            "comments/%s_%s_preview.html" % (model._meta.app_label, model._meta.module_name),
    8989            "comments/%s_preview.html" % model._meta.app_label,
    90             # Now the usual directory based template heirarchy.
     90            # Now the usual directory based template hierarchy.
    9191            "comments/%s/%s/preview.html" % (model._meta.app_label, model._meta.module_name),
    9292            "comments/%s/preview.html" % model._meta.app_label,
    9393            "comments/preview.html",
  • django/contrib/localflavor/cz/forms.py

     
    134134        # remainder is equal:
    135135        #  0 or 10: last digit is 1
    136136        #  1: last digit is 0
    137         # in other case, last digin is 11 - remainder
     137        # in other case, last digit is 11 - remainder
    138138
    139139        if (not remainder % 10 and check == 1) or \
    140140        (remainder == 1 and check == 0) or \
  • django/middleware/gzip.py

     
    2222        if response.has_header('Content-Encoding'):
    2323            return response
    2424
    25         # MSIE have issues with gzipped respones of various content types.
     25        # MSIE have issues with gzipped response of various content types.
    2626        if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
    2727            ctype = response.get('Content-Type', '').lower()
    2828            if not ctype.startswith("text/") or "javascript" in ctype:
  • tests/modeltests/unmanaged_models/models.py

     
    55
    66from django.db import models
    77
    8 #  All of these models are creatd in the database by Django.
     8#  All of these models are created in the database by Django.
    99
    1010class A01(models.Model):
    1111    f_a = models.CharField(max_length=10, db_index=True)
  • tests/modeltests/lookup/tests.py

     
    251251    def test_values_list(self):
    252252        # values_list() is similar to values(), except that the results are
    253253        # returned as a list of tuples, rather than a list of dictionaries.
    254         # Within each tuple, the order of the elemnts is the same as the order
     254        # Within each tuple, the order of the elements is the same as the order
    255255        # of fields in the values_list() call.
    256256        identity = lambda x:x
    257257        self.assertQuerysetEqual(Article.objects.values_list('headline'),
  • tests/regressiontests/cache/tests.py

     
    220220        self.assertEqual(self.cache.has_key("goodbye1"), False)
    221221
    222222    def test_in(self):
    223         # The in operator can be used to inspet cache contents
     223        # The in operator can be used to inspect cache contents
    224224        self.cache.set("hello2", "goodbye2")
    225225        self.assertEqual("hello2" in self.cache, True)
    226226        self.assertEqual("goodbye2" in self.cache, False)
     
    338338            self.assertEqual(self.cache.get(key), value)
    339339
    340340    def test_binary_string(self):
    341         # Binary strings should be cachable
     341        # Binary strings should be cacheable
    342342        from zlib import compress, decompress
    343343        value = 'value_to_be_compressed'
    344344        compressed_value = compress(value)
  • tests/regressiontests/admin_widgets/tests.py

     
    274274        )
    275275
    276276    def test_fk_related_model_not_in_admin(self):
    277         # FK to a model not registered with admin site. Raw ID widget shoud
     277        # FK to a model not registered with admin site. Raw ID widget should
    278278        # have no magnifying glass link. See #16542
    279279        big_honeycomb = models.Honeycomb.objects.create(location='Old tree')
    280280        big_honeycomb.bee_set.create()
     
    287287        )
    288288
    289289    def test_fk_to_self_model_not_in_admin(self):
    290         # FK to self, not registered with admin site. Raw ID widget shoud have
     290        # FK to self, not registered with admin site. Raw ID widget should have
    291291        # no magnifying glass link. See #16542
    292292        subject1 = models.Individual.objects.create(name='Subject #1')
    293293        models.Individual.objects.create(name='Child', parent=subject1)
     
    345345
    346346    def test_m2m_related_model_not_in_admin(self):
    347347        # M2M relationship with model not registered with admin site. Raw ID
    348         # widget shoud have no magnifying glass link. See #16542
     348        # widget should have no magnifying glass link. See #16542
    349349        consultor1 = models.Advisor.objects.create(name='Rockstar Techie')
    350350
    351351        c1 = models.Company.objects.create(name='Doodle')
  • tests/regressiontests/multiple_database/tests.py

     
    10851085        self.assertEqual(list(pro.authors.values_list('name', flat=True)), [u'Marty Alchin'])
    10861086        self.assertEqual(pro.editor.name, u'Marty Alchin')
    10871087
    1088         # get_or_create is a special case. The get needs to be targetted at
     1088        # get_or_create is a special case. The get needs to be targeted at
    10891089        # the write database in order to avoid potential transaction
    10901090        # consistency problems
    10911091        book, created = Book.objects.get_or_create(title="Pro Django")
  • tests/regressiontests/aggregation_regress/tests.py

     
    644644        )
    645645
    646646        # Regression for #10766 - Shouldn't be able to reference an aggregate
    647         # fields in an an aggregate() call.
     647        # fields in an aggregate() call.
    648648        self.assertRaises(
    649649            FieldError,
    650650            lambda: Book.objects.annotate(mean_age=Avg('authors__age')).annotate(Avg('mean_age'))
  • tests/regressiontests/generic_views/dates.py

     
    339339        self.assertEqual(list(res.context['book_list']), [b])
    340340        self.assertEqual(res.context['day'], future)
    341341
    342         # allow_future but not allow_empty, next/prev amust be valid
     342        # allow_future but not allow_empty, next/prev must be valid
    343343        self.assertEqual(res.context['next_day'], None)
    344344        self.assertEqual(res.context['previous_day'], datetime.date(2008, 10, 1))
    345345
  • extras/csrf_migration_helper.py

     
    4343#
    4444# - It's impossible to programmatically determine which forms should and should
    4545#   not have the token added.  The developer must decide when to do this,
    46 #   ensuring that the token is only added to internally targetted forms.
     46#   ensuring that the token is only added to internally targeted forms.
    4747#
    4848# - It's impossible to programmatically work out when a template is used.  The
    4949#   attempts to trace back to view functions are guesses, and could easily fail
Back to Top