Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello I am trying to create a clockIn clockOut website and I do not know how to get a row filtered by a persons name to add in the clock out time.

What I have tried:

if response.POST.get("clockIn"):
         if form.is_valid():
              n = form.cleaned_data["name"]
              t = Name(name = n, timeIn=datetime.now(), timeOut=NULL)
              t.save()
else:
         if form.is_valid():
              n = form.cleaned_data["name"]
              t = Name.objects
              t = t.filter(name = n)
              s = t(timeOut = datetime.now()) 
              s.save()

The first if statement is working fine but the else statement is where I am having trouble doing:
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900