mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #28370 -- Deprecated the context arg of Field.from_db_value() and Expression.convert_value().
Unused since a0d166306f
.
This commit is contained in:
parent
8d5095d8a3
commit
487362fa8f
28 changed files with 124 additions and 60 deletions
|
@ -17,7 +17,7 @@ class CashField(models.DecimalField):
|
|||
kwargs['decimal_places'] = 2
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def from_db_value(self, value, expression, connection, context):
|
||||
def from_db_value(self, value, expression, connection):
|
||||
cash = Cash(value)
|
||||
cash.vendor = connection.vendor
|
||||
return cash
|
||||
|
@ -28,3 +28,12 @@ class CashModel(models.Model):
|
|||
|
||||
def __str__(self):
|
||||
return str(self.cash)
|
||||
|
||||
|
||||
class CashFieldDeprecated(CashField):
|
||||
def from_db_value(self, value, expression, connection, context):
|
||||
return super().from_db_value(value, expression, connection)
|
||||
|
||||
|
||||
class CashModelDeprecated(models.Model):
|
||||
cash = CashFieldDeprecated()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue