[python] django User.objects.filter

Discussion in 'PHP' started by optimazer, 28 Nov 2009.

  1. optimazer

    optimazer Member

    Joined:
    4 Dec 2008
    Messages:
    46
    Likes Received:
    11
    Reputations:
    0
    Code:
    from django.contrib.auth.models import User
    
    def MailChecking( request ):
      if User.objects.filter(email=request.POST['email']).count() != 0 :
        return HttpResponse('-1')
      return HttpResponse('0')
    
    def LoginChecking( request ):
      if User.objects.filter(username = request.POST['login']).count() != 0 :
        return HttpResponse('-1')
      return HttpResponse('0')
    странно не работают две функции не пойму почему

    при этом пост-параметры валидны и не пусты

    почему?