类型错误 - SeekDeals()意外关键字参数'user_provider'

时间:2011-03-19 12:08:06

标签: django object typeerror

我的观点:

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')

SeekDeals在我的数据库中是表,其中字段为:

  user_seeker
  user_provider
  seek_id

追溯 -

        # 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)

1 个答案:

答案 0 :(得分:0)

调用您的视图“SeekDeals”已经遮蔽了您的模型“SeekDeals”。重命名其中一个。