Skip to content

Instantly share code, notes, and snippets.

@vmwsree
Created July 8, 2019 12:30
Show Gist options
  • Save vmwsree/b6406f3ff9d641376ec9387a6726ab27 to your computer and use it in GitHub Desktop.
Save vmwsree/b6406f3ff9d641376ec9387a6726ab27 to your computer and use it in GitHub Desktop.
Aws bucket Meeting Room Images
from nitwit.website.models import *
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail import delete
x= MeetingRoom.objects.all()
z= MeetingRoomImages.objects.all()
for y in z:
im = get_thumbnail(y.picture, '150x210', crop='center', quality=99)
y.picture_thumb=im.url
y.save()
for y in z:
im = get_thumbnail(y.picture, '720', quality=99)
y.picture_medium=im.url
y.save()
for y in x:
im = get_thumbnail(y.coverimage, '150x210', crop='center', quality=99)
y.coverimage_thumb=im.url
y.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment