I too had this issue until I found out I was going about it the wrong
way. See Django docs -
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form
Your code should be :-
formContent = PropertyForm(request.POST)
form_instance = formContent.save(commi
class Property(models.Model):
property_id = models.AutoField(primary_key = True)
property_name = models.CharField("Name", max_length = 30)
user = models.ForeignKey(User)
class PropertyForm(ModelForm):
class Meta:
model = Property
exclude = ('user')
def addProperty(request):
for
2 matches
Mail list logo