title: Tastypie obj_create bundle gives invalid literal for int() with base 10
body: <p>I'm using <a href="http://tastypieapi.org/" rel="nofollow">Tastypie</a> to POST and create a new Resource, which works fine:</p>
  
  <pre><code>   class TestResource(ModelResource):
      class Meta:
          queryset = MemberParticipant.objects.all()
          resource_name = 'participant'
          allowed_methods = ['post']
  
          def obj_create(self, bundle, request=None, **kwargs):
              """
              Creates a new object based on the provided data.
              This method overwrites the resource create
              as we need to preform extra method calls.
              """
              bundle = self.full_hydrate(bundle)
              # Check data is valid before trying to create a new resource.
              self.is_valid(bundle)
              if bundle.errors:
                  raise ImmediateHttpResponse(response=self.error_response(bundle.request, bundle.errors))
  
              new_user = MemberParticipant.objects.create_user(email=bundle.data['email'],
                                                           password=bundle.data['password'])
              # Log the user in
              email = new_user.email
              password = bundle.data['password']
              user = authenticate(username=email, password=password)
  
              login(bundle.request, user)
              return bundle
  </code></pre>
  
  <p>I then use in the Meta class <code>always_return_data = True</code> to always return the created resource in the AJAX call.</p>
  
  <p>However, doing this gives now gives me the following error:</p>
  
  <p><strong>invalid literal for int() with base 10:
  /django-env/lib/python2.7/site-packages/tastypie/fields.py\", line 234, in convert\n    return int(value)\n\nValueError: invalid literal for int() with base 10: ''\n"}</strong></p>
  
  <p>Why?</p>
  
  <p>Full error traceback:</p>
  
  <pre><code>{
      "error_message": "invalid literal for int() with base 10: ''",
      "traceback": "Traceback (most recent call last):
    File \"/Users/user/Documents/workspace/test/django-env/lib/python2.7/site-packages/tastypie/resources.py\", line 195, in wrapper
      response = callback(request, *args, **kwargs)
    File \"/Users/user/Documents/workspace/test/django-env/lib/python2.7/site-packages/tastypie/resources.py\", line 426, in dispatch_list
      return self.dispatch('list', request, **kwargs)
    File \"/Users/user/Documents/workspace/test/django-env/lib/python2.7/site-packages/tastypie/resources.py\", line 458, in dispatch
      response = method(request, **kwargs)
    File \"/Users/user/Documents/workspace/test/django-env/lib/python2.7/site-packages/tastypie/resources.py\", line 1326, in post_list
      updated_bundle = self.full_dehydrate(updated_bundle)
    File \"/Users/user/Documents/workspace/test/django-env/lib/python2.7/site-packages/tastypie/resources.py\", line 832, in full_dehydrate
      bundle.data[field_name] = field_object.dehydrate(bundle, for_list=for_list)
    File \"/Users/user/Documents/workspace/test/django-env/lib/python2.7/site-packages/tastypie/fields.py\", line 135, in dehydrate
      return self.convert(current_object)
    File \"/Users/user/Documents/workspace/test/django-env/lib/python2.7/site-packages/tastypie/fields.py\", line 234, in convert
      return int(value)
  
  ValueError: invalid literal for int() with base 10: ''"
  }
  </code></pre>