Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - blueprints after generic_input_renderer #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

thet
Copy link
Member

@thet thet commented Feb 23, 2017

When creating a blueprint chain with a factory, allow blueprints defined after blueprints based in generic_input_renderer.

Work in progress, because there is a failing test.

@rnixx
Copy link
Member

rnixx commented Feb 23, 2017

Looks useful. Which test is failing?

…ned after blueprints based in ``generic_input_renderer``.
rendered = rendered + (data.rendered or u'')
else:
rendered = (data.rendered or u'') + rendered
return rendered
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input_generic_renderer is supposed only to render an input tag, no matter whether data already contains rendered markup, please revert

@@ -333,7 +363,7 @@ def display_proxy_renderer(widget, data):
input_attrs = input_attributes_full(widget, data, value=val)
rendered += data.tag('input', **input_attrs)
else:
rendered += input_generic_renderer(widget, data)
rendered = input_generic_renderer(widget, data, pos='after')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above, if position really needs to be set here hardcoded (for what exactly?) it should be done here, otherwise revert please

'inner-before'= <newtag>message rendered</newtag>
'inner-after'= <newtag>rendered message</newtag>
"""
rendered = rendered or u''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible that rendered is something other than string here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, rendered can also be UNSET

@managedprops('min', 'max', 'step', *managed_props__input_full)
def number_edit_renderer(widget, data):
return input_generic_renderer(widget, data)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for dedicated number_edit_renderer. min max and step managed props are defined for number_extractor, and managed props gets aggregated

@@ -484,9 +514,6 @@ def text_edit_renderer(widget, data):
factory.defaults['text.class'] = 'text'

factory.defaults['text.disabled'] = False
factory.doc['props']['text.disabled'] = """\
Flag input field is disabled.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please readd

@@ -448,8 +479,7 @@ def tag_renderer(widget, data):
# text
###############################################################################

@managedprops('data', 'title', 'size', 'disabled', 'autofocus',
'placeholder', 'autocomplete', *css_managed_props)
@managedprops(*managed_props__input_full)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be double checked

@@ -856,8 +883,7 @@ def _pwd_value(widget, data):
return attr_value('default', widget, data)


@managedprops('data', 'title', 'size', 'disabled', 'autofocus',
'placeholder', 'autocomplete', *css_managed_props)
@managedprops(*managed_props__input_common)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be double checked

@@ -958,8 +984,7 @@ def checkbox_extractor(widget, data):
)


@managedprops('data', 'title', 'size', 'disabled', 'autofocus',
'format', 'disabled', 'checked', *css_managed_props)
@managedprops('format', *managed_props__input_common)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be double checked

@@ -1051,9 +1076,6 @@ def checkbox_display_renderer(widget, data):
factory.defaults['checkbox.class'] = 'checkbox'

factory.defaults['checkbox.disabled'] = False
factory.doc['props']['checkbox.disabled'] = """\
Flag whether checkbox is disabled.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please readd

@@ -1435,8 +1457,7 @@ def file_extractor(widget, data):
return value


@managedprops('accept', 'placeholder', 'autofocus',
'required', *css_managed_props)
@managedprops('accept', *managed_props__input_common)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be double checked

@managedprops('label', 'class', 'action', 'handler',
'next', 'skip', 'expression')
@managedprops('label', 'action', 'handler', 'next', 'skip', 'expression',
*managed_props__input_common)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be double checked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants