Files
2012-02-21 01:15:00 -05:00

1 line
5.1 KiB
JSON

[{"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299004006.043514, "message": "What's the pattern here? I've never used the create/update generic views because I could never figure out how to handle this.", "group_id": 81, "id": 236634}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299004082.999393, "message": "I'd be surprised if having a hidden field for \"owner\" is the trick. Seems better to somehow get at the request.user and not trust the POSTed values.", "group_id": 81, "id": 236650}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299004194.0298841, "message": "I suppose CBV could be the solution here, but it still seems odd that there isn't some obvious way to handle this.", "group_id": 81, "id": 236678}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299007308.1709399, "message": "yeah, I guess the wrapping is the way to win.", "group_id": 81, "id": 237200}, {"user_id": 8364, "stars": [], "topic_id": 9764, "date_created": 1299006121.2383461, "message": "I've used a middleware that stashes request.user in some threadlocals storage", "group_id": 81, "id": 237039}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299006322.642868, "message": "Sounds interesting. Did that last for you, or did you end up just implementing an actual view (even just wrapping the generic)?", "group_id": 81, "id": 237058}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299007325.66769, "message": "That's a decent alternative to \"not playing\".", "group_id": 81, "id": 237203}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299007378.4054279, "message": "I guess I'll shut my mouth until I pour over the CBV docs - perhaps there's a hook in there.", "group_id": 81, "id": 237216}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299006655.7308691, "message": "Which is exactly what I've always done - but again, I wonder about those CU views. When on earth will I ever get to use them?", "group_id": 81, "id": 237095}, {"user_id": 4581, "stars": [], "topic_id": 9764, "date_created": 1299007100.718524, "message": "I've used the form_class parameter to update_object. In this case, the User's FK already existed. Here's an example: https://bitbucket.org/bkmontgomery/django-notes/src/a92ab6eaf858/notes/views.py#cl-73", "group_id": 81, "id": 237161}, {"user_id": 4581, "stars": [], "topic_id": 9764, "date_created": 1299006609.1633799, "message": "Personally, I prefer to just write my own views when doing something like this.", "group_id": 81, "id": 237093}, {"user_id": 4581, "stars": [], "topic_id": 9764, "date_created": 1299007133.772136, "message": "Disclaimer: I haven't touched that code in almost a year :(", "group_id": 81, "id": 237171}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299007233.7614629, "message": "mhmmm", "group_id": 81, "id": 237189}, {"user_id": 4581, "stars": [], "topic_id": 9764, "date_created": 1299007467.5488319, "message": "I'm sure there's a more modern way to do that. I haven't even looked at the CBV docs.", "group_id": 81, "id": 237232}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299008459.909312, "message": "Looking now, again I'm a little surprised. There's nothing obvious indicated.", "group_id": 81, "id": 237381}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299008664.2740009, "message": "ok, so this is interesting: http://docs.djangoproject.com/en/1.2/topics/generic-views/#performing-extra-work", "group_id": 81, "id": 237407}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299008759.826292, "message": "the suggestion it would appear is what we've already discussed - wrapping the generic view - however with create and update, we have this extra problem which is they are operating with the assumption that the values are being passed in via POST (since it's coming from a model form).", "group_id": 81, "id": 237426}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299008827.6310711, "message": "so, does that mean we'd have to essentially push values into POST in the wrapper? I'm thinking it's either that or forget the generic view entirely and just handle the object creation right here in your custom view (back where we started).", "group_id": 81, "id": 237450}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299008904.260231, "message": "uph - no hang on - I was in the wrong docs again. This new search thing keeps catching me.", "group_id": 81, "id": 237469}, {"user_id": 214, "stars": [], "topic_id": 9764, "date_created": 1299017118.474946, "message": "@theomn There is no good solution to this with the function generic views. This is precisely the kind of thing that made people want class-based instead. The new CBVs should be able to handle this just fine by overriding a single method.", "group_id": 81, "id": 239557}, {"user_id": 5981, "stars": [], "topic_id": 9764, "date_created": 1299273558.165468, "message": "Yes indeed @carljm, I'm finding that now. Sucks that my searches keep getting version-jacked. I think CBV are my new favorite thing.", "group_id": 81, "id": 272904}]