Open wcbeard opened 12 years ago
@d10genes, you might want to mention in these issues that you're trying to replicate the tutorial functionality, and include the model definition- otherwise they lack some important context. Great bugfinding otherwise :)
Ha, this has turned out to be a bunch more work than I thought- apparently we don't have any sort of relationship updates on the other side of the relationship until an object is saved. I almost have it figured out.
Doubling back. What you're trying to do here isn't actually supported in the Django ORM- the tutorial is trying to do this with saved objects, not unsaved. I started to run into some ridiculous cache issues and realized supporting fully un-saved queryset updates would be going above and beyond for most ORMs. Would it make sense for us? Maybe, but we want a drop-in integration, not a new layer for devs to learn. Changing to "needsthought"- I'll circle back and reevaluate next release.
For related models Choice and Polls, where a poll has multiple choices, creating multiple choices, setting their poll and saving the single poll does not save them to database. (you have to manually save each choice)
Logging out and back in doesn't change anything, so it's not a cache issue.
This is supposed to replicate the Poll and Choice models from the Django tutorial. The model definitions are here.