Re: admin interface for legacy database

2006-10-16 Thread Ewout ter Haar
On 10/15/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > The value of Users.icon either has to be a valid primary key value in > the table for the Icon model or NULL (of you have null=True in the > ForeignKey constructor). This is because a Django ForeignKey field is a > true foreign key in t

Re: admin interface for legacy database

2006-10-15 Thread Malcolm Tredinnick
On Sat, 2006-10-14 at 04:47 -0700, Ewout ter Haar wrote: > I am trying to make use of the django admin, to use with a database > which is normally managed by another (PHP) application. I ran > inspectdb, and after tweaking the models a little bit, it works for > basic fields like InterFields, Char

Re: admin interface for legacy database

2006-10-14 Thread moberley
I'm not familiar with how ForeignKey fields interact with the database, but I wondered if you could have an instance of the Icon model that represented no icon (-1). Otherwise, I think you might need to override the model methods (probably the save() method), but that's just a guess. --~--~-

admin interface for legacy database

2006-10-14 Thread Ewout ter Haar
I am trying to make use of the django admin, to use with a database which is normally managed by another (PHP) application. I ran inspectdb, and after tweaking the models a little bit, it works for basic fields like InterFields, CharFields etc. I would also like to use the ForeignKey features tha