Re: Storing many to many fields

2012-03-18 Thread dummyman dummyman
HI, One more question How do i update a manytomany field which is a self referential field ie it points to the same table. Consider for example facebooksession contains a field called friends friends = models.ManyToManyField("self",db_column='uid',blank=True,null=True) On Sun, Mar 18, 2012

Re: Storing many to many fields

2012-03-18 Thread dummyman dummyman
thnk u very much i got it :) On Sun, Mar 18, 2012 at 3:57 PM, Ian Lewis wrote: > Hi, > > facebook_session.books_name is a RelatedManager on the Books model class. > > You need to add books to the list with the add() method. > > book = Books(book_name="name",

Re: Storing many to many fields

2012-03-18 Thread Ian Lewis
Hi, facebook_session.books_name is a RelatedManager on the Books model class. You need to add books to the list with the add() method. book = Books(book_name="name", book_category="category") book.save() facebook_session.books_name.add(book) See:

Storing many to many fields

2012-03-18 Thread dummyman dummyman
Hi I ve to models class FacebookSession(models.Model): access_token = models.CharField(max_length = 250,unique=True) expires = models.IntegerField(null=True) user = models.ForeignKey(User, null=True) uid = models.BigIntegerField(unique=True, null=True) birthday =