|
|
|
|
@ -85,10 +85,15 @@ class DispatchContentMixin(object): |
|
|
|
|
g.save() |
|
|
|
|
if 'images' in cdata: |
|
|
|
|
for image in cdata['images']: |
|
|
|
|
gi = GalleryImage.objects.create( |
|
|
|
|
gallery=g, |
|
|
|
|
img=ImageObject.objects.get(id=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.objects.create( |
|
|
|
|
course=course, |
|
|
|
|
@ -97,10 +102,15 @@ class DispatchContentMixin(object): |
|
|
|
|
) |
|
|
|
|
if 'images' in cdata: |
|
|
|
|
for image in cdata['images']: |
|
|
|
|
gi = GalleryImage.objects.create( |
|
|
|
|
gallery=g, |
|
|
|
|
img=ImageObject.objects.get(id=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): |
|
|
|
|
|