Sunday, March 31, 2013

Using Django docs to find widget readonly specification

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.

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment