title: Django REST framework with mongoDB : invalid literal for int() with base 10
body: <p>I'm building a web site with django (1.5.11) and mongoDB (2.4.9). As I want to add REST APIs, I also installed Django REST framework (3.0.5). But I can't get serializers to work correctly with a very simple model (see below), instead I get this error :</p>
  
  <pre><code>ValueError at /api/message/
  invalid literal for int() with base 10
  </code></pre>
  
  <p>I believe this error is related to the fact that mongoDB identifiers are not integers. Also note that I don't want to use MongoEngine (and Django Rest Framework Mongoengine) because I wan't to stay in a django philosophy.</p>
  
  <p>Any clues or hints? Please find below a minimal example of my app.</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>from django.db import models
  from djangotoolbox import fields
  
  class Message(models.Model):
      created_on = models.DateTimeField(auto_now_add=True, null=True)
      text = models.TextField()
      tags = fields.ListField()
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>from django import http, template
  from rest_framework import generics, renderers, parsers
  from . import models, serializers
  
  def messageList(request):
      if request.method == 'GET':
          messages = models.Message.objects.all()
          serializer = serializers.MessageSerializer(messages, many=True)
          return JSONResponse(serializer.data)
  
  class JSONResponse(http.HttpResponse):
          def __init__(self, data, **kwargs):
                  content = renderers.JSONRenderer().render(data)
                  kwargs['content_type'] = 'application/json'
                  super(JSONResponse, self).__init__(content, **kwargs)
  </code></pre>
  
  <p><strong>serializers.py</strong></p>
  
  <pre><code>from rest_framework import serializers
  from . import models
  
  class MessageSerializer(serializers.ModelSerializer):
      class Meta:
          model = models.Message
          fields=('id' , 'text',)
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>from django.conf.urls import patterns, include, url
  from . import views
  
  urlpatterns = patterns('',
      url(r'^api/message/$', views.messageList),
  )
  </code></pre>