Created
July 8, 2019 12:30
-
-
Save vmwsree/b6406f3ff9d641376ec9387a6726ab27 to your computer and use it in GitHub Desktop.
Aws bucket Meeting Room Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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