Skip to content

Instantly share code, notes, and snippets.

@ChristinaMeno
Created April 20, 2011 17:06
Show Gist options
  • Save ChristinaMeno/931960 to your computer and use it in GitHub Desktop.
Save ChristinaMeno/931960 to your computer and use it in GitHub Desktop.
what_i_want = dict(
name = performer.name,
slug = slug,
sound_description = performer.short_bio,
history = performer.long_bio,
eventful_id = performer.id,
primary_category_id = PERFORMER_CATEGORY,
website = website,
)
updated = self.force_update
band = None
try:
band = MedleyBand.objects.get(**what_i_want)
except MedleyBand.DoesNotExist:
band = MedleyBand.objects.get_or_create(eventful_id= performer.id)
band.update(**what_i_want)
updated = True
if updated or self.force_update:
band.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment