{"action":"closed","issue":{"url":"https://api.github.com/repos/wtforms/wtforms/issues/225","labels_url":"https://api.github.com/repos/wtforms/wtforms/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/wtforms/wtforms/issues/225/comments","events_url":"https://api.github.com/repos/wtforms/wtforms/issues/225/events","html_url":"https://github.com/wtforms/wtforms/issues/225","id":113055784,"number":225,"title":"StringField default value does not work","user":{"login":"hector","id":34079,"avatar_url":"https://avatars.githubusercontent.com/u/34079?v=3","gravatar_id":"","url":"https://api.github.com/users/hector","html_url":"https://github.com/hector","followers_url":"https://api.github.com/users/hector/followers","following_url":"https://api.github.com/users/hector/following{/other_user}","gists_url":"https://api.github.com/users/hector/gists{/gist_id}","starred_url":"https://api.github.com/users/hector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hector/subscriptions","organizations_url":"https://api.github.com/users/hector/orgs","repos_url":"https://api.github.com/users/hector/repos","events_url":"https://api.github.com/users/hector/events{/privacy}","received_events_url":"https://api.github.com/users/hector/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wtforms/wtforms/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-23T16:36:04Z","updated_at":"2015-12-15T06:18:48Z","closed_at":"2015-12-15T06:18:48Z","body":"When setting a default value to a StringField it will not use this default value in case `formdata` has been provided. The problem comes from this [line](https://github.com/wtforms/wtforms/blob/master/wtforms/fields/core.py#L530)\r\n\r\n```python\r\nclass StringField(Field):\r\n    \"\"\"\r\n    This field is the base for most of the more complicated fields, and\r\n    represents an ``<input type=\"text\">``.\r\n    \"\"\"\r\n    widget = widgets.TextInput()\r\n\r\n    def process_formdata(self, valuelist):\r\n        if valuelist:\r\n            self.data = valuelist[0]\r\n        else:\r\n            self.data = '' # HERE THE DEFAULT VALUE IS OVERWRITTEN\r\n\r\n    def _value(self):\r\n        return text_type(self.data) if self.data is not None else ''\r\n```\r\n\r\nwhich overwrites the default value."}}