Hi guys, I'm a bit confused on inserting new data into the db via the models, i.e in the docs http://docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries a given example to add new data into a table is:
from mysite.blog.models import Blog b = Blog(name='Beatles Blog', tagline='All the latest Beatles news.') b.save() but what is the difference between the above and using the Manager like: b = Blog.objects.create(name='Beatles Blog', tagline='All the latest Beatles news.') b.save() I've also notice that the former cannot be used when I try to add() for ManyToMany models, i.e b = Blog(name='Beatles Blog', tagline='All the latest Beatles news.') b.manytomany.add(another_object) b.save() Are there specific situations which I have to use the Manager to insert new data? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---