I have eventually made a MySQL view combining the two tables and then
used a simple Django queryset on it,
but I'd still be curios if there's a Django way of addressing this and
similar issues.

On Apr 6, 9:26 pm, "jani.mono...@gmail.com" <jani.mono...@gmail.com>
wrote:
> > The generated model from inspectdb is only a best guess, but there's
> > nothing to stop you editing it. If your field really is a foreign key,
>
> Not really a foreign key,both tables have a string field ID which is
> the same,
> and unique in one table. So it could be a foreign key except it is not
> explicitly
> set in MySQL (so not only in the inspectdb output, but in the original
> tables as well)
>
>
>
> > then change the model code so that it uses a ForeignKey field rather
> > than an IntegerField.
> > --
> > DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to