例如 queryset 我们可以这样:
>>> a =Post.objects.all()
>>> a
[<Post: >, <Post: hello_title>]
>>> print a.query
SELECT `posts_post`.`id`, `posts_post`.`title`, `posts_post`.`content`, `posts_post`.`publish`, `posts_post`.`updated` FROM `posts_post` ORDER BY `posts_post`.`updated` DESC, `posts_post`.`publish` DESC
>>> type(a)
<class 'django.db.models.query.QuerySet'>
但是 create 或 save 的时候怎么办?
求菊苣不吝告之。。。
>>> a =Post.objects.all()
>>> a
[<Post: >, <Post: hello_title>]
>>> print a.query
SELECT `posts_post`.`id`, `posts_post`.`title`, `posts_post`.`content`, `posts_post`.`publish`, `posts_post`.`updated` FROM `posts_post` ORDER BY `posts_post`.`updated` DESC, `posts_post`.`publish` DESC
>>> type(a)
<class 'django.db.models.query.QuerySet'>
但是 create 或 save 的时候怎么办?
求菊苣不吝告之。。。