title: Django class problem
body: <p>first excuse me for my english it isn't the best one.</p>
  
  <p>I'm pretty new to django and python and i try to programm a user authentification.
  I used the django documentation and everything works fine with these code below:</p>
  
  <pre><code>def anges(request):
  
          username = []
          password = []
  
          if request.method == "POST":
                  username = request.POST['username']
                  password = request.POST['password']
                  user = authenticate(username=username, password=password)
                  render_to_response ('registration/login.html', {'username': username, 'password': password})
  
                  if user is not None:
                          if user.is_active:
                                  login(request, user)
                                  angestellte_list = Employee.objects.all().order_by('lastname')
                                  return render_to_response(("emp/angestellte.html"), {'angestellte_list': angestellte_list})
                          else:
                                  return HttpResponse('disabled account')
                  else:
                          return HttpResponse('invalid login')
          else:
                  return render_to_response ('registration/login.html', {'username':username, 'password':password})
  </code></pre>
  
  <p>But this is just a function and i want to use this object oriented for my other functions in my views.py, because of DRY.
  This is just a first test but it doesn't works because the debugger says:"global name 'request' is not defined"
  That's my code: </p>
  
  <pre><code>class einloggen:
  
          def __init__(self):
                  self.Username = request.POST['username']
  
          def angestellte(self):
                  return HttpResponse("hello")
  </code></pre>
  
  <p>How can I use the request variable in classes or is there anything more to consider?</p>