On May 12, 10:03 am, marchinux <m.dan...@gmail.com> wrote:

> NOW what other steps i have to do? my goal is to obtain in the ADMIN
> interface a riche text field....in the simplest way.... i have to
> modufy my admin.py ? In the admin.py i have a class like this...
>
> class ArticleAdmin(admin.ModelAdmin):
>     pass
>
> admin.site.register(Article, ArticleAdmin)

Something like this:

class ArticleAdmin(admin.ModelAdmin):
    def formfield_for_dbfield(self, db_field, **kwargs):
        if db_field.name == '<somefield>':
            return forms.CharField(widget=TinyMCE(
                attrs={'cols': 80, 'rows': 30},
            ))
        return super(ArticleAdmin, self).formfield_for_dbfield
(db_field, **kwargs)

or perhaps:

class ArticleAdmin(admin.ModelAdmin):
    formfield_overrides = {
        models.TextField: {'widget': TinyMCE},
    }


Regards,

Joost
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to