2011-03-19 98 views
0

我的觀點:類型錯誤 - SeekDeals()意外的關鍵字參數 'user_provider'

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) 

回答

0

調用您的視圖「SeekDeals」已經隱藏了名爲「SeekDeals」的模型。重命名其中一個。

+0

真棒好友!你救了我一輩子:D。 – 2011-03-19 12:16:19

相關問題