Advertisement
black_eagle

Untitled

Aug 8th, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- encoding: utf-8 -*-
  3.  
  4. from django.db.models import Field
  5. from django.forms import Textarea
  6. from settings import MEDIA_URL
  7.  
  8. from cms.plugins.text.widgets.wymeditor_widget import WYMEditor
  9.        
  10. class WYSIWYGField(Field):
  11.     def get_internal_type(self):
  12.         return "TextField"
  13.  
  14.     def formfield(self, **kwargs):
  15.         defaults = {'widget': WYMEditor}
  16.         defaults.update(kwargs)
  17.         return super(WYSIWYGField, self).formfield(**defaults)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement