Melvin thanks, actually my models are simplified...the switch of fk was a
way of trying to use it at d front end so that I could provide an id to
link em up...unfortunately I can't go around it since an instance of the
model is not easily accessible cos its a new object not saved yet...I
thought of using a widget form to add up a parent later but I think yingis
suggestions are smoother

On Jun 10, 2017 2:39 PM, "Melvyn Sopacua" <m.r.sopa...@gmail.com> wrote:

> On Saturday 10 June 2017 13:20:11 yingi keme wrote:
>
>
>
> > The variable for foreign key is supposed to be declared under Student
>
> > model because parents can typically have more than one kid in a
>
> > school isnt it?
>
>
>
> And typically, students can have more then one parent. So either rename
> your Parent model as Parents (plular) to indicate that you use one object
> to describe two natural persons (and indeed, switch the foreign key) - or -
> use a ManyToMany as both sides of the relation can be linked to more then
> one of the other.
>
>
>
> In practice having one object for two Parents isn't ideal, as half of the
> parents end up in the divorce, so contact details and so on, become a mess
> again.
>
>
>
> ManyToManyField is the best fit here.
>
>
>
> --
>
> Melvyn Sopacua
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/1653535.zO1WQPNAma%40devstation
> <https://groups.google.com/d/msgid/django-users/1653535.zO1WQPNAma%40devstation?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2BabP-E-9RG5AG6tXD07C7r_3hF%2B%3DUrb3rHiQiifspBPNiPkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to