class AnalysisInput(models.Model):
    input_user = models.CharField(max_length=45)
input_title = models.CharField(max_length=45)
input_date = models.DateTimeField()
input_link = models.CharField(max_length=100)

def as_json(self):
    return dict(input_id=self.id, input_user=self.input_user, input_title=
        self.input_title, input_date=self.input_date.isoformat(),
        input_link=self.input_link)
How to serialize to JSON a list of model objects in django/python