Skip to content

Commit

Permalink
Now "FormEncode_schema".from_python() can be used if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniojesvs committed Nov 30, 2015
1 parent ded975a commit fc26570
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyramid_simpleform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Form(object):
def __init__(self, request, schema=None, validators=None, defaults=None,
obj=None, extra=None, include=None, exclude=None, state=None,
method="POST", variable_decode=False, dict_char=".",
list_char="-", multipart=False):
list_char="-", multipart=False, from_python=False):

self.request = request
self.schema = schema
Expand Down Expand Up @@ -122,6 +122,9 @@ def __init__(self, request, schema=None, validators=None, defaults=None,
for f in fields:
if hasattr(obj, f):
self.data[f] = getattr(obj, f)

if schema and from_python:
self.data.update(schema.from_python(self.data))

def is_error(self, field):
"""
Expand Down

0 comments on commit fc26570

Please sign in to comment.