Conditions | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
13 | def set(self, object, value): |
||
14 | """Set the field's value to the given object. |
||
15 | The value is converted to a Unicode string to preserve compatibility |
||
16 | with the legacy behavior of auto-generated setters in AT content types. |
||
17 | Leading and trailing whitespaces are removed before assignment. |
||
18 | """ |
||
19 | value = safe_unicode(value) |
||
20 | if isinstance(value, six.string_types): |
||
21 | value = value.strip() |
||
22 | super(TextLineField, self).set(object, value) |
||
23 | |||
33 |