mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #12429 -- Ensure that raw queries call resolve_columns if the backend defines it. This ensures (as much as possible) that the model values returned by a raw query match that in normal queries. Thanks to Ian Kelly for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12904 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
110
tests/modeltests/raw_query/fixtures/raw_query_books.json
Normal file
110
tests/modeltests/raw_query/fixtures/raw_query_books.json
Normal file
@@ -0,0 +1,110 @@
|
||||
[
|
||||
{
|
||||
"pk": 1,
|
||||
"model": "raw_query.author",
|
||||
"fields": {
|
||||
"dob": "1950-09-20",
|
||||
"first_name": "Joe",
|
||||
"last_name": "Smith"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 2,
|
||||
"model": "raw_query.author",
|
||||
"fields": {
|
||||
"dob": "1920-04-02",
|
||||
"first_name": "Jill",
|
||||
"last_name": "Doe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 3,
|
||||
"model": "raw_query.author",
|
||||
"fields": {
|
||||
"dob": "1986-01-25",
|
||||
"first_name": "Bob",
|
||||
"last_name": "Smith"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 4,
|
||||
"model": "raw_query.author",
|
||||
"fields": {
|
||||
"dob": "1932-05-10",
|
||||
"first_name": "Bill",
|
||||
"last_name": "Jones"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 1,
|
||||
"model": "raw_query.book",
|
||||
"fields": {
|
||||
"author": 1,
|
||||
"title": "The awesome book",
|
||||
"paperback": false,
|
||||
"opening_line": "It was a bright cold day in April and the clocks were striking thirteen."
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 2,
|
||||
"model": "raw_query.book",
|
||||
"fields": {
|
||||
"author": 1,
|
||||
"title": "The horrible book",
|
||||
"paperback": true,
|
||||
"opening_line": "On an evening in the latter part of May a middle-aged man was walking homeward from Shaston to the village of Marlott, in the adjoining Vale of Blakemore, or Blackmoor."
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 3,
|
||||
"model": "raw_query.book",
|
||||
"fields": {
|
||||
"author": 1,
|
||||
"title": "Another awesome book",
|
||||
"paperback": false,
|
||||
"opening_line": "A squat grey building of only thirty-four stories."
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 4,
|
||||
"model": "raw_query.book",
|
||||
"fields": {
|
||||
"author": 3,
|
||||
"title": "Some other book",
|
||||
"paperback": true,
|
||||
"opening_line": "It was the day my grandmother exploded."
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 1,
|
||||
"model": "raw_query.coffee",
|
||||
"fields": {
|
||||
"brand": "dunkin doughnuts"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 2,
|
||||
"model": "raw_query.coffee",
|
||||
"fields": {
|
||||
"brand": "starbucks"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 1,
|
||||
"model": "raw_query.reviewer",
|
||||
"fields": {
|
||||
"reviewed": [
|
||||
2,
|
||||
3,
|
||||
4
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 2,
|
||||
"model": "raw_query.reviewer",
|
||||
"fields": {
|
||||
"reviewed": []
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user