Hi Djangonauts,

I read chapters 6 and 18 of the django book about the admin interface
and how to extend/customize it but I'm still at a loss on if and how
can I add custom fields in the add/change form. What I want to be able
to do is set in my model's Admin class extra fields that do not
correspond to model fields and attach arbitrary logic to them. For
instance, I may want to specify an extra textarea field, which once
the form is submitted it is parsed appropriately and adds or updates
multiple rows in the same and/or other tables, something like:

from django import newforms as forms

class MyCustomField(forms.CharField):
    # add validation and other logic here
        pass


class MyModel:
        class Admin:
        fields = (
                (None, { 'fields': ('url', 'title', MyCustomField) }),
        )

Is this possible and is it worth the pain ? I find Django's admin
interface perhaps its main killer feature and I'd hate to lose it if
it turns out it's not extensible enough.

George


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to