* Ivan Sagalaev ([EMAIL PROTECTED]) wrote:
> Matthias Kestenholz wrote:
> > * How can I create a new FormField? Where can I specify which
> >   FormField to use for a DB field?
> 
> Inherit your class from django.forms.FormField and at the very least 
> override render() method. Other methods that you might want to override 
> depending on your field are do_html2python, get_validation_errors, 
> convert_post_data. Their tasks are documented their docstrings in 
> django.forms.
> 
> To assign a FormField class to a DB field class you implement 
> get_manipulator_field_objs method of the DB class. It returns a list of 
> FormField classes (list is here because such fields as DateTimeField are 
> represented with two form controls).
> 
> For an example I can suggest you to look in my own TagsField app where 
> I've created a descendant of a ManyToManyField: 
> http://softwaremaniacs.org/media/soft/tags/tags.zip , look into fields.py
> 
> BTW, this is already some advanced use of Django. Why do you need to 
> make your own form fields? May be the problem can be solved easier...

Thanks, this helped me very much! I currently do not need to create
my own form fields, but I needed to know if it is simple enough just
in case. Im more interested in building custom web applications, not
"simple" websites, that's why I asked.

        Matthias

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to