Added the default parameter to the get_multi_lingual_attr() function to allow a different default lanugage for a data model.

This commit is contained in:
2020-07-16 23:18:16 +08:00
parent 418dcd9803
commit e2945045f3
2 changed files with 9 additions and 3 deletions

View File

@ -55,7 +55,7 @@ class Country(models.Model):
@property
def name(self):
if self._name is None:
self._name = get_multi_lingual_attr(self, "name")
self._name = get_multi_lingual_attr(self, "name", "en")
return self._name
@name.setter