{"id":778,"date":"2009-09-30T14:54:10","date_gmt":"2009-09-30T18:54:10","guid":{"rendered":"http:\/\/cd34.com\/blog\/?p=778"},"modified":"2009-10-02T19:28:31","modified_gmt":"2009-10-02T23:28:31","slug":"attributeerror-function-object-has-no-attribute-replace","status":"publish","type":"post","link":"https:\/\/cd34.com\/blog\/framework\/attributeerror-function-object-has-no-attribute-replace\/","title":{"rendered":"AttributeError: &#8216;function&#8217; object has no attribute &#8216;replace&#8217;"},"content":{"rendered":"<p>While doing some coding to move a Turbogears2 application over to Pylons, I ran into an issue with Validation and ToscaWidgets.<\/p>\n<h3>AttributeError: &#8216;function&#8217; object has no attribute &#8216;replace&#8217;<\/h3>\n<p><a href=\"http:\/\/toscawidgets.org\/documentation\/tw.forms\/tutorials\/validate_pylons.html\" target=\"_new\">Validation in Pylons<\/a> listed:<\/p>\n<p>@validate(form=movie_form, error_handler=index)<\/p>\n<p>for the decorator syntax, but, error_handler should be a name, not a function.  The correct decorator should be:<\/p>\n<p>@validate(form=movie_form, error_handler=&#8217;index&#8217;)<\/p>\n<div style=\"float:left;\">\n<div id=\"fb-root\"><\/div>\n<fb:like href=\"https:\/\/cd34.com\/blog\/framework\/attributeerror-function-object-has-no-attribute-replace\/\" width=\"250\" send=\"false\" show_faces=\"false\" layout=\"button_count\" action=\"recommend\"><\/fb:like>\n<\/div><div style=\"clear:both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>While doing some coding to move a Turbogears2 application over to Pylons, I ran into an issue with Validation and ToscaWidgets. AttributeError: &#8216;function&#8217; object has no attribute &#8216;replace&#8217; Validation in Pylons listed: @validate(form=movie_form, error_handler=index) for the decorator syntax, but, error_handler should be a name, not a function. The correct decorator should be: @validate(form=movie_form, error_handler=&#8217;index&#8217;)<\/p>\n<div style=\"float:left;\">\n<div id=\"fb-root\"><\/div>\n<fb:like href=\"https:\/\/cd34.com\/blog\/framework\/attributeerror-function-object-has-no-attribute-replace\/\" width=\"250\" send=\"false\" show_faces=\"false\" layout=\"button_count\" action=\"recommend\"><\/fb:like>\n<\/div><div style=\"clear:both;\"><\/div>","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[80,299,38,36],"class_list":["post-778","post","type-post","status-publish","format-standard","hentry","category-framework","tag-pylons","tag-python","tag-toscawidgets","tag-turbogears"],"_links":{"self":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/comments?post=778"}],"version-history":[{"count":2,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/778\/revisions"}],"predecessor-version":[{"id":780,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/778\/revisions\/780"}],"wp:attachment":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/media?parent=778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/categories?post=778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/tags?post=778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}