Opened 16 years ago
Closed 16 years ago
#11428 closed (fixed)
manage.py reset not working for proxy models
| Reported by: | Anssi Kääriäinen | Owned by: | nobody |
|---|---|---|---|
| Component: | Uncategorized | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I have created a new project and a new app, testapp. In testapp/models.py I have:
class Test(models.Model): pass class Test2(Test): class Meta: proxy = True
Running python manage.py sqlreset testapp I get the following output:
BEGIN;
DROP TABLE "testapp_test";
DROP TABLE "testapp_test";
CREATE TABLE "testapp_test" (
"id" integer NOT NULL PRIMARY KEY
)
;
CREATE TABLE "testapp_test" (
)
;
COMMIT;
I am using Django version 1.1 beta 1 SVN-11196.
Attachments (1)
Change History (5)
comment:1 by , 16 years ago
| Version: | 1.0 → SVN |
|---|
comment:2 by , 16 years ago
| Description: | modified (diff) |
|---|
by , 16 years ago
| Attachment: | patch.diff added |
|---|
comment:3 by , 16 years ago
| Has patch: | set |
|---|---|
| Patch needs improvement: | set |
The problem is that proxy models are handled as if they were real models in (all?) of the manage.py commands. I have attached a patch just to show where the problem is.
Maybe the correct way would be to implement a get_models_noproxy() method in django.db.models?
comment:4 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(reformatted description)