Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 1 and Version 2 of DynamicValidation


Ignore:
Timestamp:
09/15/06 11:14:46 (8 years ago)
Author:
joelpearson
Comment:

Escaped class names so they won't appear as wikiwords.

Legend:

Unmodified
Added
Removed
Modified
  • DynamicValidation

    v1 v2  
    2727}}} 
    2828 
    29 Nothing special here. The UidSchema class is used to validate the uid value. The metadata variable used to provide the template with some additional information from the directory schema about the record fields (e.g. required fields) for proper rendering. 
     29Nothing special here. The !UidSchema class is used to validate the uid value. The metadata variable is used to provide the template with some additional information from the directory schema about the record fields (e.g. required fields) for proper rendering. 
    3030 
    31 Suppose the form displayed by this method is submited to the update method. As you use the metadata for dynamic form generation you can't tell for sure which fields come with the request. How to do the validation in this situation? Use callable form! 
     31Suppose the form displayed by this method is submitted to the update method. As you use the metadata for dynamic form generation you can't tell for sure which fields come with the request. How to do the validation in this situation? Use a callable form! 
    3232 
    3333{{{ 
     
    112112}}} 
    113113 
    114 The FormGenerator class is responsible for dynamic validation schema generation. First it reuses the UidSchema class to check if a valid user id value present in the request. If the value is invalid it simply wraps the UidSchema instance into a MyForm instance and returns it back to @decorate. Otherwise FormGenerator proceeds with schema generation according to the metadata. Moreover, FromGeneatator can be extended to generate schemas for other controller methods similar to update (e.g. create). 
     114The !FormGenerator class is responsible for dynamic validation schema generation. First it reuses the !UidSchema class to check if a valid user id value present in the request. If the value is invalid it simply wraps the !UidSchema instance into a !MyForm instance and returns it back to @decorate. Otherwise !FormGenerator proceeds with schema generation according to the metadata. Moreover, !FormGenerator can be extended to generate schemas for other controller methods similar to update (e.g. create). 
    115115 
    116 The approach described here can also be used with TruboGears widgets. In this case the MyForm class should generate complete form rather than just wrapped validation schema. 
     116The approach described here can also be used with TurboGears widgets. In this case the !MyForm class should generate a complete form rather than just wrapped validation schema.