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 = models.DateField(blank=True,null=True)
    name = models.CharField(max_length=100,blank=True,null=True)

    books_name = models.ManyToManyField(Books,blank=True,null=True)


lass Books(models.Model):

     book_name = models.CharField(max_length=100)
     book_category = models.CharField(max_length=100,blank=True,null=True)

     def __unicode__(self):
         return self.book_name



now i want to have a list of books in a list called books_list

How to store those in the database

I understood how to store basic_fields


database_obj = FacebookSession.objects.get(uid=123444)
database_obj.name="ss"

database_obj.save()

How do i do the same thing for books_name which is a many to many field in
FacebookSession class

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to