1. 29 Mar, 2014 2 commits
  2. 19 Mar, 2014 1 commit
  3. 10 Mar, 2014 4 commits
  4. 06 Mar, 2014 6 commits
  5. 05 Mar, 2014 3 commits
  6. 27 Feb, 2014 1 commit
  7. 26 Feb, 2014 1 commit
  8. 22 Feb, 2014 1 commit
  9. 18 Feb, 2014 1 commit
  10. 15 Feb, 2014 2 commits
  11. 12 Feb, 2014 4 commits
    • Serge S. Koval's avatar
      Merge pull request #465 from uniphil/imageupload · 52ef3ff2
      Serge S. Koval authored
      File and ImageUploadField fixes
      52ef3ff2
    • Phil Schleihauf's avatar
      Raise ImportError instead of Exception for an import error · 94c1c684
      Phil Schleihauf authored
      The issue at hand is in fact an error on import, and more specific exceptions are nicer to work with.
      94c1c684
    • Phil Schleihauf's avatar
      Ignore case for allowed extensions · cb9f797c
      Phil Schleihauf authored
      Fixes error where 'image.JPG' will be disallowed when `form.upload.FileUploadField.allowed_extensions` is set to `('jpg',)`, for example.
      cb9f797c
    • Phil Schleihauf's avatar
      Update filename on werkzeug FileStorage for uploaded files · 96f5375c
      Phil Schleihauf authored
      This is an issue for fields whose name might be changed at any point, like any image ending in "jpeg" (which will be renamed to "jpg". That would cause the actual file to be saved to disk with ".jpeg", but be saved elsewhere as ".jpg".
      
      This example (mostly copied from the example in `examples/forms/simple.py`) shows it better than I can explain:
      
          import os
          from flask import Flask
          from flask.ext.admin import Admin, form
          from flask.ext.admin.contrib import sqla
          from flask.ext.sqlalchemy import SQLAlchemy
      
          app = Flask(__name__)
          app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///hello.db'
          db = SQLAlchemy(app)
      
          os.path.isdir('static') or os.mkdir('static')
      
          class Photo(db.Model):
              id = db.Column(db.Integer, primary_key=True)
              path = db.Column(db.Unicode(128))
      
          class PhotoView(sqla.ModelView):
              form_extra_fields = {'path': form.ImageUploadField('Photo', base_path='static')}
      
          admin = Admin(app, 'Photos are broken!')
          admin.add_view(PhotoView(Photo, db.session))
      
          db.create_all()
          app.run(debug=True)
      
      ... try uploading files with `.jpeg` vs `.jpg` extensions. It's pretty broken.
      96f5375c
  12. 03 Feb, 2014 3 commits
  13. 02 Feb, 2014 8 commits
  14. 28 Jan, 2014 3 commits