Removed unneeded __init__() methods.
This commit is contained in:
parent
44a6c27fd4
commit
8b2515a450
|
@ -52,6 +52,10 @@ class AbstractBaseUser(models.Model):
|
|||
|
||||
REQUIRED_FIELDS = []
|
||||
|
||||
# Stores the raw password if set_password() is called so that it can
|
||||
# be passed to password_changed() after the model is saved.
|
||||
_password = None
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
@ -59,12 +63,6 @@ class AbstractBaseUser(models.Model):
|
|||
"Return the identifying username for this User"
|
||||
return getattr(self, self.USERNAME_FIELD)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
# Stores the raw password if set_password() is called so that it can
|
||||
# be passed to password_changed() after the model is saved.
|
||||
self._password = None
|
||||
|
||||
def __str__(self):
|
||||
return self.get_username()
|
||||
|
||||
|
|
|
@ -374,9 +374,6 @@ class AnonymousUser:
|
|||
_groups = EmptyManager(Group)
|
||||
_user_permissions = EmptyManager(Permission)
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def __str__(self):
|
||||
return 'AnonymousUser'
|
||||
|
||||
|
|
|
@ -103,6 +103,14 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
|
|||
|
||||
Adapter = PostGISAdapter
|
||||
|
||||
collect = geom_func_prefix + 'Collect'
|
||||
extent = geom_func_prefix + 'Extent'
|
||||
extent3d = geom_func_prefix + '3DExtent'
|
||||
length3d = geom_func_prefix + '3DLength'
|
||||
makeline = geom_func_prefix + 'MakeLine'
|
||||
perimeter3d = geom_func_prefix + '3DPerimeter'
|
||||
unionagg = geom_func_prefix + 'Union'
|
||||
|
||||
gis_operators = {
|
||||
'bbcontains': PostGISOperator(op='~', raster=True),
|
||||
'bboverlaps': PostGISOperator(op='&&', geography=True, raster=True),
|
||||
|
@ -137,19 +145,6 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
|
|||
select = '%s::bytea'
|
||||
select_extent = None
|
||||
|
||||
def __init__(self, connection):
|
||||
super().__init__(connection)
|
||||
|
||||
prefix = self.geom_func_prefix
|
||||
|
||||
self.collect = prefix + 'Collect'
|
||||
self.extent = prefix + 'Extent'
|
||||
self.extent3d = prefix + '3DExtent'
|
||||
self.length3d = prefix + '3DLength'
|
||||
self.makeline = prefix + 'MakeLine'
|
||||
self.perimeter3d = prefix + '3DPerimeter'
|
||||
self.unionagg = prefix + 'Union'
|
||||
|
||||
@cached_property
|
||||
def function_names(self):
|
||||
function_names = {
|
||||
|
|
|
@ -132,9 +132,6 @@ class TemporaryFileUploadHandler(FileUploadHandler):
|
|||
"""
|
||||
Upload handler that streams data into a temporary file.
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def new_file(self, *args, **kwargs):
|
||||
"""
|
||||
Create the file object to append to as data is coming in.
|
||||
|
|
|
@ -13,14 +13,12 @@ logger = logging.getLogger('django.request')
|
|||
|
||||
|
||||
class BaseHandler:
|
||||
|
||||
def __init__(self):
|
||||
self._request_middleware = None
|
||||
self._view_middleware = None
|
||||
self._template_response_middleware = None
|
||||
self._response_middleware = None
|
||||
self._exception_middleware = None
|
||||
self._middleware_chain = None
|
||||
_request_middleware = None
|
||||
_view_middleware = None
|
||||
_template_response_middleware = None
|
||||
_response_middleware = None
|
||||
_exception_middleware = None
|
||||
_middleware_chain = None
|
||||
|
||||
def load_middleware(self):
|
||||
"""
|
||||
|
|
|
@ -10,10 +10,7 @@ class Command(BaseCommand):
|
|||
|
||||
# DiscoverRunner runs the checks after databases are set up.
|
||||
requires_system_checks = False
|
||||
|
||||
def __init__(self):
|
||||
self.test_runner = None
|
||||
super().__init__()
|
||||
test_runner = None
|
||||
|
||||
def run_from_argv(self, argv):
|
||||
"""
|
||||
|
|
|
@ -23,6 +23,7 @@ class DatabaseOperations(BaseDatabaseOperations):
|
|||
'PositiveSmallIntegerField': (0, 99999999999),
|
||||
'PositiveIntegerField': (0, 99999999999),
|
||||
}
|
||||
set_operators = dict(BaseDatabaseOperations.set_operators, difference='MINUS')
|
||||
|
||||
# TODO: colorize this SQL code with style.SQL_KEYWORD(), etc.
|
||||
_sequence_reset_sql = """
|
||||
|
@ -52,10 +53,6 @@ END;
|
|||
# Oracle doesn't support string without precision; use the max string size.
|
||||
cast_char_field_without_max_length = 'NVARCHAR2(2000)'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.set_operators['difference'] = 'MINUS'
|
||||
|
||||
def cache_key_culling_sql(self):
|
||||
return """
|
||||
SELECT cache_key
|
||||
|
|
|
@ -52,9 +52,6 @@ class ConcatPair(Func):
|
|||
"""
|
||||
function = 'CONCAT'
|
||||
|
||||
def __init__(self, left, right, **extra):
|
||||
super().__init__(left, right, **extra)
|
||||
|
||||
def as_sqlite(self, compiler, connection):
|
||||
coalesced = self.coalesce()
|
||||
return super(ConcatPair, coalesced).as_sql(
|
||||
|
|
|
@ -1056,10 +1056,7 @@ class SQLCompiler:
|
|||
|
||||
|
||||
class SQLInsertCompiler(SQLCompiler):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.return_id = False
|
||||
super().__init__(*args, **kwargs)
|
||||
return_id = False
|
||||
|
||||
def field_as_sql(self, field, val):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue