THANK YOU!
i just got home, will try this to see if this works... i'm new to
django so thanks for the help, i'll look up what related_name works,
but it looks good.
Israel
On Jul 29, 9:41 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> If the Friend is really a user...wouldn't something
If the Friend is really a user...wouldn't something like this work:
class Friends(models.Model):
parent_user = models.ForeignKey(User, related_name="user")
friend_user = models.ForeignKey(User,related_name="friends")
Then for the parent_user's friends...you'd do something like:
i'm working on an app that has a table called friends whose model
looks like this:
class Friend(models.Model):
user = models.ForeignKey(User)
friend = models.CharField(maxlength=100)
status = models.CharField(maxlength=1,choices=FSTATUS_CHOICES)
def __str__(self):
return
3 matches
Mail list logo