nothing generic, but i have been known to do things like:
#Set HTML 5 input properties
if not auth.is_logged_in():
form.custom.widget.first_name['_required'] = True
form.custom.widget.first_name['_autofocus'] = True
form.custom.widget.last_name['_required'] = True
form.custom.widget.email['_type'] = 'email'
form.custom.widget.email['_required'] = True
form.custom.widget.confirm_email['_type'] = 'email'
form.custom.widget.confirm_email['_required'] = True
form.custom.widget.confirm_password['_onkeyup'] =
"check_password(this.value);"
form.custom.widget.phone_area_code['_required'] = True
form.custom.widget.phone_exchange['_required'] = True
form.custom.widget.phone_suffix['_required'] = True
form.custom.widget.phone_area_code['_maxlength'] = 3
form.custom.widget.phone_exchange['_maxlength'] = 3
form.custom.widget.phone_suffix['_maxlength'] = 4
form.custom.widget.phone_extension['_maxlength'] = 5