On Wednesday, 21 March 2012 11:12:09 UTC-7, Daniel Sokolowski wrote: > > Hi All, > > I have the following code: http://dpaste.com/719654/ for a session > based cart implementation I've created. I run into an odd bug/issue > that I can't figure out, when I create or retrieve the Cart instance > from session by hooking into __new__ class method my session gets > wiped or corruped I think, for example I get logged out of admin > howefver the cart contents seem to stick. Also the session key stays > the same as I have tested for that. But if I create the cart by > calling the Cart.get_cart(...) method all works as expected. > > Any thoughts? I might have a bug somewhere else, and so second hand of > eyes helps. > > Please note if you are using __new__ or get_cart uncomment either line > 78-79
Argh. I can't read that code at all. If you're posting code for feedback, please remove commented-out lines. You shouldn't be overriding __new__ at all. There's almost never a reason to do this. Use __init__ instead. -- DR. -- 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/-/u59qmdLinNQJ. 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.