#16450 closed Bug (worksforme)
UserProfile filtering breaks between Django 1.2.5 and 1.3
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | 1.3 |
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
I guess this will be closed as invalid, but here goes my best attempt.
When upgrading from Django 1.2.5 to 1.3 the following code breaks:
users = self.users.filter(userprofile__public_profile=True).order_by('first_name')
Cannot resolve keyword 'userprofile' into field.
UserProfile has a foregin key to User:
user = models.ForeignKey(User, unique=True)
Other foreignkey models are still valid keys so i figured it might have to do with the custom user profile feature.
Change History (3)
comment:1 by , 13 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:3 by , 13 years ago
YES! That is the case. It is indeed the same as #15771. Thank you anonomous! :)
Note:
See TracTickets
for help on using tickets.
Your description is rather short on details (like what is 'self'? What is 'self.users'?). I tried to guess, and used the following class:
Then ran the following:
AUTH_PROFILE_MODULE is irrelevant here (though I tried with and without it) - it only affects the 'get_profile()' method, as documented. What you are describing is simple
ForeignKey
functionality breaking, which is of course extremely unlikely, as hundreds of tests and thousands of projects would have broken if that had happened.So I'm forced to mark this as WORKSFORME. If you can provide details that will allow us to reproduce this, please re-open the ticket.