[patch] Admin interface broken for OneToOne relations
|Reported by:||gattomatto||Owned by:||Adrian Holovaty|
|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 10 years ago by
|Summary:||Admin interface broken for OneToOne relations → [patch] Admin interface broken for OneToOne relations|