{"action":"created","comment":{"url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/comments/73658933","id":73658933,"diff_hunk":"@@ -163,6 +169,34 @@ def process_formdata(self, value):\n             raise ValueError(self.gettext(u'Not a valid dictionary.'))\n \n \n+def add_max_length(field_class):\n+    \"\"\"Patches a WTF StringField-like to add max_length feature\n+\n+       Adds \"max_length=...\" attribute to the HTML input field\n+    \"\"\"\n+\n+    class Field(field_class):\n+\n+        def __init__(self, **kwargs):\n+\n+            self.max_length = kwargs.pop('max_length', None)\n+            super(field_class, self).__init__(**kwargs)\n+\n+        def __call__(self, **kwargs):\n+","path":"flask_mongoengine/wtf/fields.py","position":70,"original_position":70,"commit_id":"afb305b6731c1f1a1e30521a84ed299b26545662","original_commit_id":"afb305b6731c1f1a1e30521a84ed299b26545662","user":{"login":"gukoff","id":5655837,"avatar_url":"https://avatars.githubusercontent.com/u/5655837?v=3","gravatar_id":"","url":"https://api.github.com/users/gukoff","html_url":"https://github.com/gukoff","followers_url":"https://api.github.com/users/gukoff/followers","following_url":"https://api.github.com/users/gukoff/following{/other_user}","gists_url":"https://api.github.com/users/gukoff/gists{/gist_id}","starred_url":"https://api.github.com/users/gukoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gukoff/subscriptions","organizations_url":"https://api.github.com/users/gukoff/orgs","repos_url":"https://api.github.com/users/gukoff/repos","events_url":"https://api.github.com/users/gukoff/events{/privacy}","received_events_url":"https://api.github.com/users/gukoff/received_events","type":"User","site_admin":false},"body":"Empty lines? But why? It only hinders readability.","created_at":"2016-08-05T08:34:38Z","updated_at":"2016-08-05T08:34:38Z","html_url":"https://github.com/MongoEngine/flask-mongoengine/pull/216#discussion_r73658933","pull_request_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/216","_links":{"self":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/comments/73658933"},"html":{"href":"https://github.com/MongoEngine/flask-mongoengine/pull/216#discussion_r73658933"},"pull_request":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/216"}}},"pull_request":{"url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/216","id":61705370,"html_url":"https://github.com/MongoEngine/flask-mongoengine/pull/216","diff_url":"https://github.com/MongoEngine/flask-mongoengine/pull/216.diff","patch_url":"https://github.com/MongoEngine/flask-mongoengine/pull/216.patch","issue_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/216","number":216,"state":"open","locked":false,"title":"Add max_length feature to StringField-like fields","user":{"login":"lafrech","id":1767010,"avatar_url":"https://avatars.githubusercontent.com/u/1767010?v=3","gravatar_id":"","url":"https://api.github.com/users/lafrech","html_url":"https://github.com/lafrech","followers_url":"https://api.github.com/users/lafrech/followers","following_url":"https://api.github.com/users/lafrech/following{/other_user}","gists_url":"https://api.github.com/users/lafrech/gists{/gist_id}","starred_url":"https://api.github.com/users/lafrech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lafrech/subscriptions","organizations_url":"https://api.github.com/users/lafrech/orgs","repos_url":"https://api.github.com/users/lafrech/repos","events_url":"https://api.github.com/users/lafrech/events{/privacy}","received_events_url":"https://api.github.com/users/lafrech/received_events","type":"User","site_admin":false},"body":"What do you think about such a feature?\r\n\r\nThe idea is to pass max_length to the call to the field so that max_length appears in the input field in the HTML code.\r\n\r\nClient pre-validation is nice. I'd like to go even further with https://github.com/MongoEngine/flask-mongoengine/issues/214.","created_at":"2016-03-04T12:24:30Z","updated_at":"2016-08-05T08:34:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3e6d8ea5cb563be8222ccd13d5abdf72a62133f","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/milestones/6","html_url":"https://github.com/MongoEngine/flask-mongoengine/milestones/0.9","labels_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/milestones/6/labels","id":1633716,"number":6,"title":"0.9","description":"","creator":{"login":"lafrech","id":1767010,"avatar_url":"https://avatars.githubusercontent.com/u/1767010?v=3","gravatar_id":"","url":"https://api.github.com/users/lafrech","html_url":"https://github.com/lafrech","followers_url":"https://api.github.com/users/lafrech/followers","following_url":"https://api.github.com/users/lafrech/following{/other_user}","gists_url":"https://api.github.com/users/lafrech/gists{/gist_id}","starred_url":"https://api.github.com/users/lafrech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lafrech/subscriptions","organizations_url":"https://api.github.com/users/lafrech/orgs","repos_url":"https://api.github.com/users/lafrech/repos","events_url":"https://api.github.com/users/lafrech/events{/privacy}","received_events_url":"https://api.github.com/users/lafrech/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-03-09T14:04:02Z","updated_at":"2016-03-09T14:04:45Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/216/commits","review_comments_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/216/comments","review_comment_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/216/comments","statuses_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/statuses/afb305b6731c1f1a1e30521a84ed299b26545662","head":{"label":"Nobatek:dev_JL_maxlength","ref":"dev_JL_maxlength","sha":"afb305b6731c1f1a1e30521a84ed299b26545662","user":{"login":"Nobatek","id":16589990,"avatar_url":"https://avatars.githubusercontent.com/u/16589990?v=3","gravatar_id":"","url":"https://api.github.com/users/Nobatek","html_url":"https://github.com/Nobatek","followers_url":"https://api.github.com/users/Nobatek/followers","following_url":"https://api.github.com/users/Nobatek/following{/other_user}","gists_url":"https://api.github.com/users/Nobatek/gists{/gist_id}","starred_url":"https://api.github.com/users/Nobatek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nobatek/subscriptions","organizations_url":"https://api.github.com/users/Nobatek/orgs","repos_url":"https://api.github.com/users/Nobatek/repos","events_url":"https://api.github.com/users/Nobatek/events{/privacy}","received_events_url":"https://api.github.com/users/Nobatek/received_events","type":"Organization","site_admin":false},"repo":{"id":51145949,"name":"flask-mongoengine","full_name":"Nobatek/flask-mongoengine","owner":{"login":"Nobatek","id":16589990,"avatar_url":"https://avatars.githubusercontent.com/u/16589990?v=3","gravatar_id":"","url":"https://api.github.com/users/Nobatek","html_url":"https://github.com/Nobatek","followers_url":"https://api.github.com/users/Nobatek/followers","following_url":"https://api.github.com/users/Nobatek/following{/other_user}","gists_url":"https://api.github.com/users/Nobatek/gists{/gist_id}","starred_url":"https://api.github.com/users/Nobatek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nobatek/subscriptions","organizations_url":"https://api.github.com/users/Nobatek/orgs","repos_url":"https://api.github.com/users/Nobatek/repos","events_url":"https://api.github.com/users/Nobatek/events{/privacy}","received_events_url":"https://api.github.com/users/Nobatek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nobatek/flask-mongoengine","description":"MongoEngine flask extension with WTF model forms support","fork":true,"url":"https://api.github.com/repos/Nobatek/flask-mongoengine","forks_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/forks","keys_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/teams","hooks_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/hooks","issue_events_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/issues/events{/number}","events_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/events","assignees_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/assignees{/user}","branches_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/branches{/branch}","tags_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/tags","blobs_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/statuses/{sha}","languages_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/languages","stargazers_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/stargazers","contributors_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/contributors","subscribers_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/subscribers","subscription_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/subscription","commits_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/contents/{+path}","compare_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/merges","archive_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/downloads","issues_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/issues{/number}","pulls_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/pulls{/number}","milestones_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/milestones{/number}","notifications_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/labels{/name}","releases_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/releases{/id}","deployments_url":"https://api.github.com/repos/Nobatek/flask-mongoengine/deployments","created_at":"2016-02-05T12:45:27Z","updated_at":"2016-02-05T12:45:28Z","pushed_at":"2016-06-29T22:00:54Z","git_url":"git://github.com/Nobatek/flask-mongoengine.git","ssh_url":"git@github.com:Nobatek/flask-mongoengine.git","clone_url":"https://github.com/Nobatek/flask-mongoengine.git","svn_url":"https://github.com/Nobatek/flask-mongoengine","homepage":"","size":448,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MongoEngine:master","ref":"master","sha":"069081d761cc912b196044795c851ba5aff89d08","user":{"login":"MongoEngine","id":1502485,"avatar_url":"https://avatars.githubusercontent.com/u/1502485?v=3","gravatar_id":"","url":"https://api.github.com/users/MongoEngine","html_url":"https://github.com/MongoEngine","followers_url":"https://api.github.com/users/MongoEngine/followers","following_url":"https://api.github.com/users/MongoEngine/following{/other_user}","gists_url":"https://api.github.com/users/MongoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/MongoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MongoEngine/subscriptions","organizations_url":"https://api.github.com/users/MongoEngine/orgs","repos_url":"https://api.github.com/users/MongoEngine/repos","events_url":"https://api.github.com/users/MongoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/MongoEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":4335022,"name":"flask-mongoengine","full_name":"MongoEngine/flask-mongoengine","owner":{"login":"MongoEngine","id":1502485,"avatar_url":"https://avatars.githubusercontent.com/u/1502485?v=3","gravatar_id":"","url":"https://api.github.com/users/MongoEngine","html_url":"https://github.com/MongoEngine","followers_url":"https://api.github.com/users/MongoEngine/followers","following_url":"https://api.github.com/users/MongoEngine/following{/other_user}","gists_url":"https://api.github.com/users/MongoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/MongoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MongoEngine/subscriptions","organizations_url":"https://api.github.com/users/MongoEngine/orgs","repos_url":"https://api.github.com/users/MongoEngine/repos","events_url":"https://api.github.com/users/MongoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/MongoEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MongoEngine/flask-mongoengine","description":"MongoEngine flask extension with WTF model forms support","fork":false,"url":"https://api.github.com/repos/MongoEngine/flask-mongoengine","forks_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/forks","keys_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/teams","hooks_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/hooks","issue_events_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/events{/number}","events_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/events","assignees_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/assignees{/user}","branches_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/branches{/branch}","tags_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/tags","blobs_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/statuses/{sha}","languages_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/languages","stargazers_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/stargazers","contributors_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/contributors","subscribers_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/subscribers","subscription_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/subscription","commits_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/contents/{+path}","compare_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/merges","archive_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/downloads","issues_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues{/number}","pulls_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls{/number}","milestones_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/milestones{/number}","notifications_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/labels{/name}","releases_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/releases{/id}","deployments_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/deployments","created_at":"2012-05-15T11:33:26Z","updated_at":"2016-08-04T12:57:55Z","pushed_at":"2016-06-30T08:23:50Z","git_url":"git://github.com/MongoEngine/flask-mongoengine.git","ssh_url":"git@github.com:MongoEngine/flask-mongoengine.git","clone_url":"https://github.com/MongoEngine/flask-mongoengine.git","svn_url":"https://github.com/MongoEngine/flask-mongoengine","homepage":"","size":638,"stargazers_count":357,"watchers_count":357,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":137,"mirror_url":null,"open_issues_count":30,"forks":137,"open_issues":30,"watchers":357,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/216"},"html":{"href":"https://github.com/MongoEngine/flask-mongoengine/pull/216"},"issue":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/216"},"comments":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/216/comments"},"review_comments":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/216/comments"},"review_comment":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/216/commits"},"statuses":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/statuses/afb305b6731c1f1a1e30521a84ed299b26545662"}}}}
{"actor":{"display_login":"gukoff"}}