django : Display modelformset, then edit, then save -
I'm looking for a simple modelformset example - I have a model
class Category(BaseModel):
categoryText = db.StringProperty()
parentCat = db.IntegerProperty()
I am trying to create a formset to display all available Categories wihle they all could be edited and then submit the edits.
I am getting stuck where I get error that the fields are not editable. According to the documentation I should set Category field editable=True - however there is no information about where I do that. I've tried to set it in the 开发者_StackOverflow社区model but I get errors. and in the Form, I don't declare fields since it's a modelform !
when I try to display this formset I get : 'StringProperty' object has no attribute 'editable'
I would appreciate any help - a basic example of the view and the model, form classes would really help.
I figured it out - I was using appengine helper as a patch to get django working - this patch does not support model formsets. Must use GAE version of forms which is not as rich as Django.
For this reason I switched from appengine helper to non-rel - although I had some issues during install, this version of the patch is complete. Django now works as described in documentation.
non-rel seems to be a better choice if you are new and trying to learn Django from the available docs.
精彩评论