with address

This commit is contained in:
alex 2019-10-28 10:59:28 +03:00
parent 49dbc9c72e
commit 4e0f3c9a4d
7 changed files with 78 additions and 2 deletions

View File

@ -53,6 +53,7 @@ class EstablishmentAdmin(admin.ModelAdmin):
inlines = [
AwardInline, ContactPhoneInline, ContactEmailInline,
ReviewInline, CommentInline]
raw_id_fields = ('address',)
@admin.register(models.Position)

View File

@ -0,0 +1,20 @@
# Generated by Django 2.2.4 on 2019-10-25 09:14
from django.db import migrations
import sorl.thumbnail.fields
import utils.methods
class Migration(migrations.Migration):
dependencies = [
('gallery', '0004_merge_20191025_0906'),
]
operations = [
migrations.AlterField(
model_name='image',
name='image',
field=sorl.thumbnail.fields.ImageField(upload_to=utils.methods.image_path, verbose_name='image file'),
),
]

View File

@ -0,0 +1,14 @@
# Generated by Django 2.2.4 on 2019-10-27 17:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gallery', '0005_auto_20191027_0756'),
('gallery', '0005_auto_20191025_0914'),
]
operations = [
]

View File

@ -0,0 +1,14 @@
# Generated by Django 2.2.4 on 2019-10-28 07:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0020_merge_20191025_0423'),
('main', '0022_auto_20191023_1113'),
]
operations = [
]

View File

@ -0,0 +1,14 @@
# Generated by Django 2.2.4 on 2019-10-28 07:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('news', '0029_merge_20191025_0906'),
('news', '0023_merge_20191025_0423'),
]
operations = [
]

View File

@ -3,7 +3,7 @@ from django.db import transaction
from rest_framework import serializers
from establishment.models import Establishment, ContactEmail, ContactPhone, EstablishmentType
# from location.models import Address
from location.models import Address
from timetable.models import Timetable
from utils.legacy_parser import parse_legacy_schedule_content
from utils.slug_generator import generate_unique_slug
@ -86,8 +86,11 @@ class EstablishmentSerializer(serializers.ModelSerializer):
@staticmethod
def get_address(address):
# return Address.objects.filter(old_id=address).first()
address = Address.objects.filter(old_id=address).first()
if address:
return address.id
return None
# return None
@staticmethod
def get_type(data):

View File

@ -54,6 +54,8 @@ services:
image: redis:2.8.23
ports:
- "6379:6379"
networks:
- redis_network
# RabbitMQ
#rabbitmq:
@ -78,6 +80,8 @@ services:
- db
# - rabbitmq
- redis
networks:
- redis_network
worker_beat:
build: .
@ -95,6 +99,9 @@ services:
- db
# - rabbitmq
- redis
networks:
- redis_network
# App: G&M
gm_app:
build: .
@ -120,6 +127,7 @@ services:
ports:
- "8000:8000"
networks:
- redis_network
- database_network
- mysql_network
- elasticsearch_network
@ -143,3 +151,5 @@ networks:
driver: bridge
elasticsearch_network:
driver: bridge
redis_network:
driver: bridge