Add fields
This commit is contained in:
parent
cf7cc9bd0c
commit
6bac3fc9c2
14
apps/location/migrations/0028_merge_20191115_1302.py
Normal file
14
apps/location/migrations/0028_merge_20191115_1302.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Generated by Django 2.2.7 on 2019-11-15 13:02
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('location', '0027_auto_20191110_1331'),
|
||||
('location', '0023_auto_20191112_0104'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
14
apps/location/migrations/0029_merge_20191116_1132.py
Normal file
14
apps/location/migrations/0029_merge_20191116_1132.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Generated by Django 2.2.7 on 2019-11-16 11:32
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('location', '0028_merge_20191115_1302'),
|
||||
('location', '0026_country_is_active'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
29
apps/location/migrations/0030_auto_20191116_1151.py
Normal file
29
apps/location/migrations/0030_auto_20191116_1151.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Generated by Django 2.2.7 on 2019-11-16 11:51
|
||||
|
||||
import django.contrib.postgres.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('location', '0029_merge_20191116_1132'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='city',
|
||||
name='mysql_ids',
|
||||
field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='country',
|
||||
name='mysql_ids',
|
||||
field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='region',
|
||||
name='mysql_ids',
|
||||
field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None),
|
||||
),
|
||||
]
|
||||
|
|
@ -6,6 +6,8 @@ from django.db.transaction import on_commit
|
|||
from django.dispatch import receiver
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
|
||||
from translation.models import Language
|
||||
from utils.models import (ProjectBaseMixin, SVGImageMixin, TJSONField,
|
||||
TranslatedFieldsMixin, get_current_locale)
|
||||
|
|
@ -39,6 +41,8 @@ class Country(TranslatedFieldsMixin, SVGImageMixin, ProjectBaseMixin):
|
|||
is_active = models.BooleanField(_('is active'), default=True)
|
||||
old_id = models.IntegerField(null=True, blank=True, default=None)
|
||||
|
||||
mysql_ids = ArrayField(models.IntegerField(), blank=True, null=True)
|
||||
|
||||
objects = CountryQuerySet.as_manager()
|
||||
|
||||
@property
|
||||
|
|
@ -77,6 +81,7 @@ class Region(models.Model):
|
|||
country = models.ForeignKey(
|
||||
Country, verbose_name=_('country'), on_delete=models.CASCADE)
|
||||
old_id = models.IntegerField(null=True, blank=True, default=None)
|
||||
mysql_ids = ArrayField(models.IntegerField(), blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
"""Meta class."""
|
||||
|
|
@ -121,6 +126,8 @@ class City(models.Model):
|
|||
|
||||
gallery = models.ManyToManyField('gallery.Image', through='location.CityGallery', blank=True)
|
||||
|
||||
mysql_ids = ArrayField(models.IntegerField(), blank=True, null=True)
|
||||
|
||||
objects = CityQuerySet.as_manager()
|
||||
|
||||
class Meta:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user