jazzband / django-floppyforms

Full control of form rendering in the templates.
http://django-floppyforms.readthedocs.org/
Other
841 stars 148 forks source link

switch to `static` tag so STATIC_URL is unneeded #177

Open tisdall opened 8 years ago

tisdall commented 8 years ago

STATIC_URL requires adding a context manager while the template tag requires no specific settings

solution to #175

tisdall commented 7 years ago

This change also allows people to use CachedStaticFilesStorage and "far future expires" on those files. (I was trying to implement that in my system and wondered why it wasn't working with floppyforms, forgot this hasn't been committed or published yet.)

cho-leukeleu commented 6 years ago

Hi @gregmuellegger, Is there something preventing this PR from being merged? :)

tisdall commented 6 years ago

@cho-leukeleu - like most open source projects the blocker is probably lack of free time or better things to do. ;)

If this is a change you need it's best to just copy the template into your own project and use that directly. I have this in my code:

class PointWidget(floppyforms.gis.PointWidget, floppyforms.gis.BaseGMapWidget):
    map_width = 560
    template_name = 'google.html'
    google_maps_api_key = settings.GOOGLE_MAP_API_KEY

And then made copies of the templates in the floppyforms/templates/floppforms/gis/ and modified it as needed in my own templates directory.

cho-leukeleu commented 6 years ago

@tisdall of course, no offense in my question. Simply this change looks quite straight forward to me and there has been another commit since. Now that I look more carefully I guess it's actually because the support for older versions of Django has still not been dropped! Thanks for the tip.

tisdall commented 6 years ago

@cho-leukeleu - This patch seems to pass all the tests which cover older versions of Django, but I haven't really checked if the tests are properly covering things like this. I mentioned I was a little confused how the tests were working.