On Feb 12, 2008 2:58 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-02-12 at 14:51 +0100, Hanne Moa wrote: > > On Feb 12, 2008 2:23 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Tue, 2008-02-12 at 14:13 +0100, Hanne Moa wrote: > > > > 1. how do I get "Region: 'someregion (somelocation)'" in the admin > > > > interface instead of "Region: '---------'"? > > > > > > [..] So there's something slightly amiss with > > > the way things are matched up in your retrofitted models. You could also > > > try comparing the output of "manage.py sql <app_name>" to the actual > > > database tables to make sure the reference is pointing to the right > > > field, etc. > > > > I checked the generated sql. No wonder it went wrong. With db_column > > in the ForeignKey, the attribute Org.region in python became org.id in > > the sql, meaning there were several fields "id" in the same table! > > When I removed db_column in ForeignKey, the Python attribute > > Org.region became org.region_id in the table and hence not matching > > the existing table. > > Use db_column="region".
Ah! We have liftoff! I thought db_column referenced the foreign table. Well, I keep mixing up the order of arguments in split() and join() to... HM --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

