tickets: 1245
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1245 | 2006-01-19 11:02:19 | 2006-04-21 17:04:03 | 2022-03-06 03:22:50.102717 | Unreviewed | closed | contrib.admin | defect | major | 0.91 | fixed | [patch] Admin interface broken for OneToOne relations | 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. | adrian | gattomatto | 1 | 0 | 0 | 0 |