I'm using a model and a form in django to collect some text information
class Longlist(models.Model):
text_input = models.CharField(max_length=3000, default='First Last email')
def __unicode__(self):
return self.text_input
Once I've collected this information, I don't need to keep it. What is the best way to clear the instances from the model? I'm just learning django so I don't know if an ever increasing index matters or not.
Longlist.objects.all().delete()
Deletes the instances but I think the index always increases every time my form is submitted. I don't know if this is a problem, and I'm not sure I know how to retrieve Longlist.text_input if I don't know what the current id is. eg if the form has been submitted 43 times, I would need to know this so I could get my information from Longlist.text_input(id=42). I do want to run the view/form over and over though, so I thought it would be easiest if my view always looks for Longlist.text_input(id=0)
Perhaps this is a good solution but I'm not sure: django model: objects.all().delete() doesn't