> Try setting the primary_key option as True.
Fair enough, but this will solve the issue (will it? Didn't try yet)
only in case I need just one OneToOne mapping per model. What if I
need more?
In the example above, what if I need Person to be mapped to Profile
and ProjectParticipant models as One
Try setting the primary_key option as True.
>From http://www.djangoproject.com/documentation/models/one_to_one/:
class Restaurant(models.Model):
place = models.OneToOneField(Place, primary_key=True)
# Delete the restaurant; the waiter should also be removed
>>> r = Restaurant.objects.get(pk
Hi,
I'm new to django and was trying to play around OneToOne mapping (a
very powerful feature in my mind) and found one possible issue.
I created two models: Person and Profile, where Profile is mapped to
Person with OneToOne profile field in the Person class. So now when I
create a Person, I ne
3 matches
Mail list logo