Login

Snippets by jonasvp

Snippet List

Integrate Wymeditor with filebrowser plugin

In order to integrate Wymeditor with the Django filebrowser, put the code in a file, set the fb_url variable to point to your filebrowser instance and add the file to your Javascript headers: <script type="text/javascript" src="/media/wymeditor/plugins/jquery.wymeditor.filebrowser.js"></script> or in your admin.py: class Media: js = ('/media/wymeditor/plugins/jquery.wymeditor.filebrowser.js',) Add the postInitDialog parameter to the Wymeditor initialization: $('textarea').wymeditor({ postInitDialog: wymeditor_filebrowser }); If you already have a postInitDialog function, you need to put a call to wymeditor_filebrowser inside that function. Then you should be able to click on the Filebrowser link to select an image.

  • javascript
  • images
  • wymeditor
  • filebrowser
Read More

Newforms field for decimals with a comma

This might be handy in countries where decimals are entered with a comma separating the decimal places from the integer part (for instance in Germany). It lets user enter and displays all decimals with a comma separator. I ran into this problem and couldn't find a clean internationalized way of doing it... but newforms makes it so easy to roll your own. Hope it helps someone.

  • newforms
  • locale
  • comma
  • decimal
Read More

jonasvp has posted 2 snippets.