On Sunday, 31 March 2013 22:42:12 UTC+1, AJP wrote:
> I'm new to learning Django. I want to find the documentation regarding
> the readonly attribute you can set for admin widgets. For example, from an
> admin.py:
>
> class SourceForm(forms.ModelForm):
> data = forms.CharField(widget=TextInput(attrs={'readonly': True,
> 'class': 'averageField'}))
>
> class Meta:
> model = Source
>
>
> class SourceAdmin(admin.ModelAdmin):
> form = SourceForm
>
> admin.site.register(Source, SourceAdmin)
>
>
> I've search for readonly on
> https://docs.djangoproject.com/search/?q=readonly&release=7 but did not
> found anything. Also searching manually in
> https://docs.djangoproject.com/en/dev/ref/forms/widgets/ didn't bring
> anything up. Can someone tell me where I'm going wrong please.
>
This is not documented on the Django site because it has nothing to do with
Django. As the docs do explain, the `attrs` are used to set any HTML
attributes on the rendered widget. `readonly` is an attribute belonging to
the HTML input and select elements.
--
DR.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.