1. pendletongp
  2. django-storages-boto-fp-eof-on-save


David Larlet  committed ef15e52 Merge

Merged in oktaysancak/django-storages (pull request #48)

  • Participants
  • Parent commits 0c46146, 52e38a3
  • Branches default

Comments (0)

Files changed (1)

File storages/backends/database.py

View file
     raise ImproperlyConfigured, "Could not load pyodbc dependency.\
     \nSee http://code.google.com/p/pyodbc/"
+REQUIRED_FIELDS = ('db_table', 'fname_column', 'blob_column', 'size_column', 'base_url')
 class DatabaseStorage(Storage):
             Url prefix used with filenames. Should be mapped to the view,
 that returns an image as result. 
-        if not option or not (option.has_key('db_table') and option.has_key('fname_column') and option.has_key('blob_column')
-                              and option.has_key('size_column') and option.has_key('base_url') ):
+        if not option or not all([field in option for field in REQUIRED_FIELDS]):
             raise ValueError("You didn't specify required options")
         self.db_table = option['db_table']
         self.fname_column = option['fname_column']
         self.blob_column = option['blob_column']