Skip to content

Commit 9ed9d74

Browse files
committed
Fix flake8 error about assignment of lambda varialbes
1 parent c35f6c4 commit 9ed9d74

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

domain_models/fields.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
class Field(property):
1111
"""Base field."""
1212

13-
_converter = lambda _, value: value
14-
"""Convert raw input value of the field."""
15-
1613
def __init__(self, default=None):
1714
"""Initializer."""
1815
super(Field, self).__init__(self.get_value, self.set_value)
@@ -57,40 +54,49 @@ def set_value(self, model, value):
5754
value = self._converter(value)
5855
setattr(model, self.storage_name, value)
5956

57+
def _converter(self, value):
58+
"""Convert raw input value of the field."""
59+
return value
60+
6061

6162
class Bool(Field):
6263
"""Bool field."""
6364

64-
_converter = lambda _, value: bool(value)
65-
"""Convert raw input value of the field."""
65+
def _converter(self, value):
66+
"""Convert raw input value of the field."""
67+
return bool(value)
6668

6769

6870
class Int(Field):
6971
"""Int field."""
7072

71-
_converter = lambda _, value: int(value)
72-
"""Convert raw input value of the field."""
73+
def _converter(self, value):
74+
"""Convert raw input value of the field."""
75+
return int(value)
7376

7477

7578
class Float(Field):
7679
"""Float field."""
7780

78-
_converter = lambda _, value: float(value)
79-
"""Convert raw input value of the field."""
81+
def _converter(self, value):
82+
"""Convert raw input value of the field."""
83+
return float(value)
8084

8185

8286
class String(Field):
8387
"""String field."""
8488

85-
_converter = lambda _, value: str(value)
86-
"""Convert raw input value of the field."""
89+
def _converter(self, value):
90+
"""Convert raw input value of the field."""
91+
return str(value)
8792

8893

8994
class Binary(Field):
9095
"""Binary field."""
9196

92-
_converter = lambda _, value: six.binary_type(value)
93-
"""Convert raw input value of the field."""
97+
def _converter(self, value):
98+
"""Convert raw input value of the field."""
99+
return six.binary_type(value)
94100

95101

96102
class Date(Field):

0 commit comments

Comments
 (0)