title: How to pass an object between views in Django
body: <p>I have the following model for my students to upload their tasks to an application that I am creating, but I have a problem, I need to pass an instance of the model between views, but since it is not serializable, I can not save it in a session attribute. Keep in mind that in one view I create the object without saving it in the database and in the other I perform operations with the object and finally I save it. Any idea how I can do this?</p>
  
  <pre><code>from gdstorage.storage import GoogleDriveStorage
  
  gd_storage = GoogleDriveStorage()
  
  class Homework(models.Model):
      code = models.AutoField(primary_key=True)
      student = models.ForeignKey('Student', on_delete=models.PROTECT)
      title = models.CharField(unique=True, max_length=100)
      attached_file = models.FileField(upload_to='files/homeworks/', validators=[validate_file_size], storage=gd_storage)
  </code></pre>