|
|
|
@ -85,6 +85,11 @@ class DispatchContentMixin(object): |
|
|
|
g.save() |
|
|
|
g.save() |
|
|
|
if 'images' in cdata: |
|
|
|
if 'images' in cdata: |
|
|
|
for image in cdata['images']: |
|
|
|
for image in cdata['images']: |
|
|
|
|
|
|
|
if 'id' in image and image['id']: |
|
|
|
|
|
|
|
gi = GalleryImage.objects.get(id=image['id']) |
|
|
|
|
|
|
|
gi.img = ImageObject.objects.get(id=image['img']) |
|
|
|
|
|
|
|
gi.save() |
|
|
|
|
|
|
|
else: |
|
|
|
gi = GalleryImage.objects.create( |
|
|
|
gi = GalleryImage.objects.create( |
|
|
|
gallery=g, |
|
|
|
gallery=g, |
|
|
|
img=ImageObject.objects.get(id=image['img']) |
|
|
|
img=ImageObject.objects.get(id=image['img']) |
|
|
|
@ -97,9 +102,14 @@ class DispatchContentMixin(object): |
|
|
|
) |
|
|
|
) |
|
|
|
if 'images' in cdata: |
|
|
|
if 'images' in cdata: |
|
|
|
for image in cdata['images']: |
|
|
|
for image in cdata['images']: |
|
|
|
|
|
|
|
if 'id' in image and image['id']: |
|
|
|
|
|
|
|
gi = GalleryImage.objects.get(id=image['id']) |
|
|
|
|
|
|
|
gi.img = ImageObject.objects.get(id=image['img']) |
|
|
|
|
|
|
|
gi.save() |
|
|
|
|
|
|
|
else: |
|
|
|
gi = GalleryImage.objects.create( |
|
|
|
gi = GalleryImage.objects.create( |
|
|
|
gallery=g, |
|
|
|
gallery=g, |
|
|
|
img=ImageObject.objects.get(id=image['img']), |
|
|
|
img=ImageObject.objects.get(id=image['img']) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|