Monday, August 4, 2014

Re: html response before saving object

database save is not async.

a few possibilities:
- does the product exist?
- is the cart_item really not created? (or is the cart the thing not being created?)
- is the prefetch_related pre-caching the related cart items, so in the template it doesn't see the new item? (hint: redirect to the same page to load the page again)
- are you using transactions?
- you could moving around some print statements, or my favorite: assert False, to see what code is actually getting run.

also, while you're upgrading (or after), you can now use simpler code for that last line:
return render(request, 'products/cart.html', response_args)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/12912e81-254a-4704-8d62-343632c8bc55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment