Ticket #13827: django-func-kill.diff

File django-func-kill.diff, 7.3 KB (added by Alex, 5 years ago)
  • django/conf/__init__.py

    diff --git a/django/conf/__init__.py b/django/conf/__init__.py
    index d94f6e9..ed1c2fd 100644
    a b class Settings(object): 
    102102                new_installed_apps.append(app)
    103103        self.INSTALLED_APPS = new_installed_apps
    104104
    105         if hasattr(time, 'tzset') and getattr(self, 'TIME_ZONE'):
     105        if hasattr(time, 'tzset') and self.TIME_ZONE:
    106106            # Move the time zone info into os.environ. See ticket #2315 for why
    107107            # we don't do this unconditionally (breaks Windows).
    108108            os.environ['TZ'] = self.TIME_ZONE
  • django/contrib/admin/validation.py

    diff --git a/django/contrib/admin/validation.py b/django/contrib/admin/validation.py
    index bee2891..8d7a8c9 100644
    a b def validate_inline(cls, parent, parent_model): 
    170170    fk = _get_foreign_key(parent_model, cls.model, fk_name=cls.fk_name, can_fail=True)
    171171
    172172    # extra = 3
    173     if not isinstance(getattr(cls, 'extra'), int):
     173    if not isinstance(cls.extra, int):
    174174        raise ImproperlyConfigured("'%s.extra' should be a integer."
    175175                % cls.__name__)
    176176
  • django/contrib/auth/__init__.py

    diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py
    index 169ae01..a184aea 100644
    a b def load_backend(path): 
    2020        cls = getattr(mod, attr)
    2121    except AttributeError:
    2222        raise ImproperlyConfigured('Module "%s" does not define a "%s" authentication backend' % (module, attr))
    23     try:
    24         getattr(cls, 'supports_object_permissions')
    25     except AttributeError:
     23    if not hasattr(cls, "supports_object_permissions"):
    2624        warn("Authentication backends without a `supports_object_permissions` attribute are deprecated. Please define it in %s." % cls,
    2725             PendingDeprecationWarning)
    2826        cls.supports_object_permissions = False
    29     try:
    30         getattr(cls, 'supports_anonymous_user')
    31     except AttributeError:
     27
     28    if not hasattr(cls, 'supports_anonymous_user'):
    3229        warn("Authentication backends without a `supports_anonymous_user` attribute are deprecated. Please define it in %s." % cls,
    3330             PendingDeprecationWarning)
    3431        cls.supports_anonymous_user = False
  • django/contrib/gis/sitemaps/views.py

    diff --git a/django/contrib/gis/sitemaps/views.py b/django/contrib/gis/sitemaps/views.py
    index f3c1da2..152edc9 100644
    a b def kml(request, label, model, field_name=None, compress=False, using=DEFAULT_DB 
    9393        else:
    9494            qs = klass._default_manager.using(using).all()
    9595        for mod in qs:
    96             setattr(mod, 'kml', getattr(mod, field_name).kml)
     96            mod.kml = getattr(mod, field_name).kml)
    9797            placemarks.append(mod)
    9898
    9999    # Getting the render function and rendering to the correct.
  • django/core/cache/__init__.py

    diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py
    index 1b60290..c3bb0e1 100644
    a b def get_cache(backend_uri): 
    6363    else:
    6464        name = scheme
    6565    module = importlib.import_module(name)
    66     return getattr(module, 'CacheClass')(host, params)
     66    return module.CacheClass(host, params)
    6767
    6868cache = get_cache(settings.CACHE_BACKEND)
    6969
  • django/db/models/base.py

    diff --git a/django/db/models/base.py b/django/db/models/base.py
    index 6304e00..43ecbcc 100644
    a b class Model(object): 
    509509                    # autopopulate the _order field
    510510                    field = meta.order_with_respect_to
    511511                    order_value = manager.using(using).filter(**{field.name: getattr(self, field.attname)}).count()
    512                     setattr(self, '_order', order_value)
     512                    self._order = order_value
    513513
    514514                if not pk_set:
    515515                    if force_update:
  • django/db/models/options.py

    diff --git a/django/db/models/options.py b/django/db/models/options.py
    index 5d84ab6..5cf911d 100644
    a b class Options(object): 
    7979            # unique_together can be either a tuple of tuples, or a single
    8080            # tuple of two strings. Normalize it to a tuple of tuples, so that
    8181            # calling code can uniformly expect that.
    82             ut = meta_attrs.pop('unique_together', getattr(self, 'unique_together'))
     82            ut = meta_attrs.pop('unique_together', self.unique_together)
    8383            if ut and not isinstance(ut[0], (tuple, list)):
    8484                ut = (ut,)
    85             setattr(self, 'unique_together', ut)
     85            self.unique_together = ut
    8686
    8787            # verbose_name_plural is a special case because it uses a 's'
    8888            # by default.
    89             setattr(self, 'verbose_name_plural', meta_attrs.pop('verbose_name_plural', string_concat(self.verbose_name, 's')))
     89            self.verbose_name_plural = meta_attrs.pop('verbose_name_plural', string_concat(self.verbose_name, 's'))
    9090
    9191            # Any leftover attributes must be invalid.
    9292            if meta_attrs != {}:
  • django/db/models/query_utils.py

    diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py
    index f75b155..c7b79fe 100644
    a b def deferred_class_factory(model, attrs): 
    256256    deferred attributes to a particular instance of the model.
    257257    """
    258258    class Meta:
    259         pass
    260     setattr(Meta, "proxy", True)
    261     setattr(Meta, "app_label", model._meta.app_label)
     259        proxy = True
     260        app_label = model._meta.app_label
    262261
    263262    # The app_cache wants a unique name for each model, otherwise the new class
    264263    # won't be created (we get an old one back). Therefore, we generate the
  • django/forms/forms.py

    diff --git a/django/forms/forms.py b/django/forms/forms.py
    index b3718ef..343956b 100644
    a b class BaseForm(StrAndUnicode): 
    268268        self._clean_form()
    269269        self._post_clean()
    270270        if self._errors:
    271             delattr(self, 'cleaned_data')
     271            del self.cleaned_data
    272272
    273273    def _clean_fields(self):
    274274        for name, field in self.fields.items():
  • django/test/simple.py

    diff --git a/django/test/simple.py b/django/test/simple.py
    index 9013042..be5550f 100644
    a b class DjangoTestRunner(unittest.TextTestRunner): 
    5858                func(test)
    5959            return stoptest
    6060
    61         setattr(result, 'stopTest', stoptest_override(result.stopTest))
     61        result.stopTest = stoptest_override(result.stopTest)
    6262        return result
    6363
    6464def get_tests(app_module):
  • tests/regressiontests/comment_tests/tests/app_api_tests.py

    diff --git a/tests/regressiontests/comment_tests/tests/app_api_tests.py b/tests/regressiontests/comment_tests/tests/app_api_tests.py
    index c4d9ebf..4015487 100644
    a b class CustomCommentTest(CommentTestCase): 
    4141        del settings.INSTALLED_APPS[-1]
    4242        settings.COMMENTS_APP = self.old_comments_app
    4343        if settings.COMMENTS_APP is None:
    44             delattr(settings._wrapped, 'COMMENTS_APP')
     44            del settings._wrapped.COMMENTS_APP
    4545
    4646    def testGetCommentApp(self):
    4747        from regressiontests.comment_tests import custom_comments
Back to Top