diff --git a/apps/location/migrations/0036_auto_20200127_2004.py b/apps/location/migrations/0036_auto_20200127_2004.py index af475a6a..4dcb5132 100644 --- a/apps/location/migrations/0036_auto_20200127_2004.py +++ b/apps/location/migrations/0036_auto_20200127_2004.py @@ -38,4 +38,8 @@ class Migration(migrations.Migration): field=utils.models.TJSONField(default=None, help_text='{"en-GB":"some city name"}', null=True, verbose_name='City name json'), ), migrations.RunPython(preserve_field_data, migrations.RunPython.noop), + migrations.RemoveField( + model_name='city', + name='name_translated', + ) ] diff --git a/apps/location/models.py b/apps/location/models.py index 36eb575a..ed12ad4f 100644 --- a/apps/location/models.py +++ b/apps/location/models.py @@ -143,14 +143,10 @@ class CityQuerySet(models.QuerySet): return self.prefetch_related('country', 'region', 'region__country') -class City(models.Model): +class City(models.Model, TranslatedFieldsMixin): """Region model.""" name = TJSONField(default=None, null=True, help_text='{"en-GB":"some city name"}', verbose_name=_('City name json')) - - name_translated = TJSONField(blank=True, null=True, default=None, - verbose_name=_('Translated name'), - help_text='{"en-GB":"some text"}') code = models.CharField(_('code'), max_length=250) region = models.ForeignKey(Region, on_delete=models.CASCADE, blank=True, null=True,