http://wklej.org/id/837631/ - models, traceback, urls, views, database 
structure


After adding data to database I have error (data is added correctly but 
displays an error):



Exception Type: IntegrityError at /add/Exception Value: PRIMARY KEY must be 
unique


def add(request):
        if request.user.is_authenticated():
                user = request.user
                b = Product.objects.get(id=3)
                e = b.basket_set.create(name='basket_name', owner=user)
        e.save(force_insert=True)
        
        return render_to_response('basket.html')


How to fix it?

-- 
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/-/mdIBvzeje1gJ.
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.

Reply via email to