Form Validation and unique_together on update a model

2012-04-13 Thread Massimo Barbierato
Hi all, i'm new. I searched in the group for answers to my problem, but i didn't find anything :( My problem is this: i have a model with two fields in unique_together, the related ModelForm and the view. When i pass an instance of my model to the form to update it and then save it, i receive

Re: Form Validation and unique_together on update a model

2012-04-13 Thread Massimo Barbierato
Thanks Tom, you're right!!! I solved it passing 'edit' again. Thanks again Max (I'm speculating a little) > > In your code snippet, lines 36-38: > > sale = None > if 'edit' in request.GET: > sale = Sales.objects.get(sale_id=request.GET['edit']) > > When you submit the form again

ModelFormSet submit with JQuey

2012-04-14 Thread Massimo Barbierato
I need to submit two forms with jquery and not with two input buttons. One of them is a model_formset so i have to add {{ form.management_form }}, and i did it, but i still receive the error: "ManagementForm data is missing or has been tampered with". How can i resolve it? Thanks Max -- You

ModelFormSet submit with JQuey

2012-04-14 Thread Massimo Barbierato
I need to submit two "forms" with "jquery" because i don't want to put two input buttons in the template. The problem is that one of them is a model_formset and it needs {{ formset.management_form }}, and i inserted it in the template, but i still receive the error "ValidationError: ManagementF

Django and SQL Server

2016-07-04 Thread Massimo Barbierato
Hi everybody. I have a little problem with SQL Server. I'm using django-pyodbc as db backend but when i run inspectdb it occurs an error because some of the tables in the SQL Server database have unicode chars (an example: the table name is 'Attività'). How can I resolve that? I can't change t