On Oct 8, 3:26 pm, KillaBee <[EMAIL PROTECTED]>
wrote:
> from django.http import HttpResponse, HttpResponseRedirect
> from intranet.timesheets.models import Poll
> from intranet.timesheets.models import Choice
> from intranet.timesheets.models import timesheet
> from intranet.timesheets.models import time
> from django.shortcuts import render_to_response, get_object_or_404
> from django.core.urlresolvers import reverse
> from django.contrib.auth import views
> from django.contrib import databrowse
> from django.contrib import auth
> #from django.contrib.databrowse.plugins.calendars import
> CalendarPlugin
> from django import forms
> from django.contrib.auth import authenticate, login
>
> def times(request):
>     if request.method == 'POST': # If the form has been submitted...
>         form = timesheet(request.POST) # A form bound to the POST data
>         if form.is_valid(): # All validation rules pass
>             # Process the data in form.cleaned_data
>             user = form.cleaned_data['user']
>             fedtime = form.cleaned_data['fedtime']
>             date = form.cleaned_data['date']
>             worked = form.cleaned_data['worked']
>             return HttpResponseRedirect('/timesheets/?next=%s' %
> request.path)
>
>         else:
>             return render_to_response('timesheet.html', {'form':
> form, })
>
>     else:
>         form = timesheet(request.POST) # An unbound form
>         return render_to_response('timesheet.html', {'form': form,
>     })

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

</head>

<form action="/timesheet/" method="POST">

{{ form.as_p }}

<input type="submit" value="Submit" />

</form>

date

<input name="date" type="text">

fedtime

<input name="fedtime" type="text">

worked

<input name="worked" type="text">

user

<input name="user" type="text" id="user">

<input type="submit" name="Submit" value="Submit">

<form name="form1" method="post" action="">

</form>

</body>

</html>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to