Saving data from a form.

2013-07-22 Thread Nigel Legg
models.py: class DataTable(models.Model): datFile = models.CharField(max_length = 200) structFile = models.CharField(max_length = 200) bannerVar = models.CharField(max_length = 50) stubVar = models.CharField(max_length = 50) stubNets = models.BooleanField() def __unicode__(

Re: Saving data from a form.

2013-07-22 Thread Nigel Legg
Thanks Christian. I'll get my head around this soon, I hope. Regards, Nigel Legg 07914 740972 http://www.trevanianlegg.co.uk http://twitter.com/nigellegg http://uk.linkedin.com/in/nigellegg On 22 July 2013 14:53, Christian Erhardt wrote: > The error lies in this two rows: > > form.save() > Dat

Re: Saving data from a form.

2013-07-22 Thread Christian Erhardt
The error lies in this two rows: form.save() DataTable_id = DataTable.id DataTable is the class, not the instance of the saved object! form.save() returns an instance of what has been saved. So your code should look like this: my_new_datatable_instance = form.save() DataTable_id = my_new_datat