1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Update converters to take a consistent set of parameters.

As suggested by Anssi. This has the slightly strange side effect of
passing the expression to Expression.convert_value has the expression
passed back to it, but it allows more complex patterns of expressions.
This commit is contained in:
Marc Tamlyn
2015-02-20 10:53:59 +00:00
parent 4755f8fc25
commit 32d4db66b9
19 changed files with 44 additions and 46 deletions

View File

@@ -18,7 +18,7 @@ class CashField(models.DecimalField):
kwargs['decimal_places'] = 2
super(CashField, self).__init__(**kwargs)
def from_db_value(self, value, connection, context):
def from_db_value(self, value, expression, connection, context):
cash = Cash(value)
cash.vendor = connection.vendor
return cash