So, if I add a ForeignKey field to my model it simply add a
"related_model_id" column to my table, let me ask something, how django
enforce that when I add a repeated value to that field it will an error, I
mean, a foreign key value that does not exist in the original table in a one
to many relationship?

On 5/28/07, Marc Fargas <[EMAIL PROTECTED]> wrote:
>
>
> Hi Jos�,
> As the documentation says, the best alternative right now is to set a
> ForeignKey from one of the models to the other, on which you should
> place the ForeignKey really depends on every specific case, normaly it
> should go to the one that "cannot live with the other" (hence, the
> dependent one).
>
> ForeignKey simply adds a "related_model_id" column to hold the id of the
> other model and both models get the appropiate attributes/methods to
> find their relatives.
>
> Hope this helps,
> Marc
>
> El lun, 28-05-2007 a las 11:45 -0400, Lic. Jos� M. Rodriguez Bacallao
> escribi�:
> > Hi every one, first of all, sorry about my english, it's not so good
> > but I'm still learning. Well, I'm new to django and right now I come
> > from zope (2/3) and plone. I find django very exciting but I got a
> > little problem, how can I specify a Generalization/Especialization
> > relation in django, I mean, the better way. Until now, I specify it by
> > a OneToOne relationship but reading the documentation about models I
> > saw that the semantic of this relationship will change, so, right now,
> > I don't know what to do to be forward compatible, anyone can help me?
> >
> > --
> > Lic. Jos� M. Rodriguez Bacallao
> > Informatics Science University
> > Habana-Cuba.
> > >
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Informatics Science University
Habana-Cuba.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

  • Re: django models Lic. José M. Rodriguez Bacallao

Reply via email to