I have a model with 5 entities and intend to create a form (on the
same page) but do not know how to integrate more than one form.
In my main, i can play very well with the forms and write to database,
but I need to put more fields on the page.
These fields are of different models.
My models:
Teacher, Account(ReferenceProperty), Experience (ReferenceProperty),
ServiceDistribution(ReferenceProperty), Experience(ReferenceProperty)
My forms:
class TeacherForm(djangoforms.ModelForm):
class Meta:
model =models.Teacher
exclude = ['user']
and the same for other models
My Main:
class CreateCvHandler(webapp.RequestHandler):
def post(self):
if self.request.get('EscTeacher'):
id = int(self.request.get('EscTeacher'))
teacher=models.teacher.get(db.Key.from_path('Teacher',
id))
else:
teacher= models.teacher()
data = forms.TeacherForm(data = self.request.POST)
if data.is_valid():
userList= models.Account.all()
userList.filter('user =', users.get_current_user())
for user in userList:
teacher.user=user.key()
teacher.unity=self.request.get('unity')
teacher.category=self.request.get('category')
teacher.regime=self.request.get('regime')
teacher.put()
docExp.put()
self.redirect('/academy')
else:
self.redirect('/createCv')
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.