i cant really understand what is the problem i have this model :
class Upload_files(models.Model): #uploaded files(for approval) are stored here
file=models.FileField(upload_to=""+strftime("%j", gmtime())+"/")
cont = models.ForeignKey(Contractor)
def __unicode__(self):
return self.file.name
and the form :
class uploadFile(forms.ModelForm):
file = forms.FileField(label=(u'file'))
cont = forms.ModelChoiceField(label="cont",
queryset=Contractor.objects.all(),
required = False
)
and in the method that i create in it the object :
cont = Contractor.objects.get(id=contractor_id)
file = Upload_files.objects.create(file=file,cont=cont)
file.save()
and thats the error that i get :
shoghlanah_upload_files has no column named cont_id
i cant really understand whats wrong with my code so please any ideas ?
You need to either delete your database and recreate it using
syncdb, or setupsouthand run a migration on your current database.