Opened 12 years ago
Closed 12 years ago
#19575 closed Bug (invalid)
1.5rc breaks custom querysets (at least in my case)
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.5-beta-1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
A custom queryset that was working through 1.5b2 breaks under rc1. I keep getting "'AuthQuerySet' object has no attribute '_known_related_objects'" when trying to invoke methods on a class that uses the queryset.
I've confirmed that I do not get the error in b2 but do get the error in rc1 - so I'm comfortable stating that something changed for the worse between b2 and rc1.
I'm really sorry this is so vague, but I don't understand the error message, and I don't know what code to post. I'd be happy to chat with someone on IRC about it though, and I can run any tests suggested.
Perhaps it's related to https://github.com/django/django/pull/617 ?
Attachments (1)
Change History (6)
comment:1 by , 12 years ago
follow-up: 3 comment:2 by , 12 years ago
We need a bit more information, specifically we need some code that allows us to reproduce this. To a first approximation, it sounds like you aren't calling super
in your queryset's __init__
method.
comment:3 by , 12 years ago
Replying to Alex:
We need a bit more information, specifically we need some code that allows us to reproduce this. To a first approximation, it sounds like you aren't calling
super
in your queryset's__init__
method.
I get it. Unfortunately, due to the nature of the code, I can't really post it publicly. I'm not overriding init in the queryset.
Is there another way I can share code with someone privately?
comment:4 by , 12 years ago
OK, thanks to some cool folks on IRC, I think we've figured this out.
There was a change made to the name of a QuerySet attribute from "_known_related_object" to "_known_related_objects" (see https://github.com/django/django/commit/07fbc6ae0e3b7742915b785c737b7e6e8a0e3503#django/db/models/query.py).
This resulted in previously-pickled querysets in my app to fail since they had the old attribute.
comment:5 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Here's a traceback in case it helps:
Environment:
Request Method: GET
Request URL: http://localhost:8000/kml/devices/testfilter/
Django Version: 1.5c1
Python Version: 2.7.2
Installed Applications:
('django.contrib.auth',
Installed Middleware:
('django.middleware.common.CommonMiddleware',
Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
File "/Users/project1/code/mvw/mvw/decorators.py" in wrap
File "/Users/project1/code/mvw/mvw/views.py" in kmldevices
File "/Users/project1/code/mvw/mvw/models/filter.py" in _build_graph
File "/Users/project1/code/mvw/mvw/models/filter.py" in packets
File "/Users/project1/code/mvw/mvw/models/managers.py" in authfilter
File "/Library/Python/2.7/site-packages/django/db/models/query.py" in filter
File "/Library/Python/2.7/site-packages/django/db/models/query.py" in _filter_or_exclude
File "/Library/Python/2.7/site-packages/django/db/models/query.py" in _clone
Exception Type: AttributeError at /kml/devices/testfilter/
Exception Value: 'AuthQuerySet' object has no attribute '_known_related_objects'