#10572 closed (fixed)
defer() doesn't work cleanly with model inheritance
Reported by: | Malcolm Tredinnick | Owned by: | Russell Keith-Magee |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | bruth@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Saving a model where an inherited field has been passed to defer()
leads to badness (Django crashes :-( ).
I know about. I'll fix it for 1.1. Noting here in the hope that anybody else stumbling across this will discover it's a known issue for now. Working on beta-deadline things first, though.
Attachments (1)
Change History (9)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 16 years ago
Attachment: | defer-inheritance.diff added |
---|
comment:2 by , 16 years ago
comment:3 by , 15 years ago
using only() doesn't work cleanly either. Given CustomUser which subclasses auth.User
CustomUser.objects.only("home_address").query.as_sql()
... retrieves "home_address" and all parent fields as well.
'SELECT "auth_user"."id", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email",
"auth_user"."password", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."is_superuser", "auth_user"."last_login",
"auth_user"."date_joined", "users_customuser"."user_ptr_id", "users_customuser"."home_address" FROM "users_customuser" INNER
JOIN "auth_user" ON ("users_customuser"."user_ptr_id" = "auth_user"."id")'
comment:4 by , 15 years ago
Cc: | added |
---|
comment:5 by , 15 years ago
Owner: | changed from | to
---|
I've got a test and patch for this; however, the test has introduced an order dependency in the test suite. I'll commit once I've got this sorted out.
comment:6 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I can't reproduce with the above tests, is it possible it's either a) version specific, b) fixed in a previous patch, or c) I misunderstood the issue.