Yes, TurboGears supports FormEncode and TW2 validators (but not SQLAlchemy
validators).

You can use __field_validator_types__ in __sprox__ property of your model
or in Admin Configuration to specify the validators for each model field.

See http://turbogears.readthedocs.org/en/latest/cookbook/admin.html and
then http://turbogears.readthedocs.org/en/latest/cookbook/Crud/index.html
to understand how to provide custom admin CRUD options.

The fastest way is probably using __sprox__ in model as is done here
http://turbogears.readthedocs.org/en/latest/turbogears/wikier/models.html#customizing-management
just use the __sprox__.field_validator_types option.

See
http://sprox.org/modules/sprox.formbase.html?highlight=__field_validator_types__#classes
for form options.

On Wed, Jul 1, 2015 at 6:42 AM, Jacob Lister <[email protected]>
wrote:

> Is it possible to define validators in model definitions which the admin
> interface will handle?
>
> For example, validators for SQLAlchemy models (raising an exception on
> failure) are described here:
>
> http://docs.sqlalchemy.org/en/rel_0_9/orm/mapped_attributes.html
>
> However, in the admin interface, a debug dump is produced, rather than
> displaying the error on the failed property.
>
> Is it possible to show model validation errors on the admin interface as
> it does for basic type validation errors?
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" 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/turbogears.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to