On Wed, 2006-10-11 at 20:55 -0500, Mark Hattarki wrote: > I've changed my code to: > > if request.POST: > new_data = request.POST.copy() > new_data['status_id'] = 2 > errors = manipulator.get_validation_errors(new_data) > new_data['status_id'] = 2 > manipulator.do_html2python(new_data) > new_data['status_id'] = 2 > keys = new_data.keys() > #return HttpResponse("%s" % keys) > #return HttpResponse("status_id = %s " % new_data['status_id']) > #return HttpResponse("%s" % keys) > #try: > new_data = manipulator.save(new_data) > #except OperationalError, inst: > # out = """ submission error %s """ % (new_data.keys()) > # return HttpResponse(out) > > > and I still get an error saying that "status_id" cannot be null. > > Perhaps the difference is that the example code you gave is an update, > not an insert? > > Also, I don't pass a parameter to the manipulator like the example > does. I'm not sure what that does. But, it doesn appear to be related.
In another project (so that you don't destroy your existing work), trim down your models to the bare minimum. This would mean, say, having only two fields in the Bug model (say, a name and the foreign key) and a single field in the Status model. Ensure that you really do have a Status model instantiated (so Status.objects.get(pk=1) retrieves something) and then see if your view works. If you are still seeing the problem, post the two models and the full view code you are using (remove any commented out code lines, perhaps, since you seem to have more or them than actual code in the fragments you have posted so far and it just makes it harder to read). The idea is to get the minimal test case that fails. Hopefully it will only be a dozen or so lines of code. Then you can start to remove pieces one at a time until it works again and find out which is the critical piece. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---