Skip to content
This repository was archived by the owner on May 7, 2022. It is now read-only.

Set mapper at form level #69

Open
ericecook opened this issue Jul 21, 2013 · 3 comments
Open

Set mapper at form level #69

ericecook opened this issue Jul 21, 2013 · 3 comments
Milestone

Comments

@ericecook
Copy link
Collaborator

Some method of setting the mapper at a form level would be a big convenience, currently you have to overwrite the 'base' variable at every node. I'm looking at something like this:

login = EntryNode(
    base = "inline.html",
    css_class="input-small",
    label=False,
    placeholder="Username",
    validators=RequiredValidator())
password = PasswordNode(
    base = "inline.html",
    css_class="input-small",
    label=False,
    placeholder="Password",
    validators=RequiredValidator())
submit = SubmitNode(base = "inline.html", title="Login")
@icook
Copy link
Owner

icook commented Jul 21, 2013

Ah, initially this was intended to be done by changing the BaseNode attribute before generating the Form. IE BaseNode.base = '...'. This works but will change it for all things inheriting from base node, and is in general not a good solution. I'll think on the best way to solve this and try and come back to it.

@icook
Copy link
Owner

icook commented Aug 27, 2013

In it's current configuration this couldn't be accomplished without some metaclass voodoo. However, an easy alternative might be to use the global context, since that was basically what it was designed for, instead of inheritance. However that will add specificity to the Form class, meaning we should probably split Form into something like BaseForm, which is more abstract, and Form. This has been long overdue since Form has become more and more specific.

@icook
Copy link
Owner

icook commented Sep 7, 2013

Pushing to 0.3.1 to offload 0.2.3

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

No branches or pull requests

2 participants