Sunday, May 13, 2012

Re: help with foreignkeys

As far as I understand it the ForeignKey will have to be unique=True and null=False.

I want to get a better sense of what you are trying to achieve. Is it that you want to link comment and park only some of the time?

JD

On Sunday, May 13, 2012 7:41:39 PM UTC-6, psychok7 wrote:
so i have this 2 models (Comment and Park)

Comment has a foreign key to USER and PARK

PARK has a foreign key to Comment

my question is, isn't there going to be a deadlock if i don't have a comment or a park created? i mean , in order to create a Park i need to have a comment, and in order to create a comment i need a park and a user.

is there a way for me to fix my problem? like allowing the foreign key to be null or something like that?

thanks in advance

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/5DSX-Ls64boJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate