Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Ivan Sagalaev
Hi Russel, On 10/22/2010 05:20 AM, Russell Keith-Magee wrote: Jacob has already marked #9886 RFC, and on first inspection, the patch looks good to me too; I want to have a closer look before I commit, though. If you want to proceed assuming that #9886 will be committed (i.e., make the fix for #1

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Russell Keith-Magee
2010/10/21 Łukasz Rekucki : > On 20 October 2010 21:57, Jacob Kaplan-Moss wrote: >> 2010/10/20 Mikhail Korobov : >>> There is an unresolved question in the ticket: "The only hesitation is >>> the relationship with #12815; we should resolve that decision before >>> committing anything for this tick

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Russell Keith-Magee
On Fri, Oct 22, 2010 at 8:19 AM, Mikhail Korobov wrote: > Patch is ready for review: > http://bitbucket.org/kmike/django/changeset/37d977574923 > > This is the TempleteResponse by Simon Willison with tests and minor > tweaks. > > Notes: > > - TemplateResponse and SimpleTemplateResponse reside in

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Russell Keith-Magee
On Fri, Oct 22, 2010 at 12:34 AM, Ivan Sagalaev wrote: > On 10/21/2010 03:22 PM, Ivan Sagalaev wrote: >> >> On 10/21/2010 11:49 AM, Mikhail Korobov wrote: >>> >>> 2. Does TemplateResponse allow pretty exception pages or not? Is Ben's >>> issue resolved? >> >> I'll look into it this evening (MSD).

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Mikhail Korobov
Patch is ready for review: http://bitbucket.org/kmike/django/changeset/37d977574923 This is the TempleteResponse by Simon Willison with tests and minor tweaks. Notes: - TemplateResponse and SimpleTemplateResponse reside in django.template.response - django/shortcuts/__init__.py used to have ext

Re: contrib.staticfiles app concerns

2010-10-21 Thread Waldemar Kornewald
On Thu, Oct 21, 2010 at 10:48 PM, Luke Plant wrote: > On Thu, 2010-10-21 at 20:25 +0200, Waldemar Kornewald wrote: > > To fully support one of the other assets managers you mention, we would > need the admin and all contrib apps to get on board and use the template > tags etc. This would be a much

Re: contrib.staticfiles app concerns

2010-10-21 Thread Waldemar Kornewald
On Thu, Oct 21, 2010 at 11:43 PM, Jannis Leidel wrote: >> Is staticfiles supposed to put "app/static/style.css" into >> "/style.css" or "/app/style.css"? Currently it behaves >> like the latter, but if it should behave like Django's templates we >> need to fix the code. > > The latter is correct.

Re: contrib.staticfiles app concerns

2010-10-21 Thread Waldemar Kornewald
On Thu, Oct 21, 2010 at 10:04 PM, Jacob Kaplan-Moss wrote: > On Thu, Oct 21, 2010 at 1:25 PM, Waldemar Kornewald > wrote: >> My proposal would've been to not add staticfiles in the first place, >> but it seems to be too late, now. > > If you think reverting the commit's a good idea, please feel f

Re: Proposal: A better way to handle unic de in messages, etc

2010-10-21 Thread Yo-Yo Ma
Case closed (by Tobias Luetke). I appears that the exception occurred somewhere between my keyboard and my chair... as usual :) On Oct 21, 1:36 pm, Yo-Yo Ma wrote: > OK, I finally created a ticket:http://code.djangoproject.com/ticket/14525 > > On Oct 20, 10:28 pm, Yo-Yo Ma wrote: > > > Thanks, I

Re: contrib.staticfiles app concerns

2010-10-21 Thread Jannis Leidel
> Is staticfiles supposed to put "app/static/style.css" into > "/style.css" or "/app/style.css"? Currently it behaves > like the latter, but if it should behave like Django's templates we > need to fix the code. The latter is correct. E.g. files from apps (/static/*) will be collected at the same

Re: contrib.staticfiles app concerns

2010-10-21 Thread Luke Plant
On Thu, 2010-10-21 at 20:25 +0200, Waldemar Kornewald wrote: > My proposal would've been to not add staticfiles in the first place, > but it seems to be too late, now. From what I can see, only the > finder/storage API looks fully reusable. More advanced asset managers > will use custom templateta

Re: contrib.staticfiles app concerns

2010-10-21 Thread Waldemar Kornewald
On Thu, Oct 21, 2010 at 10:09 PM, Jacob Kaplan-Moss wrote: > On Thu, Oct 21, 2010 at 2:33 PM, Tobias McNulty > wrote: >> Ah, so realistically we should put all our media in 'static/', like >> for templates, if we want to avoid conflicts with other apps.  Would that be >> worth mentioning as a co

Re: contrib.staticfiles app concerns

2010-10-21 Thread Waldemar Kornewald
On Thu, Oct 21, 2010 at 7:20 PM, flo...@gmail.com wrote: > I think staticfiles is an *excellent* contribution, and if there is > some advanced use case that it doesn't do, then let's do our best to > make it extensible enough to make that use case possible.  Easy things > (like bundling media with

Re: contrib.staticfiles app concerns

2010-10-21 Thread Jacob Kaplan-Moss
On Thu, Oct 21, 2010 at 2:33 PM, Tobias McNulty wrote: > What's the argument against serving the original files directly? It means that when you add new apps you have to update your Apache/Nginx/whatever config. Back in the day (pre-open-source), every time you added an app you had to edit your A

Re: contrib.staticfiles app concerns

2010-10-21 Thread Jacob Kaplan-Moss
On Thu, Oct 21, 2010 at 1:25 PM, Waldemar Kornewald wrote: > Thanks a lot for the clarification. So, then the "bad batteries" part > in Eric's talk "Why Django sucks and how we can fix it" doesn't > receive much agreement within the Django core team? I think that's kind of irrelevant: people comp

Re: Proposal: A better way to handle unic de in messages, etc

2010-10-21 Thread Yo-Yo Ma
OK, I finally created a ticket: http://code.djangoproject.com/ticket/14525 On Oct 20, 10:28 pm, Yo-Yo Ma wrote: > Thanks, I'll do that in the morning with a traceback, and steps to > reproduce it. > > On Oct 20, 6:15 pm, Russell Keith-Magee > wrote: > > > On Thu, Oct 21, 2010 at 12:50 AM, Yo-Yo

Re: contrib.staticfiles app concerns

2010-10-21 Thread Tobias McNulty
On Thu, Oct 21, 2010 at 11:58 AM, Jacob Kaplan-Moss wrote: > On Thu, Oct 21, 2010 at 10:44 AM, Tobias McNulty > wrote: > > I think the issue is that the commit has already been made, and that > doesn't > > feel like the right time to anyone to submit an alternate proposal. > > Well, that's why we

Re: contrib.staticfiles app concerns

2010-10-21 Thread Waldemar Kornewald
Hi Jakob, On Thu, Oct 21, 2010 at 5:10 PM, Jacob Kaplan-Moss wrote: > On Thu, Oct 21, 2010 at 3:50 AM, Waldemar Kornewald > wrote: >> With this reasoning we could as well add django-debug-toolbar, South, >> django-registration and many other popular apps. What makes >> staticfiles different? Ser

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Mikhail Korobov
I love programming: two-liner shortcut turns to be a massive core refactoring ;) Ivan, thank you for the research. I'll provide a draft patch for 'render == TemplateResponse' soon. By the way, Łukasz Rekucki's suggestion to add the 'response_class' to render shortcut is complicated much by Templa

Re: contrib.staticfiles app concerns

2010-10-21 Thread flo...@gmail.com
It seems like everyone's talking about two different things here: 1) Should Django add more apps to contrib? 2) Does staticfiles solve a real need that users of Django have today? Is it the de-facto implementation of a common pattern? Let's just drop the discussion of the first point for the pur

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Ivan Sagalaev
On 10/21/2010 03:22 PM, Ivan Sagalaev wrote: On 10/21/2010 11:49 AM, Mikhail Korobov wrote: 2. Does TemplateResponse allow pretty exception pages or not? Is Ben's issue resolved? I'll look into it this evening (MSD). So I did. There are actually two problems: - Exceptions in response middl

Re: contrib.staticfiles app concerns

2010-10-21 Thread Jacob Kaplan-Moss
On Thu, Oct 21, 2010 at 10:44 AM, Tobias McNulty wrote: > I think the issue is that the commit has already been made, and that doesn't > feel like the right time to anyone to submit an alternate proposal. Well, that's why we use revision control: if there's a rough consensus that a commit was a m

Re: contrib.staticfiles app concerns

2010-10-21 Thread Tobias McNulty
On Thu, Oct 21, 2010 at 11:01 AM, Jacob Kaplan-Moss wrote: > On Thu, Oct 21, 2010 at 8:19 AM, Tobias McNulty > wrote: > > That thread's pretty old and doesn't really end on anything conclusive > other > > than "work has started". I do see that the patch was updated numerous > times > > on the ti

Re: #14512: Decorating class based views (was Re: new class based views)

2010-10-21 Thread Łukasz Rekucki
On 21 October 2010 16:53, Luke Plant wrote: > On Thu, 2010-10-21 at 15:02 +0200, Łukasz Rekucki wrote: > >> > Good catch!  The attached patch should fix it, but it feels a bit icky, >> > due to the double application of the decorator. Let me know if it solves >> > this problem for you, or if you c

Re: contrib.staticfiles app concerns

2010-10-21 Thread Peter Landry
On 10/21/10 11:10 AM, "Jacob Kaplan-Moss" wrote: > On Thu, Oct 21, 2010 at 3:50 AM, Waldemar Kornewald > wrote: >> With this reasoning we could as well add django-debug-toolbar, South, >> django-registration and many other popular apps. What makes >> staticfiles different? Seriously, I don't see

Re: contrib.staticfiles app concerns

2010-10-21 Thread Jacob Kaplan-Moss
On Thu, Oct 21, 2010 at 3:50 AM, Waldemar Kornewald wrote: > With this reasoning we could as well add django-debug-toolbar, South, > django-registration and many other popular apps. What makes > staticfiles different? Seriously, I don't see it. Jannis proposed that we add static files in. Brian c

Re: contrib.staticfiles app concerns

2010-10-21 Thread Jacob Kaplan-Moss
On Thu, Oct 21, 2010 at 8:19 AM, Tobias McNulty wrote: > That thread's pretty old and doesn't really end on anything conclusive other > than "work has started".  I do see that the patch was updated numerous times > on the ticket [1] this month, but was there an associated review on the > mailing l

Re: #14512: Decorating class based views (was Re: new class based views)

2010-10-21 Thread Luke Plant
On Thu, 2010-10-21 at 15:02 +0200, Łukasz Rekucki wrote: > > Good catch! The attached patch should fix it, but it feels a bit icky, > > due to the double application of the decorator. Let me know if it solves > > this problem for you, or if you can think of a better way to fix it. > > I does fel

Re: contrib.staticfiles app concerns

2010-10-21 Thread Tobias McNulty
On Thu, Oct 21, 2010 at 8:54 AM, Dougal Matthews wrote: > On 21 October 2010 13:41, Tobias McNulty wrote: > >> is there another mailing list thread or wiki page somewhere that follows >> or summarizes the decisions that went into django.contrib.staticfiles? I >> think pointing to the fact that

Re: #14512: Decorating class based views (was Re: new class based views)

2010-10-21 Thread Łukasz Rekucki
On 21 October 2010 14:31, Luke Plant wrote: > On Thu, 2010-10-21 at 01:40 +0200, Łukasz Rekucki wrote: > >> On a related note, while writing a class_decorator() I noticed that >> method_decorator() doesn't work with decorators that set attributes on >> the view (like csrf_exempt). This is because

Re: contrib.staticfiles app concerns

2010-10-21 Thread Dougal Matthews
On 21 October 2010 13:41, Tobias McNulty wrote: > is there another mailing list thread or wiki page somewhere that follows > or summarizes the decisions that went into django.contrib.staticfiles? I > think pointing to the fact that such a process has already happened would > also resolve a lot

Re: contrib.staticfiles app concerns

2010-10-21 Thread Tobias McNulty
On Thu, Oct 21, 2010 at 5:27 AM, James Bennett wrote: > In the future, it may well turn out that people will commonly need > much more than what the current iteration of staticfiles provides. But > we can't cross that bridge until we come to it; for now, staticfiles > solves the common version of

Re: #14512: Decorating class based views (was Re: new class based views)

2010-10-21 Thread Luke Plant
On Thu, 2010-10-21 at 01:40 +0200, Łukasz Rekucki wrote: > On a related note, while writing a class_decorator() I noticed that > method_decorator() doesn't work with decorators that set attributes on > the view (like csrf_exempt). This is because the decorator is invoked > on a closure inside _wra

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Ivan Sagalaev
On 10/21/2010 11:49 AM, Mikhail Korobov wrote: 2. Does TemplateResponse allow pretty exception pages or not? Is Ben's issue resolved? I'll look into it this evening (MSD). -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this g

Re: contrib.staticfiles app concerns

2010-10-21 Thread James Bennett
On Thu, Oct 21, 2010 at 3:50 AM, Waldemar Kornewald wrote: > It's not even future-proof. We're heading towards larger client-side > web apps which means there will be HTML5 offline manifests and apps > consisting of more than 50 files. Even the combination of > django_compressor with staticfiles c

Re: contrib.staticfiles app concerns

2010-10-21 Thread Waldemar Kornewald
On Thu, Oct 21, 2010 at 5:25 AM, Jannis Leidel wrote: >> The core 'django.views.static.serve' and >> 'django.core.context_processors.media' are deprecated in favor of the >> staticfiles equivalents in contrib. Is the idea that the contrib app is a >> stepping stone to providing core functionali

Re: contrib.staticfiles app concerns

2010-10-21 Thread Mikhail Korobov
I think that staticfiles in contrib is a good idea because with it authors of reusable apps have an answer for the "How should user install app's static files?" question. They already know how to make python code and django templates available, but static files was a bit of pain before. Now the puz

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Mikhail Korobov
Well, I don't mean that now we all must write only class-based views. I was talking about reusable views and most views don't have to be reusable (though it would be nice). Django now can help developer in writing reusable views and it was not the case when TemplateResponse was invented. That's wha

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread Ivan Sagalaev
On 10/21/2010 11:10 AM, James Bennett wrote: Django cares about whether your views meet the following criteria: 1. Is a callable object. 2. When called, accepts an instance of HttpRequest as its first positional argument. 3. When called, returns an instance of HttpResponse or raises an exception

Re: Gentle Proposal: add 'render' shortcut in 1.3

2010-10-21 Thread James Bennett
On Thu, Oct 21, 2010 at 1:29 AM, Ivan Sagalaev wrote: > Can someone of core committers clarify this: is it now recommended to write > all views as classes? Django cares about whether your views meet the following criteria: 1. Is a callable object. 2. When called, accepts an instance of HttpReque