Wednesday, July 30, 2014

Re: (ModelForm) confusion


you are calling 'is_valid' in your view, which should be an method call:

a_valid = aform.is_valid()  m_valid = mform.is_valid()  p_valid = pform.is_valid()

There where a few hooks in your view, for example: you check for 'is_valid()' but there is no code to execute after. I've changed it a bit:

Am Mittwoch, 30. Juli 2014 08:59:15 UTC+2 schrieb Kamal Kaur:

What I have done:
There are four tables, from which I have generated ModelForms. Getting
the WorkerDetails from one side, adding the salary and attendance
things from the other side as the view says. If there is at least one
row added in WorkerDetail table, then it directly asks to add the
salary and attendance things. Everything is being added perfectly but
I have to add that "ForeignKey" thing in every form.

To design a page like this:

What I need to do to display forms like this and get the foreign key
attribute directly from the displayed list? Is what I have done right?
Is there some better approach to get this desired layout?

Required code:

Kamaljeet Kaur
I'm not what I'm compared to others, I'm what I'm compared to my yesterday.

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment