Hopefully you guys can spot an error I've not been able to. This is
the error I get:

AttributeError at /vendor/Chef/1/
'Order_DetailForm' object has no attribute 'save'
Request Method: POST
Request URL: http://192.168.1.104:8000/vendor/Chef/1/
Exception Type: AttributeError
Exception Value: 'Order_DetailForm' object has no attribute 'save'

My view:
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.newforms import form_for_model

def vendor(request, vendor_name, vendor_id):
  OrderForm = form_for_model(Order)
  OrderDetailForm = form_for_model(Order_Detail)
  cart_id = find_order(manager_id)

  if request.method == 'POST':
    form = OrderDetailForm(request.POST)
    if cart_id != 0:
      if form.is_valid():.
        new_detail = form.save(commit=False)
        return HttpResponseRedirect(".")
  else:
    form = OrderDetailForm(detail_form_data)

  return render_to_response("vendor/" + vendor_name + ".html",
locals())

I tried .is_bound and a similar problem came up. Basically I can't
access some functions and fields that're available from
form_for_model. I also tried commenting out the save, creating valid =
form.is_valid() and printing it out. It printed out "True", therefore
my form is valid, but the thing is I cannot save.

Also, the error "'Order_DetailForm' object has no attribute 'save'"
doesn't look right. Isn't it supposed to be "'OrderDetailForm' object
has no attribute 'save'" because I defined OrderDetailForm, not
Order_DetailForm?

Thanks for the help


--~--~---------~--~----~------------~-------~--~----~
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