[patch] Admin interface broken for OneToOne relations
|Reported by:||gattomatto||Owned by:||adrian|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
We inserted the Places and Restaurantes code verbatim as in example http://www.djangoproject.com/documentation/models/one_to_one/.
We addes META classes with an admin attribute (only), to activate the Admin interface.
If we try to administer the Restaurants objects, we got this error on Postgresql:
ProgrammingError at /admin/exemplemodel/restaurants/ ERROR: missing FROM-clause entry for table "exemplemodel_places" SELECT "exemplemodel_restaurants"."place_id","exemplemodel_restaurants"."serves_hot_dogs","exemplemodel_restaurants"."serves_pizza" FROM "exemplemodel_restaurants" ORDER BY "exemplemodel_places"."id" DESC )
If the Postgres database is configured with "add_missing_from = true", which is the default, you don't get any error but Restaurants lines get listed twice, because of a cartesian product between the two tables.
We think that the ORDER BY clause is generated incorrectly, citing the wrong table/object.
We're using Django 0.91.
Change History (7)
comment:4 Changed 8 years ago by Jorge Gajon <gajon@…>
- Summary changed from Admin interface broken for OneToOne relations to [patch] Admin interface broken for OneToOne relations
Changed 8 years ago by Jorge Gajon <gajon@…>
comment:5 Changed 8 years ago by Jorge Gajon <gajon@…>
- priority changed from normal to high
- Severity changed from normal to major