Question

Mon point de vue:

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

Où SeekDeals est le tableau dans ma base de données avec des champs comme:

  user_seeker
  user_provider
  seek_id

Le retraçage -

        # 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)
Était-ce utile?

La solution

Appel à votre vue « SeekDeals » a ombré votre modèle appelé « SeekDeals ». Renommer un d'entre eux.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top