Python django.contrib.admin.widgets.AdminTextareaWidget() Examples

The following are 5 code examples of django.contrib.admin.widgets.AdminTextareaWidget(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.contrib.admin.widgets , or try the search function .
Example #1
Source File: models.py    From ishare with MIT License 5 votes vote down vote up
def formfield(self, **kwargs):
        defaults = {'widget': UEditorWidget(attrs=self.ueditor_settings)}
        defaults.update(kwargs)
        if defaults['widget'] == admin_widgets.AdminTextareaWidget:
            defaults['widget'] = AdminUEditorWidget(
                attrs=self.ueditor_settings)
        return super(UEditorField, self).formfield(**defaults)


# 以下支持south 
Example #2
Source File: models.py    From Mxonline3 with Apache License 2.0 5 votes vote down vote up
def formfield(self, **kwargs):
        defaults = {'widget': UEditorWidget(attrs=self.ueditor_settings)}
        defaults.update(kwargs)
        if defaults['widget'] == admin_widgets.AdminTextareaWidget:
            defaults['widget'] = AdminUEditorWidget(
                attrs=self.ueditor_settings)
        return super(UEditorField, self).formfield(**defaults)

# 以下支持south 
Example #3
Source File: models.py    From Dailyfresh-B2C with Apache License 2.0 5 votes vote down vote up
def formfield(self, **kwargs):
        defaults = {'widget': UEditorWidget(attrs=self.ueditor_settings)}
        defaults.update(kwargs)
        if defaults['widget'] == admin_widgets.AdminTextareaWidget:
            defaults['widget'] = AdminUEditorWidget(
                attrs=self.ueditor_settings)
        return super(UEditorField, self).formfield(**defaults)

# 以下支持south 
Example #4
Source File: tests.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def test_TextField(self):
        self.assertFormfield(Event, 'description', widgets.AdminTextareaWidget) 
Example #5
Source File: models.py    From autoops with Apache License 2.0 5 votes vote down vote up
def formfield(self, **kwargs):
        defaults = {'widget': UEditorWidget(attrs=self.ueditor_settings)}
        defaults.update(kwargs)
        if defaults['widget'] == admin_widgets.AdminTextareaWidget:
            defaults['widget'] = AdminUEditorWidget(
                attrs=self.ueditor_settings)
        return super(UEditorField, self).formfield(**defaults)


# 以下支持south