Hi All,
I exclude a field in modelform because the info is known. It's a Customer >
1-to-n > Project model setup.
I get the following (1048, "Column 'customer_id' cannot be null") on a
form.save() which is correct. But how do I put that customer_id back in the
request.POST querydict?
I'm messing with the appendlist() but it seems like dirty work at the moment.
This is the clean method:
def project_add(request, customer_id=''):
customer = get_object_or_404(Customer, pk=customer_id)
if request.method == 'POST':
# here the customer_id needs to be put in somehow
if form.is_valid():
form.save()
request.user.message_set.create(message='Project created')
return HttpResponseRedirect('/myapp/project')
else:
form = ProjectForm()
return render_to_response(template+'/project_add.html', {'form': form,
'customer': customer})
Can anybody help me out?
Thanx!
Gerard.
--
urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---