|
|
|
|
@ -170,15 +170,16 @@ class DispatchContentMixin(object): |
|
|
|
|
g.save() |
|
|
|
|
if 'images' in cdata: |
|
|
|
|
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( |
|
|
|
|
gallery=g, |
|
|
|
|
img=ImageObject.objects.get(id=image['img']) |
|
|
|
|
) |
|
|
|
|
if 'img' in image and image['img']: |
|
|
|
|
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( |
|
|
|
|
gallery=g, |
|
|
|
|
img=ImageObject.objects.get(id=image['img']) |
|
|
|
|
) |
|
|
|
|
else: |
|
|
|
|
g = Gallery( |
|
|
|
|
position=cdata['position'], |
|
|
|
|
@ -190,15 +191,16 @@ class DispatchContentMixin(object): |
|
|
|
|
g.save() |
|
|
|
|
if 'images' in cdata: |
|
|
|
|
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( |
|
|
|
|
gallery=g, |
|
|
|
|
img=ImageObject.objects.get(id=image['img']) |
|
|
|
|
) |
|
|
|
|
if 'img' in image and image['img']: |
|
|
|
|
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( |
|
|
|
|
gallery=g, |
|
|
|
|
img=ImageObject.objects.get(id=image['img']) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DispatchMaterialMixin(object): |
|
|
|
|
|