[pyar] [Django] Herencia de forms y fields

Rafael Moyano moyanor en gmail.com
Lun Oct 24 17:00:47 ART 2011


Podés especificar a la clase Field que widget querés que utilice, se lo
pasas como argumento.

De la documentación de Django [1]:

However, if you want to use a different widget for a field, you can - just
use the 'widget' argument on the field definition. For example:

from django import forms

class CommentForm(forms.Form):
    name = forms.CharField()
    url = forms.URLField()
    comment = forms.CharField(widget=forms.Textarea)


[1] https://docs.djangoproject.com/en/1.3/ref/forms/widgets/
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20111024/6254adf5/attachment.html>


More information about the pyar mailing list