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

1 line
18 KiB
JSON

[{"user_id": 4935, "stars": [], "topic_id": 7765, "date_created": 1298258927.626545, "message": "didn't know about those. article here in case anyone else missed it: http://docs.djangoproject.com/en/dev/topics/class-based-views/", "group_id": 81, "id": 155863}, {"user_id": 12747, "stars": [], "topic_id": 7765, "date_created": 1298258833.6287551, "message": "Is anyone using these yet in production? What are people's experiences? I'm starting a few new apps (for work and pleasure) and don't want to get stuck with generic views if they're going away....", "group_id": 81, "id": 155860}, {"user_id": 7, "stars": [], "topic_id": 7765, "date_created": 1298261465.2315619, "message": "maybe this week", "group_id": 81, "id": 155969}, {"user_id": 6688, "stars": [], "topic_id": 7765, "date_created": 1298261351.688704, "message": "I'm probably biased -- but I'm using them in a test project, and so far they've been really good", "group_id": 81, "id": 155961}, {"user_id": 12683, "stars": [], "topic_id": 7765, "date_created": 1298262679.34706, "message": "Class based views is the only way to go", "group_id": 81, "id": 156015}, {"user_id": 12683, "stars": [], "topic_id": 7765, "date_created": 1298262687.8171711, "message": "I saved so many lives of code by switching", "group_id": 81, "id": 156017}, {"user_id": 7, "stars": [{"date_created": 1298262802.814955, "user_id": 4156}, {"date_created": 1298262850.973624, "user_id": 1736}, {"date_created": 1298263543.7413571, "user_id": 1}], "topic_id": 7765, "date_created": 1298262785.396071, "message": "can we get @idan on doing a graphic for that now?", "group_id": 81, "id": 156022}, {"user_id": 6688, "stars": [], "topic_id": 7765, "date_created": 1298261384.6719379, "message": "Only downside is that @login_required is a little harder than it should be, but it's easy to work around, and easy to add as a later feature (1.4 timeframe)", "group_id": 81, "id": 155964}, {"user_id": 7, "stars": [], "topic_id": 7765, "date_created": 1298261416.8777859, "message": "I'm very excited to add support for them to django-taggit", "group_id": 81, "id": 155966}, {"user_id": 7, "stars": [], "topic_id": 7765, "date_created": 1298261459.782238, "message": "I've got a cool project that will really show 'em off I'm planning on doing", "group_id": 81, "id": 155968}, {"user_id": 4156, "stars": [{"date_created": 1298263540.039938, "user_id": 1}, {"date_created": 1298275659.9128959, "user_id": 13351}, {"date_created": 1298278279.4487, "user_id": 5195}, {"date_created": 1298285360.4912419, "user_id": 2687}, {"date_created": 1298355277.593648, "user_id": 5778}, {"date_created": 1298582647.1117229, "user_id": 1422}, {"date_created": 1300397425.1280739, "user_id": 6894}, {"date_created": 1300472761.7513671, "user_id": 4375}, {"date_created": 1300570415.665978, "user_id": 3705}, {"date_created": 1300641323.4090569, "user_id": 573}, {"date_created": 1301447301.672591, "user_id": 7320}], "topic_id": 7765, "date_created": 1298262757.4139719, "message": "When you use class-based views, you don't just save time -- you save *lives*. Download a Django 1.3 beta *TODAY*!", "group_id": 81, "id": 156018}, {"user_id": 4156, "stars": [], "topic_id": 7765, "date_created": 1298262765.574265, "message": "(sorry @sontek )", "group_id": 81, "id": 156019}, {"user_id": 7, "stars": [], "topic_id": 7765, "date_created": 1298262785.4032969, "message": "can we get @idan on doing a graphic for that now?", "group_id": 81, "id": 156023}, {"user_id": 4156, "stars": [], "topic_id": 7765, "date_created": 1298262817.6901431, "message": "oh no, you're multiplying @alex", "group_id": 81, "id": 156025}, {"user_id": 3160, "stars": [], "topic_id": 7765, "date_created": 1298266476.754411, "message": "Personally, I love the new class-based views. Some of our less Python inclined folks on the team are completely flummoxed by the multiple inheritance trees, however.", "group_id": 81, "id": 156780}, {"user_id": 214, "stars": [{"date_created": 1298316057.9050331, "user_id": 5582}, {"date_created": 1300600466.1104741, "user_id": 5734}], "topic_id": 7765, "date_created": 1298301899.983839, "message": "I like the flexibility of the CBVs, especially for extending reusable apps. My one hesitation about them is that I find it requires a lot of source-diving in multiple places to figure out what even the simplest views are doing, until you become intimately familiar with the various mixins.", "group_id": 81, "id": 159340}, {"user_id": 5852, "stars": [], "topic_id": 7765, "date_created": 1298304057.9311299, "message": "@alex :)", "group_id": 81, "id": 159513}, {"user_id": 11592, "stars": [{"date_created": 1300746625.116451, "user_id": 221}], "topic_id": 7765, "date_created": 1298302777.482419, "message": "I've just read their docs and that looks overengineered. Plain func-views were so much prettier.", "group_id": 81, "id": 159440}, {"user_id": 5852, "stars": [], "topic_id": 7765, "date_created": 1298303404.104888, "message": "@dpwiz the thing about generic views is that they're totally optional. If you think they're over-engineered, then just skip 'em. Personally, I mostly stick to plain functional-based views since most of my views are pretty simple. When they get more complex, then I appreciate having a more complex tool to build on.", "group_id": 81, "id": 159482}, {"user_id": 11592, "stars": [], "topic_id": 7765, "date_created": 1298303584.3415201, "message": "I just can't get the way CBVs are better than wrapper-views upon generic functions.", "group_id": 81, "id": 159489}, {"user_id": 214, "stars": [], "topic_id": 7765, "date_created": 1298303719.5808799, "message": "@dpwiz There are many things you simply can't customize by wrapping view functions, and have to depend on the app author adding a dedicated argument for them. And then you get these massive argument lists....", "group_id": 81, "id": 159498}, {"user_id": 7, "stars": [], "topic_id": 7765, "date_created": 1298304016.8874309, "message": "If we did get them totally wrong it's possible for them to exist outside of core, so a little competition wouldn't be a bad thing :)", "group_id": 81, "id": 159510}, {"user_id": 5852, "stars": [], "topic_id": 7765, "date_created": 1298304093.44538, "message": "Personally I think the API's good but the documentation - the reference especially really needs some work.", "group_id": 81, "id": 159516}, {"user_id": 5852, "stars": [], "topic_id": 7765, "date_created": 1298304131.4973979, "message": "Yes it's redundant, but it should have the complete aggregated set of context, options, methods, etc.", "group_id": 81, "id": 159521}, {"user_id": 7, "stars": [], "topic_id": 7765, "date_created": 1298303714.8409851, "message": "Because no amount of wrapping will let a generic view function return JSON", "group_id": 81, "id": 159496}, {"user_id": 5852, "stars": [], "topic_id": 7765, "date_created": 1298304101.536077, "message": "e.g. http://django.me/ListView <-- not helpful.", "group_id": 81, "id": 159518}, {"user_id": 1167, "stars": [], "topic_id": 7765, "date_created": 1298304330.8919051, "message": "@jacobian people will publish their own mixins and views, the API will improve over time. IMO the main improvement is that there is a foundation for thread-safe class-based views in django core. The API is just a matter of organizing and composing mixins", "group_id": 81, "id": 159532}, {"user_id": 5852, "stars": [], "topic_id": 7765, "date_created": 1298304412.918606, "message": "@brutasse yeah, I hope so. The big question is whether the mixin approach is the right one. I'm pretty convinced (obviously) but it *is* complex and it *is* annoyingly hard to document in a way that's clear both in terms of usage *and* internal functionality.", "group_id": 81, "id": 159538}, {"user_id": 5852, "stars": [], "topic_id": 7765, "date_created": 1298304428.564465, "message": "\"If the implementation is hard to explain, it's a bad idea.\"", "group_id": 81, "id": 159539}, {"user_id": 5852, "stars": [{"date_created": 1298309891.807606, "user_id": 4935}, {"date_created": 1300375044.14236, "user_id": 275}], "topic_id": 7765, "date_created": 1298303912.9689701, "message": "@dpwiz I'm curious - have you used generic view functions a lot? 'cause the main motivation behind class-based views was basically that nearly everyone who used them for a while ended up hating them. Including most notably *all* of the core contributors ;)", "group_id": 81, "id": 159503}, {"user_id": 5852, "stars": [], "topic_id": 7765, "date_created": 1298303973.3938949, "message": "But it's kinda a big experiment: it's one of the first really big features we've added to Django that's not coming out of code already being used in a lot of places. Instead it's of a synthesis of like a dozen different stabs at the same idea. So it's possible we got the API wrong - only time will tell.", "group_id": 81, "id": 159507}, {"user_id": 11592, "stars": [], "topic_id": 7765, "date_created": 1298305681.3336611, "message": "@jacobian i've used them a lot and at some times i actually prefer them to django-annoying and other \u00abhelpers\u00bb. And if things are going to get harder staying with them - it's just a sign to go back to custom views.", "group_id": 81, "id": 159600}, {"user_id": 1167, "stars": [], "topic_id": 7765, "date_created": 1298305172.8123541, "message": "@jacobian I admit it took me some time to get started with CBVs. Maybe the docs for mixins and views should be separate. The *views* api is really quite similar to generic views, the mixins thing is for more advanced users. I'm wondering if it'd be a good idea to have a higher-level howto that doesn't mention mixins at all, \"here are the attributes and methods you can customize on ListView\". Basically split ref/class-based-views into ref/cbv-views and ref/cbv-mixins, that would save a lot of scrolling :)", "group_id": 81, "id": 159572}, {"user_id": 13895, "stars": [], "topic_id": 7765, "date_created": 1298319402.190387, "message": "I am just about to port a project to CBVs. I love how my view code looks after the refatoring. But understanding the docs is pretty hard. Better said, I have to do a lot of scrolling and skimming in order to switch between classes and mixins.", "group_id": 81, "id": 166735}, {"user_id": 5367, "stars": [], "topic_id": 7765, "date_created": 1298581999.304965, "message": "I 'm late to the party I guess but I was ready to post a new topic on class based views.", "group_id": 81, "id": 202184}, {"user_id": 5367, "stars": [], "topic_id": 7765, "date_created": 1298582034.1921329, "message": "Are there any examples \"out there\" that actually use the new API?", "group_id": 81, "id": 202187}, {"user_id": 14653, "stars": [], "topic_id": 7765, "date_created": 1300374444.847038, "message": "I'm bumping this topic, because some of us, with Django1.3 almost here, are starting to get up to date with things like CBV. I have been reading the docs and I have to say I find the learning curve quite steep. It reminds me the old days going through Java docs, in a more simple way. So I'm not sure about migrating.", "group_id": 81, "id": 374750}, {"user_id": 14653, "stars": [], "topic_id": 7765, "date_created": 1300374504.562201, "message": "I would love to see some examples of why CBV is the way to go! Those ones that make you believe that CBV can save *lives* :)", "group_id": 81, "id": 374763}, {"user_id": 18316, "stars": [], "topic_id": 7765, "date_created": 1300378708.0059431, "message": "I've been using them extensively in this project: http://django-rest-framework.org although like you say, it's a bit of a learning curve. Still need to try to bring some of that work more closely into line with some of the existing generic views and Mixin classes rather than just subclassing View and defining my own Mixin classes,", "group_id": 81, "id": 375185}, {"user_id": 13325, "stars": [], "topic_id": 7765, "date_created": 1300396352.7638559, "message": "Would I even convert most of my views to class based?", "group_id": 81, "id": 377652}, {"user_id": 13325, "stars": [{"date_created": 1300405141.058439, "user_id": 13222}], "topic_id": 7765, "date_created": 1300395922.992841, "message": "I can't find any docs on just writing class based views. Only on the generics.", "group_id": 81, "id": 377607}, {"user_id": 14653, "stars": [], "topic_id": 7765, "date_created": 1300442870.995337, "message": "@emperorcezar the docs are very generic. They describe the new generic CBV and then some of the base classes and mixins, from which you are supposed to be able to build anything you need. Having more examples would be a good thing.", "group_id": 81, "id": 381005}, {"user_id": 14653, "stars": [], "topic_id": 7765, "date_created": 1300443147.5344, "message": "@eMyller why is that? why is it so helpful?", "group_id": 81, "id": 381023}, {"user_id": 14653, "stars": [], "topic_id": 7765, "date_created": 1300442940.2497089, "message": "@tomchristie I will have a look at your project. The other day I saw it and I was wondering why another app for doing REST APIs with Django? why not contributing to django-python or django-tastypie?", "group_id": 81, "id": 381012}, {"user_id": 21387, "stars": [{"date_created": 1300470194.0766599, "user_id": 1243}], "topic_id": 7765, "date_created": 1300442975.588964, "message": "Don't just \"convert\" your views to CBVs if you don't need such feature. I have implemented my own class-based generic views for Django 1.2 because I really needed it, and it is very helpful in my case.", "group_id": 81, "id": 381015}, {"user_id": 14057, "stars": [], "topic_id": 7765, "date_created": 1300443299.380563, "message": "i found the new CBV hard to understand, but looking at the doc and the code too helps to understand how it works.", "group_id": 81, "id": 381029}, {"user_id": 21387, "stars": [], "topic_id": 7765, "date_created": 1300457073.623224, "message": "@maraujop because I reause \"standard\" views like analysis pages, archives for different (but similar) models. A pretty reasonable use case for extending class based views.", "group_id": 81, "id": 382144}, {"user_id": 21387, "stars": [], "topic_id": 7765, "date_created": 1300457116.5920191, "message": "just remember that since it's a class, you can extend it, add your own stuff. this is what it's all about: extensibility.", "group_id": 81, "id": 382150}, {"user_id": 209, "stars": [], "topic_id": 7765, "date_created": 1300460565.1843071, "message": "*** piston, django-piston not django-python", "group_id": 81, "id": 382622}, {"user_id": 209, "stars": [], "topic_id": 7765, "date_created": 1300460510.521589, "message": "@maraujop @tomchristie *django-tastypie", "group_id": 81, "id": 382618}, {"user_id": 14653, "stars": [], "topic_id": 7765, "date_created": 1300471943.022706, "message": "@issackelly you are right, I don't what I was thinking :)", "group_id": 81, "id": 384365}, {"user_id": 5734, "stars": [], "topic_id": 7765, "date_created": 1300600811.3175471, "message": "@brutasse one reason is that (afaik) those two don't use class based views. So it's nice to have a REST framework that takes advantage of the latest django. Maybe those two could be retrofitted, not sure how difficult that would be.", "group_id": 81, "id": 390666}, {"user_id": 5734, "stars": [], "topic_id": 7765, "date_created": 1300600889.1611581, "message": "Is there anything about thread safety I should be worried about while using CBV, or does the way as_view initializes it handle everything?", "group_id": 81, "id": 390669}, {"user_id": 5734, "stars": [], "topic_id": 7765, "date_created": 1300601096.5811059, "message": "BTW, I'm finding CBV useful as a replacement for my growing list of view decorators. CBV is much cleaner and extensible. I find many of the provided mixins too opinionated though, an have mostly only relied on the View base class, and writing my own mixins (mostly since I'm not renderin templates, just serializing data)", "group_id": 81, "id": 390678}, {"user_id": 5734, "stars": [], "topic_id": 7765, "date_created": 1300601154.5648861, "message": "(sorry for typos, I'm on iPhone and apparently can't edit)", "group_id": 81, "id": 390684}, {"user_id": 18316, "stars": [], "topic_id": 7765, "date_created": 1300631719.2392361, "message": "@maraujop - Pretty much as @wahnfrieden says. I did start with piston as the base, but it wasn't possible to move to CBV and some other changes I wanted without rewriting the core. I do think there's plenty of scope for collaboration between tastypie/piston/restframework, maybe even some basics like content negotiation that could be valid for django core. Have chatted about this with a few peeps so will see where it goes.", "group_id": 81, "id": 392114}, {"user_id": 2045, "stars": [{"date_created": 1300648302.4842429, "user_id": 209}], "topic_id": 7765, "date_created": 1300634938.884798, "message": "@wahnfrieden Both Tastypie and Piston use class-based views, but predate the 1.3 CBVs. I don't see why the internal tech used should have much of an impact on deciding to use one or the other, though.", "group_id": 81, "id": 392234}, {"user_id": 5734, "stars": [], "topic_id": 7765, "date_created": 1300645481.6795189, "message": "Ah, then I take back what I said about them re: CBV. Thanks.", "group_id": 81, "id": 393049}, {"user_id": 18316, "stars": [], "topic_id": 7765, "date_created": 1300713403.1205881, "message": "@maraujop @joshbohde There's also a bunch of stuff in the browse-able API stuff that would have been a little awkward to implement in piston without rewiring some of the innards. (eg emitters being set at a global level, rather than per-view-class). And the low level refactoring to Django's CBV is useful, in that it lets you do nifty stuff like reuse some of the Mixin classes without using the framework wholesale. (eg. this http://django-rest-framework.org/howto/mixin.html)Having said that it's possible that I might look to merge some of the work back into either/both piston/tastypie. It's a little more complicated w/ piston ATM - kinda waiting to see if it shakes out with a new maintainer or not.", "group_id": 81, "id": 397608}, {"user_id": 221, "stars": [], "topic_id": 7765, "date_created": 1300746748.4253049, "message": "I haven't done a dive into the new class-based generic views, but in my own coding I generally wrap up similar views in a class that dispatches (like django's admin), where the view functions are methods on the class.", "group_id": 81, "id": 403266}, {"user_id": 3354, "stars": [], "topic_id": 7765, "date_created": 1300750886.1679101, "message": "Or do you use classmethods?", "group_id": 81, "id": 403669}, {"user_id": 3354, "stars": [], "topic_id": 7765, "date_created": 1300750863.5207629, "message": "So you create an instance and regster bound methods in the urlconf?", "group_id": 81, "id": 403663}]