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, 'edit' is not in request.GET, so > 'sale' never gets a value. When you then subsequently save the form, > it tries to save a new instance, which fails because it already > matches a row in the database. > > Cheers > > Tom > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/shSrqRlsfa4J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.