src/source/howto-paragraph.rst
branchdoc-dc
changeset 76 ca63b1a69cbb
parent 75 5cf9c8a16aee
child 77 ae0e104800aa
equal deleted inserted replaced
75:5cf9c8a16aee 76:ca63b1a69cbb
   171 
   171 
   172 3)Edit form
   172 3)Edit form
   173 -----------
   173 -----------
   174 
   174 
   175 - *HTML*
   175 - *HTML*
       
   176 
   176 .. code-block:: python
   177 .. code-block:: python
   177 
   178 
   178     @pagelet_config(name='properties.html', context=IContactParagraph, layer=IPyAMSLayer,
   179     @pagelet_config(name='properties.html', context=IContactParagraph, layer=IPyAMSLayer,
   179                     permission=MANAGE_CONTENT_PERMISSION)
   180                     permission=MANAGE_CONTENT_PERMISSION)
   180     class ContactParagraphPropertiesEditForm(BaseParagraphPropertiesEditForm):
   181     class ContactParagraphPropertiesEditForm(BaseParagraphPropertiesEditForm):
   194         def updateWidgets(self, prefix=None):
   195         def updateWidgets(self, prefix=None):
   195             super(ContactParagraphPropertiesEditForm, self).updateWidgets(prefix)
   196             super(ContactParagraphPropertiesEditForm, self).updateWidgets(prefix)
   196             if 'address' in self.widgets:
   197             if 'address' in self.widgets:
   197                 self.widgets['address'].widget_css_class = 'textarea'
   198                 self.widgets['address'].widget_css_class = 'textarea'
   198 
   199 
   199  - *JSON*
   200 - *JSON*
   200 
   201 
   201 .. code-block:: python
   202 .. code-block:: python
   202 
   203 
   203     @view_config(name='properties.json', context=IContactParagraph, request_type=IPyAMSLayer,
   204     @view_config(name='properties.json', context=IContactParagraph, request_type=IPyAMSLayer,
   204                  permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
   205                  permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)