Пример #1
0
 def __set__(self, obj, value):
     """Write the localised version of the field this descriptor emulates."""
     local_property = get_localized_field_name(obj, self.name)
     setattr(obj, local_property, value)
Пример #2
0
 def test_meta_get_localized_field_name(self):
     """get_localized_field_name should return the correct localized property name"""
     field = meta_utils.get_localized_field_name(self, 'title')
     assert (field == 'title_en')
Пример #3
0
 def __set__(self, obj, value):
     """Write the localised version of the field this descriptor emulates."""
     local_property = get_localized_field_name(obj, self.name)
     setattr(obj, local_property, value)
Пример #4
0
 def test_meta_get_localized_field_name(self):
     """get_localized_field_name should return the correct localized property name"""
     field = meta_utils.get_localized_field_name(self, 'title')
     assert(field == 'title_en')