Open GoogleCodeExporter opened 8 years ago
Sorry, here are the json dumps of the data I used:
Parent -
[{"pk": 1, "model": "miscellaneous.parent", "fields": {"name": "John"}}, {"pk":
2, "model": "miscellaneous.parent",
"fields": {"name": "Mary"}}, {"pk": 3, "model": "miscellaneous.parent",
"fields": {"name": "Percy"}}]
Child -
[{"pk": 1, "model": "miscellaneous.child", "fields": {"name": "John", "parent":
1}}, {"pk": 2, "model":
"miscellaneous.child", "fields": {"name": "Sonny", "parent": 1}}, {"pk": 3,
"model": "miscellaneous.child", "fields":
{"name": "Mary", "parent": 1}}, {"pk": 4, "model": "miscellaneous.child",
"fields": {"name": "John Brian", "parent":
1}}, {"pk": 5, "model": "miscellaneous.child", "fields": {"name": "mary
elizabeth", "parent": 2}}, {"pk": 7, "model":
"miscellaneous.child", "fields": {"name": "john", "parent": 2}}, {"pk": 8,
"model": "miscellaneous.child", "fields":
{"name": "Percyval", "parent": 3}}, {"pk": 9, "model": "miscellaneous.child",
"fields": {"name": "Mary", "parent": 3}},
{"pk": 6, "model": "miscellaneous.child", "fields": {"name": "julie mary",
"parent": 2}}]
Original comment by ce.lo...@gmail.com
on 11 Mar 2010 at 6:01
And here is an example of an admin interface where the problem would be
materializing:
class ChildInline(admin.TabularInline):
model = Child
fk_name = 'parent'
class ParentAdmin(admin.ModelAdmin):
search_fields = ('name', 'child__name',)
list_per_page = 10
list_select_related = True
inlines = [ ChildInline, ]
Searching on the parent admin interface will produce the same unfortunate
effect because the distinct is
ignored.
Original comment by ce.lo...@gmail.com
on 11 Mar 2010 at 6:08
I wish I could edit the issue... :-)
Where I say "I'm unsure why we need row_number() added to every single query,
so I decide to just report the
bug and wait for instructions..."; I do realize the row_number() is in there to
allow for pagination.
The question is could the row_number addition be moved from compile.py to
query.py? I'm unsure - so I
stopped touching it.
Original comment by ce.lo...@gmail.com
on 11 Mar 2010 at 6:42
I've seen people suggest that 'query.py' isn't used in 1.2
My current (quick) fix is to move the row_number stuff outside the actual
query, so
a 'select *, (row_number...) from (<built query>) as Y' appears around the query
Original comment by julian.d...@gmail.com
on 22 Mar 2010 at 11:11
Original issue reported on code.google.com by
ce.lo...@gmail.com
on 11 Mar 2010 at 5:56