Any Thoughts
On Aug 21, 10:51 pm, Robert <[EMAIL PROTECTED]> wrote:
> Sure, it's:
>
> [code
>
> from quizmodo.base.forms import ClassEventForm
>
> class StackForm(ClassEventForm):
> name = forms.CharField(max_length=100)
> description = forms.CharField(widget=forms.Textarea)
> anonymous = forms.BooleanField(required=False)
> private = forms.BooleanField(required=False)
>
> @login_required
> def newStack(request):
> if request.method == "POST":
> form = StackForm(request.POST)
> if form.is_valid() or request.POST['submit'] == "Cancel":
> if request.POST['submit'] == "Save":
> Stack.objects.create(user=request.user,
> c=form.clean_data['c'],
> event=form.clean_data['event'],
> name=form.clean_data['name'],
>
> description=form.clean_data['description'],
> anonymous=form.clean_data['anonymous'],
> private=form.clean_data['private'])
>
> return HttpResponseRedirect('/flashstacks/')
> else:
> form = StackForm(my_id=1)#BS id for right now, not the source of
> any errors
> return render_to_response('base/new_edit.html', {'form':form,
> 'title':'New Stack', 'user':request.user})
>
> [/code]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---