This resolves a problem on databases besides PostgreSQL when using prefetch_related with a source model that uses a UUID primary key.