title: Where to call a celery task on model save
body: <p>I need to call a celery task when saving a model. I have conflicting imports that I do not know how to resolve. I am wondering if anyone knows another way I can structure this to avoid conflicting imports</p>
  
  <pre><code>models.py
  from .tasks import celery_task
  
  class Picture(PolymorphicModel):
      file = models.ImageField()
      processed_file = models.ImageField(blank=True, null=True)
      ...
      def save(self, *args, **kwargs):
          if self.file:
              self.processed_file = celery_task.delay(self.id, other_arg)
          super(Picture, self).save(*args, **kwargs)
  
  
  
  
  tasks.py
  from .models import Picture
  
  @task
  def celery_task(id, other_arg):
      try:
          picture = Picture.objects.get(id=id)
      except ObjectDoesNotExist:
          picture = None
  
      if picture:
          return some_other_function(picture.file)
  
      return None
  </code></pre>