encode / django-rest-framework

Web APIs for Django. 🎸
https://www.django-rest-framework.org
Other
28.4k stars 6.84k forks source link

KeyError: 'Class UUID not found in lookup.' #4728

Closed ptcarino closed 7 years ago

ptcarino commented 7 years ago

I'm currently working on a project that uses django_cassandra_engine and this package. Whenever I try to visit the json url I've set, django throws the error KeyError: 'Class UUID not found in lookup.'

I'm guessing because in my models, I'm using from cassandra.cqlengine import columns instead of from django.db import models. The UUID for cqlengine is just UUID while in django.db it's UUIDField.

Any work around for this?

xordoquy commented 7 years ago

The discussion group is the best place to take this discussion and other usage questions. Thanks!

Note that we don't support anything other than Django itself.

ptcarino commented 7 years ago

Just so anyone has the same problem, I was using ModelSerializer here and the names of django.db's field types do not match with cassandra.cqlengine thus the error.

What I did to solve this was use Serializer and specify the appropriate field type equivalents on each column.