mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Applied Black's 2024 stable style.
https://github.com/psf/black/releases/tag/24.1.0
This commit is contained in:
@@ -455,17 +455,13 @@ database-compatible values. A custom field might look something like::
|
||||
class CustomModelField(models.Field):
|
||||
...
|
||||
|
||||
def db_type(self):
|
||||
...
|
||||
def db_type(self): ...
|
||||
|
||||
def get_db_prep_save(self, value):
|
||||
...
|
||||
def get_db_prep_save(self, value): ...
|
||||
|
||||
def get_db_prep_value(self, value):
|
||||
...
|
||||
def get_db_prep_value(self, value): ...
|
||||
|
||||
def get_db_prep_lookup(self, lookup_type, value):
|
||||
...
|
||||
def get_db_prep_lookup(self, lookup_type, value): ...
|
||||
|
||||
In 1.2, these three methods have undergone a change in prototype, and
|
||||
two extra methods have been introduced::
|
||||
@@ -473,23 +469,17 @@ two extra methods have been introduced::
|
||||
class CustomModelField(models.Field):
|
||||
...
|
||||
|
||||
def db_type(self, connection):
|
||||
...
|
||||
def db_type(self, connection): ...
|
||||
|
||||
def get_prep_value(self, value):
|
||||
...
|
||||
def get_prep_value(self, value): ...
|
||||
|
||||
def get_prep_lookup(self, lookup_type, value):
|
||||
...
|
||||
def get_prep_lookup(self, lookup_type, value): ...
|
||||
|
||||
def get_db_prep_save(self, value, connection):
|
||||
...
|
||||
def get_db_prep_save(self, value, connection): ...
|
||||
|
||||
def get_db_prep_value(self, value, connection, prepared=False):
|
||||
...
|
||||
def get_db_prep_value(self, value, connection, prepared=False): ...
|
||||
|
||||
def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
|
||||
...
|
||||
def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False): ...
|
||||
|
||||
These changes are required to support multiple databases --
|
||||
``db_type`` and ``get_db_prep_*`` can no longer make any assumptions
|
||||
|
||||
Reference in New Issue
Block a user