Re-format all files

This commit is contained in:
Swen Kooij
2019-10-19 12:43:17 +03:00
parent 4ee1a5f487
commit 7cdd1f4490
41 changed files with 836 additions and 812 deletions

View File

@@ -3,8 +3,7 @@ from django.utils import six, translation
class LocalizedValueDescriptor:
"""
The descriptor for the localized value attribute on the model instance.
"""The descriptor for the localized value attribute on the model instance.
Returns a :see:LocalizedValue when accessed so you can do stuff like::
>>> from myapp.models import MyModel
@@ -60,6 +59,8 @@ class LocalizedValueDescriptor:
def __set__(self, instance, value):
if isinstance(value, six.string_types):
language = translation.get_language() or settings.LANGUAGE_CODE
self.__get__(instance).set(language, value) # pylint: disable=no-member
self.__get__(instance).set(
language, value
) # pylint: disable=no-member
else:
instance.__dict__[self.field.name] = value