I searched around a bit and I can't seem to find a definitive answer to
my problem. I think it's because I haven't quite started thinking in
the context that Django would like me to yet.

My problem is with selecting related information in different models
with a single PK. Let me insert my simplified models in here:

class Post(models.Model):
        postId = models.AutoField(primary_key = True)
        userId = models.ForeignKey(User, db_column = 'userId')
        title = models.CharField(maxlength = 100)

class User(models.Model):
        userId = models.AutoField(primary_key = True)
        alias = models.CharField(maxlength = 100)

This is very similar to the example in the documentation for
many-to-one relationships dealing with the Reporter and Article model.

All I want to do is select a Post with a PK and have it return a User
model as well. If not that, then some way I can get the same
information. If someone could illuminate the standard way of doing this
I would be very grateful.

Thank you, Trey


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

Reply via email to