This issue is that the foreign key field (i.e. the foo_id field) does not have its db_converters called, if they are defined in the backend rather than in the field itself.
I've added a pull request (https://github.com/django/django/pull/4134) with a possible approach to the problem. We may be able to do something better, I'm going to investigate further. Marc On 14 February 2015 at 19:13, Collin Anderson <cmawebs...@gmail.com> wrote: > Long term, eventually we want the FK to use a real models.UUIDField under > the hood, right? > > On Sat, Feb 14, 2015 at 1:17 PM, Shai Berger <s...@platonix.com> wrote: > >> Hi all, >> >> This comes from trying to fix #24343[1] -- a problem where a UUIDField is >> used >> as a PK (legitimate and common practice), and we wish to test a FK to that >> model. The problem is that, on database backends which do not support >> native >> UUIDFields (that is, all but postgres), the underlying field for an FK is >> a >> CharField, not a UUIDField. This is not a problem in most normal use, but >> sometimes people do access the underlying field, and they're in for a >> surprise >> there. >> >> I am almost certain that a similar problem exists with any non-trivial >> field -- >> e.g. if someone had reason to use a CommaSeparatedIntField as a PK, they >> would >> probably run into the same issue. >> >> Now, there are two essential ways to fix the test failure in the ticket: >> One, >> as suggested by Tim in a comment on the ticket, is to just deal with the >> difference in the test. The other is to solve the deeper issue, which >> could be >> seen as a little disruptive at this point in the release cycle (and is, in >> general, more disruptive). >> >> Note that, as Tim notes on the ticket, the test failure is Oracle only, >> but >> the real issue is everyone-but-postgres. >> >> Opinions? >> >> Thanks, >> Shai. >> >> [1] https://code.djangoproject.com/ticket/24343 >> > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > Visit this group at http://groups.google.com/group/django-developers. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/CAFO84S4CF_qo%2BMmJ1ybUsOMfD%3DPTyVxQZy8wD3vYKC6rE5%3DDwQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-developers/CAFO84S4CF_qo%2BMmJ1ybUsOMfD%3DPTyVxQZy8wD3vYKC6rE5%3DDwQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMwjO1Gfw8Y5rdwjPbo2todKubtHVAU%2B%3DoePp3s6UDxw%3D-NpKQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.