Re: (ModelForm) confusion

2014-08-04 Thread Kamal Kaur


> 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:
>

 

>
> http://pastie.org/9431548
>
>

Thanks for the modifications.

@Satinderpal

Links are working. And yes, you got it right. Now I want that it 
automatically takes the foreign key after adding once but here I need to 
add in every modelform.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35d9658c-0165-47f4-96ac-23597a85f8a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: (ModelForm) confusion

2014-07-30 Thread marc
Hi,

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:

http://pastie.org/9431548

Am Mittwoch, 30. Juli 2014 08:59:15 UTC+2 schrieb Kamal Kaur:
>
> 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. 
>
> Aim: 
> To design a page like this: 
> http://tinypic.com/r/feor5h/8 
>
> 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 
> views.py : http://pastie.org/9430962 
>
>
>
> -- 
> 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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/83469e1b-9824-426e-8141-97465ef47202%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: (ModelForm) confusion

2014-07-30 Thread Satinderpal Singh
On Wed, Jul 30, 2014 at 12:25 PM, Kamal Kaur  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?

>
> Aim:
> To design a page like this:
> http://tinypic.com/r/feor5h/8
>
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/

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BiK19JDoU5znYnz13AVwm0Swoc6y4R-t64QAaE0eiMBEC%3D5SA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(ModelForm) confusion

2014-07-30 Thread Kamal Kaur
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.

Aim:
To design a page like this:
http://tinypic.com/r/feor5h/8

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
views.py: http://pastie.org/9430962



-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP8Q%2Bxi-nCvRFJi2mP_YQvpanZMswEsdyLHzirV%2B%3DTtKX8N85w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.