mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-21 07:31:00 +00:00
1 line
8.8 KiB
JSON
1 line
8.8 KiB
JSON
[{"user_id": 4858, "stars": [], "topic_id": 17549, "date_created": 1302072011.6833429, "message": "Which is better?", "group_id": 81, "id": 555499}, {"user_id": 4858, "stars": [{"date_created": 1302163679.8549111, "user_id": 27863}, {"date_created": 1302194508.0258629, "user_id": 27894}], "topic_id": 17549, "date_created": 1302072020.2442889, "message": "# news/urls.py\nurlpatterns = patterns('news.views',\n url(r'^$', 'archive', name='news_archive'),\n url(r'^(\\d+)$', 'detail', name='news_detail'),\n)\n\n# project's urls.py\nurlpatterns = patterns('',\n # ...\n url(r'^news/', include('news.urls')),\n)\n\n# and {% url 'news_archive' %} in templates", "group_id": 81, "id": 555500}, {"user_id": 4858, "stars": [{"date_created": 1302194484.9507501, "user_id": 27894}], "topic_id": 17549, "date_created": 1302072022.986599, "message": "or", "group_id": 81, "id": 555501}, {"user_id": 4858, "stars": [{"date_created": 1302163682.0160191, "user_id": 27863}, {"date_created": 1302169697.5943639, "user_id": 4937}], "topic_id": 17549, "date_created": 1302072027.9989581, "message": "# news/urls.py\nurlpatterns = patterns('news.views',\n url(r'^$', 'archive', name='archive'),\n url(r'^(\\d+)$', 'detail', name='detail'),\n)\n\n# project's urls.py\nurlpatterns = patterns('',\n # ...\n url(r'^news/', include('news.urls', namespace='news')),\n)\n\n# and {% url 'news:archive' %} in templates\n", "group_id": 81, "id": 555503}, {"user_id": 1, "stars": [{"date_created": 1302099793.114409, "user_id": 13912}, {"date_created": 1302110094.2286291, "user_id": 209}, {"date_created": 1302117065.420444, "user_id": 1277}, {"date_created": 1302120889.065583, "user_id": 6396}, {"date_created": 1302280770.8487461, "user_id": 12002}, {"date_created": 1302369589.4136839, "user_id": 6415}], "topic_id": 17549, "date_created": 1302075333.0492711, "message": "I do the first way with app underscores, but wow, now that I see them side-by-side, namespaces look much nicer!", "group_id": 81, "id": 556065}, {"user_id": 5436, "stars": [{"date_created": 1302138108.901737, "user_id": 927}, {"date_created": 1302170076.74791, "user_id": 213}], "topic_id": 17549, "date_created": 1302074958.7404399, "message": "namespaces any day of the week!", "group_id": 81, "id": 556015}, {"user_id": 5436, "stars": [], "topic_id": 17549, "date_created": 1302074982.280443, "message": "django projects have a tendancy to grow in number of apps", "group_id": 81, "id": 556019}, {"user_id": 1167, "stars": [], "topic_id": 17549, "date_created": 1302077080.330837, "message": "what about reusable apps that provides urls? The user gets the ability to specify the namespace he wants, potentially breaking url reversing... Or am I missing something?", "group_id": 81, "id": 556283}, {"user_id": 5124, "stars": [{"date_created": 1302076975.6709881, "user_id": 1}], "topic_id": 17549, "date_created": 1302076759.2656951, "message": "namespaces ftw! :)", "group_id": 81, "id": 556225}, {"user_id": 5124, "stars": [], "topic_id": 17549, "date_created": 1302077509.0835741, "message": "or, we can add setting for app, 'namespace' for example, which will be used in url reversing inside of reusable app", "group_id": 81, "id": 556382}, {"user_id": 5124, "stars": [], "topic_id": 17549, "date_created": 1302077142.5200729, "message": "@brutasse yep, looks like it's true.", "group_id": 81, "id": 556292}, {"user_id": 4858, "stars": [], "topic_id": 17549, "date_created": 1302076979.645225, "message": "Only one thing confuses me now: using namespace inside the app (eg, model's get_absolute_url) and declaring it outside of the app.", "group_id": 81, "id": 556260}, {"user_id": 1167, "stars": [{"date_created": 1302077260.317734, "user_id": 4858}], "topic_id": 17549, "date_created": 1302077180.754195, "message": "you can say \"use this prefix and nothing else\" in the docs but then, potential conflicts with an existing namespace in the project", "group_id": 81, "id": 556301}, {"user_id": 4858, "stars": [], "topic_id": 17549, "date_created": 1302077265.1142759, "message": "@brutasse yay!", "group_id": 81, "id": 556315}, {"user_id": 13817, "stars": [], "topic_id": 17549, "date_created": 1302081137.340663, "message": "I normally do the 1st kind... but have to agree namespaces look way better?", "group_id": 81, "id": 557147}, {"user_id": 1398, "stars": [], "topic_id": 17549, "date_created": 1302090999.4281571, "message": "url(r'^$', views.archive, name='news_archive'),", "group_id": 81, "id": 558022}, {"user_id": 1398, "stars": [], "topic_id": 17549, "date_created": 1302090959.5255699, "message": "I don't like either method. They make debugging that much harder. So I go with:", "group_id": 81, "id": 558015}, {"user_id": 5778, "stars": [], "topic_id": 17549, "date_created": 1302091873.5038049, "message": "I do as @pydanny does. I like the idea of namespaces instead, but they, being customizable, seem like a wonderful way to fill up a ticket system when people don't read the docs (or you don't write any docs)", "group_id": 81, "id": 558135}, {"user_id": 1398, "stars": [], "topic_id": 17549, "date_created": 1302090980.56235, "message": "from myapp import views", "group_id": 81, "id": 558020}, {"user_id": 13325, "stars": [], "topic_id": 17549, "date_created": 1302094246.0086861, "message": "Weird that in all these years I didn't come across the namespaces feature. Makes sense though.", "group_id": 81, "id": 558584}, {"user_id": 18694, "stars": [], "topic_id": 17549, "date_created": 1302097860.819736, "message": "...hmm it seems i've been reinventig the wheel! (again) ... Is it possible to assign multiple namespaces to a single include'd urls.py?", "group_id": 81, "id": 559411}, {"user_id": 1398, "stars": [], "topic_id": 17549, "date_created": 1302107227.3334041, "message": "Actually, what I normally do is from myapp.views import (item_detail, item_list, item_edit)", "group_id": 81, "id": 561201}, {"user_id": 1398, "stars": [], "topic_id": 17549, "date_created": 1302107249.5076301, "message": "Then do url(r'^$', item_list, name='item_list'),", "group_id": 81, "id": 561206}, {"user_id": 1398, "stars": [], "topic_id": 17549, "date_created": 1302107264.9993441, "message": "I keep the view names and the url names the same to simplify searches in code", "group_id": 81, "id": 561209}, {"user_id": 3978, "stars": [], "topic_id": 17549, "date_created": 1302109071.1126051, "message": "also as noted above. they don't seem to play well with get_absolute_url.", "group_id": 81, "id": 561477}, {"user_id": 1736, "stars": [{"date_created": 1302269102.4600649, "user_id": 5778}], "topic_id": 17549, "date_created": 1302108823.0432689, "message": "Namespaces exist mostly for apps that can be mounted in the URLs multiple times. A problem with using them like this is that they aren't recursive and can't be chained.", "group_id": 81, "id": 561448}, {"user_id": 209, "stars": [], "topic_id": 17549, "date_created": 1302110185.635289, "message": "With new style URLs, you can pass the current namespace to the template, but it'd still be ugly and require a with I think", "group_id": 81, "id": 561636}, {"user_id": 21387, "stars": [{"date_created": 1302280841.5342009, "user_id": 12002}], "topic_id": 17549, "date_created": 1302191221.9529691, "message": "IMHO, there shouldn't be a customizable 'namespace' feature. URL namespaces should already be there, implying the app's label, when using django.conf.urls.defaults.include.", "group_id": 81, "id": 576552}, {"user_id": 21387, "stars": [], "topic_id": 17549, "date_created": 1302191445.3713319, "message": "Another thing is about urls' names. Why don't just use the view function's name by default?", "group_id": 81, "id": 576583}, {"user_id": 1736, "stars": [], "topic_id": 17549, "date_created": 1302194593.61991, "message": "@eMyller That isn't the use-case for namspaces. Look at the admin system, you can map multiple admin sites in to the URL scheme, but the actual views in each are named the same. Namespaces to the rescue, since the name of each admin site can be used as a namespace.", "group_id": 81, "id": 577185}, {"user_id": 21387, "stars": [], "topic_id": 17549, "date_created": 1302194844.540324, "message": "@coderanger Yes, but I'm bringing the namespace concept for organization only; I meant that there should be an implicit way to wrap urls from an app like app_name.url_name; namespaces (as the current Django approach) would be an extra for the use-case you mentioned.", "group_id": 81, "id": 577224}, {"user_id": 21387, "stars": [], "topic_id": 17549, "date_created": 1302195447.602354, "message": "actually, they're already just an extra, but developers tend to use it as an organization feature -- others, that see that it's not, use prefixes in their url names.", "group_id": 81, "id": 577346}, {"user_id": 1736, "stars": [], "topic_id": 17549, "date_created": 1302196664.497283, "message": "@eMyller The problem is that neither URL configs nor views have to live in Django apps, so there is no way to do that automatically.", "group_id": 81, "id": 577537}] |