Commits

Guilherme Gondim  committed a17284f Merge

merged up

  • Participants
  • Parent commits bbad884, 7c7b28b

Comments (0)

Files changed (3)

+15e475932f8218d3f61f4513c9935399ca4bfdd5 0.3.1

File redactor/widgets.py

     def __init__(self, *args, **kwargs):
         super(RedactorEditor, self).__init__(*args, **kwargs)
         self.upload_to = kwargs.pop('upload_to', '')
-        self.options = OPTIONS.copy()
-        self.options.update(kwargs.pop('redactor_options', {}))
-        self.options.update({
+        self.user_options = kwargs.pop('redactor_options', {})
+
+    def get_options(self):
+        options = OPTIONS.copy()
+        options.update(self.user_options)
+        options.update({
             'imageUpload': reverse('redactor_upload_image', kwargs={'upload_to': self.upload_to}),
             'fileUpload': reverse('redactor_upload_file', kwargs={'upload_to': self.upload_to})
         })
+        return json.dumps(options)
 
     def render(self, name, value, attrs=None):
         html = super(RedactorEditor, self).render(name, value, attrs)
         final_attrs = self.build_attrs(attrs)
         id_ = final_attrs.get('id')
-        options = json.dumps(self.options)
-        html += INIT_JS % (id_, options)
+        html += INIT_JS % (id_, self.get_options())
         return mark_safe(html)
 
 
+#/usr/bin/env python
+
 from setuptools import setup, find_packages
 
+
 setup(
     name="django-redactor",
     version="0.4",
     description="Django application for http://imperavi.ru/redactor/",
     author="Vladimir Sidorenko",
     author_email="yoyavova@gmail.com",
+    license='BSD License',
     packages=find_packages(),
     include_package_data=True,
+    classifiers=[
+        'Development Status :: 5 - Production/Stable',
+        'Environment :: Web Environment',
+        'Framework :: Django',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: BSD License',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python',
+        'Topic :: Software Development :: Libraries :: Python Modules',
+    ],
 )