mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[soc2009/multidb] Made instances sticky to the database that created them.
This involves: * Adding a _state attribute to instances to track instance state * Making db a state attribute, and making the db a public attribute on querysets. Patch from Russell Keith-Magee. git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -315,7 +315,7 @@ DoesNotExist: ArticleWithAuthor matching query does not exist.
|
||||
# Regression test for #9390. This necessarily pokes at the SQL string for the
|
||||
# query, since the duplicate problems are only apparent at that late stage.
|
||||
>>> qs = ArticleWithAuthor.objects.order_by('pub_date', 'pk')
|
||||
>>> sql = qs.query.get_compiler(qs._using).as_sql()[0]
|
||||
>>> sql = qs.query.get_compiler(qs.db).as_sql()[0]
|
||||
>>> fragment = sql[sql.find('ORDER BY'):]
|
||||
>>> pos = fragment.find('pub_date')
|
||||
>>> fragment.find('pub_date', pos + 1) == -1
|
||||
|
||||
Reference in New Issue
Block a user