开发者

Type Error - SeekDeals() unexpected keyword argument 'user_provider'

My view :

def SeekDeals(request , reply_id):
    reply = SeekReply.objects.get(pk = reply_id)
    obj = SeekDeals (user_provider = reply.person)
    obj.user_seeker = request.user
    obj.seek_id = reply.seek_id
    obj.save()
    # Status - 1, is a flag which conveys that the solution has been found
    # The deal has been done and the seek solution should be taken out of the feed
    reply.seek_id.status = 1;
    reply.seek_id.save()
    replies = SeekReply.objects.filter(seek_id = reply.seek_id)
    for x in replies:
        x.status = 1;
        x.save()
    return HttpResponseRedirect('/seek/dealfixed')

Where SeekDeals is Table in my database with fields as :

  user_seeker
  user_provider
  seek_id

The traceback -

        # Apply view middleware
        for middleware_method in self._view_middleware:
            response = middleware_method(request, callback, callback_args, callback_kwargs)
            if response:
                return response
        try:
            response = callback(request, *callback_args, **callback_kwargs) ...
        except Exception, e:
            # If the view raised an exception, run it through exception
            开发者_高级运维# middleware, and if the exception middleware returns a
            # response, use that. Otherwise, reraise the exception.
            for middleware_method in self._exception_middleware:response = middleware_method(request, e)


Calling your view "SeekDeals" has shadowed your model called "SeekDeals". Rename one of them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜