Hi,
I built an application with the development version of Django and
moved it to Apache. After I moved it, the self.clean_data variable
stopped loading for some reason. I know you have to validate the data
before this is availbable, but I am validating it. It works fine in
the development version, but for some reason it doesn't work in
Apache. Is there something I may be missing here? Any help would be
much appreciated.
Here is the code:
#########
view
#########
def index(request, customer_no=None):
if request.POST:
InstanceForm = CustomerForm(request.POST)
if InstanceForm.is_valid():
instance = InstanceForm.save(True, customer_no)
return HttpResponseRedirect('/customer/%s' %
instance.customer_no)
else:
if customer_no is not None:
instance = Customer.objects.get(customer_no=customer_no)
InstanceForm = CustomerForm(instance=instance)
else:
InstanceForm = CustomerForm()
return render_to_response('customer/customer_index.html',
{'form': InstanceForm,
'states':getStates()},
RequestContext(request))
########
form
########
class CustomerForm(forms.Form):
def __init__(self, data=None, auto_id='id_%s', prefix=None,
initial=None, instance=None):
......
############################################
#FUNCTION:
# Saves the form to customer model
#--returns an instance of a Customer object
############################################
def save(self, commit, customer_no):
data_dict = {
'customer_no' : customer_no,
'customer_no_index' : customer_no_index,
'customer_no_group_id' : customer_no_group,
'contact_last' : self.clean_data['contact_last'],
'contact_first' : self.clean_data['contact_first'],
....
}
from main_site.customer.models import Customer
instance = Customer(**data_dict)
if commit:
instance.save()
return instance
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---