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

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

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

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

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

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. > >

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

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

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

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

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

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

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

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

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 >

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

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

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

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

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

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

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 >>

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

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

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

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

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

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

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 >

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

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

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 >

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

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

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

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,

Re: contrib.staticfiles app concerns

2010-10-21 Thread Ian Lewis
On Thu, Oct 21, 2010 at 12:25 PM, Jannis Leidel wrote: > Ian, > > > I thought about this too and had a long thread on Twitter with jezdez > about staticfiles. It occurred to me that adding more apps to contrib was > kind of a bad idea. I know "everyone" uses admin etc. but I