On Wed, Jul 30, 2014 at 12:25 PM, Kamal Kaur <
kamal....@gmail.com> wrote:
> Greetings!
>
> 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.
The thing i understand is, you wish is that the system should ask to
add the other details like monthly attendance and advance on the same
page when a new worker is added, if it don't have that values.
Am i right?
You require the validators in the template / form.py file, to validate
the data at the run time.
> Query:
> 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:
> models.py:
http://pastie.org/9430952
> forms.py:
http://pastie.org/9430955
Page doesn't exist :(
> views.py:
http://pastie.org/9430962
--
Satinderpal Singh
http://satindergoraya91.blogspot.in/