Last active
June 12, 2018 08:47
-
-
Save BuildWithLal/9c6ef538e2b6bdadc4507398c7324419 to your computer and use it in GitHub Desktop.
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
# image create view | |
if form.is_valid(): | |
images = Image.objects.order_by('-_id').all() | |
if len(images)>0: | |
# get latest image scene number | |
scene_number = Images.first().scene_number + 1 | |
else: | |
# creating first image so set scene_number =1 | |
scene_number = 1 | |
image = form.save() | |
image.scene_number = scene_number | |
# set image.image | |
# set image.video | |
# save image finally | |
image.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment