1. Germano Gabbianelli
  2. django-autocomplete
  3. Issues
Issue #26 new

media css and js

Anonymous created an issue

I'm not totally clear with medias in AutoCompleteWidget : what is the best way to get rid of reading http://yui.yahooapis.com/2.6.0/build/autocomplete/assets/skins/sam/autocomplete.css and http://yui.yahooapis.com/combo?2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&2.6.0/build/connection/connection-min.js&2.6.0/build/datasource/datasource-min.js&2.6.0/build/autocomplete/autocomplete-min.js without hacking your code (which works well). we could have a setting parameter for these two files, it would be better, no ?

Comments (3)

  1. Germano Gabbianelli repo owner

    Django Autocomplete 1.0a does not support YUI directly anymore (yui_autocomplete.js is still included and could be usable with a couple of minor changes if you are interested). So I guess you're talking about 0.X which uses yui served from yahooapis.com by default.

    I don't clearly understand your problem, however if you want to overwrite the default media files you should just subclass AutoCompleteWidget. Here's an example:

    class YourAutocompleteWidget(AutoCompleteWidget):
        class Media:
            extend = False
            js = (...)
            css = {...}
  2. Anonymous

    thx for your answer, and the tip for AutoCompleteWidget heritage, ... and sorry for the mistake, it's 0.X version I was talking about. (may be I have got to update to 1.X ...)

  3. Log in to comment