Merge branch 'feature/collect' into 'develop'
Fix See merge request gm/gm-backend!91
This commit is contained in:
commit
975063b3f8
|
|
@ -22,7 +22,7 @@ class Command(BaseCommand):
|
||||||
-- a.attachment_file_name,
|
-- a.attachment_file_name,
|
||||||
-- a.attachment_content_type,
|
-- a.attachment_content_type,
|
||||||
-- a.attachment_file_size,
|
-- a.attachment_file_size,
|
||||||
-- a.attachment_suffix_url,
|
a.attachment_suffix_url,
|
||||||
-- active as is_publish,
|
-- active as is_publish,
|
||||||
a.country_code,
|
a.country_code,
|
||||||
-- a.geometries,
|
-- a.geometries,
|
||||||
|
|
@ -80,7 +80,7 @@ class Command(BaseCommand):
|
||||||
-- a.attachment_file_name,
|
-- a.attachment_file_name,
|
||||||
-- a.attachment_content_type,
|
-- a.attachment_content_type,
|
||||||
-- a.attachment_file_size,
|
-- a.attachment_file_size,
|
||||||
-- a.attachment_suffix_url,
|
a.attachment_suffix_url,
|
||||||
-- active as is_publish,
|
-- active as is_publish,
|
||||||
a.country_code,
|
a.country_code,
|
||||||
a.description
|
a.description
|
||||||
|
|
@ -97,7 +97,8 @@ class Command(BaseCommand):
|
||||||
country=country,
|
country=country,
|
||||||
description=obj['description'],
|
description=obj['description'],
|
||||||
slug=obj['slug'], old_id=obj['collection_id'],
|
slug=obj['slug'], old_id=obj['collection_id'],
|
||||||
start=obj['start']
|
start=obj['start'],
|
||||||
|
image_url=obj['attachment_suffix_url']
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Collection.objects.bulk_create(objects)
|
Collection.objects.bulk_create(objects)
|
||||||
|
|
@ -159,6 +160,8 @@ class Command(BaseCommand):
|
||||||
if est.exists():
|
if est.exists():
|
||||||
inst = est.first()
|
inst = est.first()
|
||||||
collect = Collection.objects.filter(old_id=obj['collection_id'])
|
collect = Collection.objects.filter(old_id=obj['collection_id'])
|
||||||
for c in collect:
|
print(f'COLLECT COUNT {collect.count()}')
|
||||||
inst.collections.add(c)
|
inst.collections.add(*list(collect))
|
||||||
|
# for c in collect:
|
||||||
|
# inst.collections.add(c)
|
||||||
inst.save()
|
inst.save()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user