﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1245	[patch] Admin interface broken for OneToOne relations	gattomatto	Adrian Holovaty	"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."	defect	closed	contrib.admin	0.91	major	fixed			Unreviewed	1	0	0	0		
