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_content_type,
|
||||
-- a.attachment_file_size,
|
||||
-- a.attachment_suffix_url,
|
||||
a.attachment_suffix_url,
|
||||
-- active as is_publish,
|
||||
a.country_code,
|
||||
-- a.geometries,
|
||||
|
|
@ -80,7 +80,7 @@ class Command(BaseCommand):
|
|||
-- a.attachment_file_name,
|
||||
-- a.attachment_content_type,
|
||||
-- a.attachment_file_size,
|
||||
-- a.attachment_suffix_url,
|
||||
a.attachment_suffix_url,
|
||||
-- active as is_publish,
|
||||
a.country_code,
|
||||
a.description
|
||||
|
|
@ -97,7 +97,8 @@ class Command(BaseCommand):
|
|||
country=country,
|
||||
description=obj['description'],
|
||||
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)
|
||||
|
|
@ -159,6 +160,8 @@ class Command(BaseCommand):
|
|||
if est.exists():
|
||||
inst = est.first()
|
||||
collect = Collection.objects.filter(old_id=obj['collection_id'])
|
||||
for c in collect:
|
||||
inst.collections.add(c)
|
||||
print(f'COLLECT COUNT {collect.count()}')
|
||||
inst.collections.add(*list(collect))
|
||||
# for c in collect:
|
||||
# inst.collections.add(c)
|
||||
inst.save()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user