Skip to content

Instantly share code, notes, and snippets.

@soukiassianb
Last active September 3, 2015 07:54
Show Gist options
  • Save soukiassianb/3c5365f5427dd1c19588 to your computer and use it in GitHub Desktop.
Save soukiassianb/3c5365f5427dd1c19588 to your computer and use it in GitHub Desktop.

models.py

class Edito(models.Model):
	title = models.CharField(max_length=50)
	cover_picture = models.ImageField(upload_to=edito_picture_upload_path, blank=True, null=True)
	picture = CloudinaryField('image', blank=True, null=True)

script

editos = Edito.objects.all()
for edito in editos:
    if edito.picture is None:
        edito.picture = edito.cover_picture # I know it doesn't work !
        edito.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment