Re: Proposal: Generic newforms media

2007-05-30 Thread Luke Plant
On Wednesday 30 May 2007 14:39:12 Russell Keith-Magee wrote: > I've just uploaded a new version of the patch that hopefully > addresses your concerns. This new version preserves the DSL for the > simple case, but if you want to manually define a media property to > perform inheritance based chang

Re: Proposal: Generic newforms media

2007-05-30 Thread Russell Keith-Magee
On 5/30/07, Luke Plant <[EMAIL PROTECTED]> wrote: > > I've had to add hacks in before to get around the inflexibility of inner > classes. In those cases, there was good reason for those inner > classes -- Django needs to be able to get at the data they contained > before any instances of the oute

Re: Proposal: Generic newforms media

2007-05-29 Thread Russell Keith-Magee
On 5/30/07, Luke Plant <[EMAIL PROTECTED]> wrote: > > On Tuesday 29 May 2007 21:13:44 Luke Plant wrote: > > > I've had to add hacks in before to get around the inflexibility of > > inner classes. > > It looks like my hack for this will no longer be needed in > newforms-admin. That's because: > >

Re: Proposal: Generic newforms media

2007-05-29 Thread Luke Plant
On Tuesday 29 May 2007 21:13:44 Luke Plant wrote: > I've had to add hacks in before to get around the inflexibility of > inner classes. It looks like my hack for this will no longer be needed in newforms-admin. That's because: class MyModel: ... class Admin: fields = has turne

Re: Proposal: Generic newforms media

2007-05-29 Thread Luke Plant
On Tuesday 29 May 2007 11:26:45 Russell Keith-Magee wrote: > On 5/29/07, Luke Plant <[EMAIL PROTECTED]> wrote: > > On Saturday 26 May 2007 21:55:04 Jared Kuolt wrote: > > > The javascript > > > portion seems fine, however I would see media as a class, not as > > > a method, ala a model's Meta clas

Re: Proposal: Generic newforms media

2007-05-29 Thread Jacob Kaplan-Moss
On 5/29/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > http://code.djangoproject.com/ticket/4418 +1 from me. Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this gr

Re: Proposal: Generic newforms media

2007-05-29 Thread Russell Keith-Magee
Hi all, I've just opened a ticket for Media descriptors, and uploaded a patch implementing the API that has emerged from this thread. http://code.djangoproject.com/ticket/4418 Hopefully, between this thread and the regression test, usage is obvious. Feedback is welcome. Yours, Russ Magee %-)

Re: Proposal: Generic newforms media

2007-05-29 Thread Russell Keith-Magee
On 5/29/07, Luke Plant <[EMAIL PROTECTED]> wrote: > > On Saturday 26 May 2007 21:55:04 Jared Kuolt wrote: > > The javascript > > portion seems fine, however I would see media as a class, not as a > > method, ala a model's Meta class: > > > > class MyWidget(Widget): > > ... > > class Media:

Re: Proposal: Generic newforms media

2007-05-28 Thread Luke Plant
On Saturday 26 May 2007 21:55:04 Jared Kuolt wrote: > The javascript > portion seems fine, however I would see media as a class, not as a > method, ala a model's Meta class: > > class MyWidget(Widget): > ... > class Media: > js = ('/path/to/js',) > css = ('/path/to/css',)

Re: Proposal: Generic newforms media

2007-05-28 Thread Ivan Sagalaev
Russell Keith-Magee wrote: > I mostly just want to make sure > that I fully understand Ivan's use cases, so we can make sure that > there isn't a better solution lurking around. My use case was that I just had STYLE_ROOT and JS_ROOT that both were completely independent on MEDIA_ROOT. I don't re

Re: Proposal: Generic newforms media

2007-05-28 Thread Malcolm Tredinnick
On Mon, 2007-05-28 at 22:02 +0800, Russell Keith-Magee wrote: > On 5/28/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > On Mon, 2007-05-28 at 19:31 +0800, Russell Keith-Magee wrote: [...] > > > > > > When you say JS and CSS are separate - how separate are they? What > > > relationship (i

Re: Proposal: Generic newforms media

2007-05-28 Thread Russell Keith-Magee
On 5/28/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Mon, 2007-05-28 at 19:31 +0800, Russell Keith-Magee wrote: > > On 5/27/07, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > > > > > Russell Keith-Magee wrote: > > > > URL path. When rendered, it should take into account settings.MEDIA_UR

Re: Proposal: Generic newforms media

2007-05-28 Thread Malcolm Tredinnick
On Mon, 2007-05-28 at 19:31 +0800, Russell Keith-Magee wrote: > On 5/27/07, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > > > Russell Keith-Magee wrote: > > > URL path. When rendered, it should take into account settings.MEDIA_URL. > > > > As a matter of fact it's not a universal practice to have c

Re: Proposal: Generic newforms media

2007-05-28 Thread Russell Keith-Magee
On 5/27/07, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > > URL path. When rendered, it should take into account settings.MEDIA_URL. > > As a matter of fact it's not a universal practice to have css and js > filed under this root. A couple of my projects had them in sep

Re: Proposal: Generic newforms media

2007-05-27 Thread James Bennett
On 5/27/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > If you have a specific proposal on how to bundle CSS files together in > the way you describe, feel free to suggest it. I've done this for JavaScript, and it wasn't terribly hard -- I wrote a little script that takes a list of JS files,

Re: Proposal: Generic newforms media

2007-05-27 Thread Russell Keith-Magee
On 5/27/07, Jeremy Bowers <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > > > > > > > > > > > > > > > > This is a bad thing. Requests are extremely expensive and this is > encouraging scenarios where you end up with 30, 40, maybe more little > CSS and JS files. I'd never deploy t

Re: Proposal: Generic newforms media

2007-05-27 Thread Honza Král
On 5/27/07, Jeremy Bowers <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > > > > > > > > > > > > > > > > This is a bad thing. Requests are extremely expensive and this is > encouraging scenarios where you end up with 30, 40, maybe more little > CSS and JS files. I'd never deploy th

Re: Proposal: Generic newforms media

2007-05-27 Thread Jeremy Bowers
Russell Keith-Magee wrote: > > > > > > > This is a bad thing. Requests are extremely expensive and this is encouraging scenarios where you end up with 30, 40, maybe more little CSS and JS files. I'd never deploy this; I try to never deploy with more than one of each. I generally fail

Re: Proposal: Generic newforms media

2007-05-27 Thread Honza Král
Hi all, we recently stumbled on a similar problem, but not specifically related to (new)forms... we are rendering articles with some boxes (polls, images, quizes etc.) and some of these boxes need specific media files to be linked to the page. We put together a simple mechanism for allowing this (j

Re: Proposal: Generic newforms media

2007-05-27 Thread Ivan Sagalaev
Russell Keith-Magee wrote: > URL path. When rendered, it should take into account settings.MEDIA_URL. As a matter of fact it's not a universal practice to have css and js filed under this root. A couple of my projects had them in separate places (even js separate from css). It can be handled as

Re: Proposal: Generic newforms media

2007-05-26 Thread Jared Kuolt
On May 26, 10:17 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > I would assume the the mechanism for exposing this would allow it to > be done anywhere in the template, so that CSS/JS could be pulled in as > part of the of the resulting (X)HTML document (in the case of > CSS, to remain valid, i

Re: Proposal: Generic newforms media

2007-05-26 Thread James Bennett
On 5/26/07, Jared Kuolt <[EMAIL PROTECTED]> wrote: > This gets a little complicated: tags are only allowed inside > tags, otherwise you have invalid (X)HTML. The javascript > portion seems fine, however I would see media as a class, not as a > method, ala a model's Meta class: I would assume th

Re: Proposal: Generic newforms media

2007-05-26 Thread Russell Keith-Magee
On 5/27/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > I like the proposal. > > > The javascript > > portion seems fine, however I would see media as a class, not as a > > method, ala a model's Meta class: > Yea, I tend to agree. I hadn't considered that approach. +1. > However I'm not so keen o

Re: Proposal: Generic newforms media

2007-05-26 Thread Russell Keith-Magee
On 5/27/07, Jared Kuolt <[EMAIL PROTECTED]> wrote: > > This gets a little complicated: tags are only allowed inside > tags, otherwise you have invalid (X)HTML. A is only allowed in the - but you can still write a template that renders the form in the block. We can't be expected to prevent pe

Re: Proposal: Generic newforms media

2007-05-26 Thread SmileyChris
I like the proposal. > The javascript > portion seems fine, however I would see media as a class, not as a > method, ala a model's Meta class: Yea, I tend to agree. > This gets a little complicated: tags are only allowed inside > tags, otherwise you have invalid (X)HTML. I'm not sure how that

Re: Proposal: Generic newforms media

2007-05-26 Thread Jared Kuolt
This gets a little complicated: tags are only allowed inside tags, otherwise you have invalid (X)HTML. The javascript portion seems fine, however I would see media as a class, not as a method, ala a model's Meta class: class MyWidget(Widget): ... class Media: js = ('/path/to/js'

Proposal: Generic newforms media

2007-05-26 Thread Russell Keith-Magee
Hi all, A newforms widget currently defines the way to render a user interface input element. However, in order to make interesting input elements, you also need other media - i.e., Javascript and CSS. These requirements can be defined on a per-widget basis (a Date field requires a Calendar widge