Remove old-style of super() calls

This commit is contained in:
Nicolas Évrard
2025-04-04 00:45:18 +02:00
parent 5781a49606
commit cbdad75620
350 changed files with 1235 additions and 1235 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ __version__ = "7.5.0"
class _GeoJSON(dict):
def __init__(self, *args, **kwargs):
super(_GeoJSON, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
if 'meta' not in self:
self['meta'] = {}
if 'srid' not in self['meta']:
+2 -2
View File
@@ -21,7 +21,7 @@ class Geometry(fields.Field):
_geometry_type = 'GEOMETRY'
def __init__(self, string="", dimension=2, loading='lazy', **kwargs):
super(Geometry, self).__init__(
super().__init__(
string=string, loading=loading, **kwargs)
self.dimension = dimension
@@ -34,7 +34,7 @@ class Geometry(fields.Field):
def sql_format(self, value):
if isinstance(value, dict):
return _GeoJSON(value)
return super(Geometry, self).sql_format(value)
return super().sql_format(value)
def convert_domain(self, domain, tables, Model):
table, _ = tables[None]
+1 -1
View File
@@ -23,7 +23,7 @@ class Database(PGDatabase):
@classmethod
def create(cls, connection, database_name):
super(Database, cls).create(connection, database_name)
super().create(connection, database_name)
database = cls(database_name)
with database.get_connection() as db_connection:
+1 -1
View File
@@ -16,7 +16,7 @@ class TableHandler(PGTableHandler):
if abstract_type.startswith('GIS_'):
column_adder = self.add_geometry_column
else:
column_adder = super(TableHandler, self).add_column
column_adder = super().add_column
column_adder(column_name, abstract_type, default, comment)
def add_geometry_column(self, column_name, abstract_type, default_fun=None,