On 23.08.2011, at 16:45, stan wrote:

> I started using the new `CachedStaticFilesStorage', great job.
> 
> Anyway, media defined in ModelAdmin must be wrapped with a call to the
> `static()' function to be processed and get the md5 hash suffix :
> 
> from django.contrib.admin.templatetags.admin_static import static
> class MyModelAdmin(admin.StackedInline):
>    model = MyModel
>    class Media:
>        css = {
>            "all": (static("css/my_css.css"),
>                    static("css/admin_extra.css"))
>        }
> 
> 
> I understand that one may not want to get the md5 version but this
> workaround being not documented I wonder if this is the official way
> to proceed.


Yeah, I've thought about that but haven't tackled the whole ``Media``
class issue yet as it's slightly orthogonal to what the staticfiles
app is doing. You've already found the workaround I use to combine
the two parts of Django.

On the long run I could see a new ``Static`` class be introduced into
the forms library which would automatically call a URL building
callback instead of relying on simple URL joining with STATIC_URL.
But there are other issues with the ``Media`` class that need solving,
e.g. having multiple versions of certain static assets, etc.

In other words, I think it's a good idea to open a ticket about the
disconnect between staticfiles' storage driven approach and the
``Media`` class. As always, suggestions are very welcome.

Jannis

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to