-2

How can I associate lists apps Listing model with an user. User has_many lists.

What shall I include in my List model for being able to use models.ForeignKey(User)

Cem Baykam
  • 507
  • 1
  • 7
  • 20
  • not sure if i get the question: lists apps Listing Model? what do you mean exactly, give me some more information code snippets etc... – cwoebker Jul 26 '11 at 15:24

1 Answers1

3

Here you go (Although you should just look at the Django DOcs the next Time):

from django.db import models
from django.contrib.auth.models import User

class Listing(models.Model):
    user = models.ForeignKey(User)

Hope this helps

cwoebker
  • 3,158
  • 5
  • 27
  • 43