Comments (8)
Coverage for registering a 'default' or 'else' value against form_remainder?
from widgetastic.core.
@mshriver Hmm, good catch, that will also need care. I think it could generate an empty form if not specified, otherwise you can use "form_remainder.register_default" or something like that.
from widgetastic.core.
Are you ok if such conditional views will be implemented in the following way:
class SomeView(View):
master_widget = SomeWidget()
@View.conditional(condition=master_widget.text == 'SomeValue', alias='CommonName')
class SlaveView1(View):
pass
@View.conditional(condition=master_widget.text == 'AnotherValue', alias='CommonName')
class SlaveView2(View):
pass
@View.conditional(condition='default', alias='CommonName')
class SlaveView3(View):
pass
from widgetastic.core.
The confition=
syntax would not be as simple, it would have to be a lambda (to process the value and say bool) or a value to be compared. What would be the use for alias=
?
from widgetastic.core.
yes, syntax is likely to be slightly changed during implementation.
Alias will allow us to use one name for several views.
When I was writing this code sample I had in mind Add Infra Provider dialog. Where second part of dialog is opened after provide type is chosen.
from widgetastic.core.
The solution I am thinking about and will be simplest is this one:
view.fill({
'provider_name': 'foo'
'provider_type': 'bar',
'provider_data': { ... },
})
Where provider_data will be a widget that will switch underlying views based on a condition (so the nesting is obligatory). I was also thinking about "including" some views, even conditionally, but that will be more difficult to master.
from widgetastic.core.
@mfalesni , could you please give me few real world examples of where such switchable views can be used then ?
from widgetastic.core.
Control Actions let's say. Anywhere where something reveals a form different for each value ...
from widgetastic.core.
Related Issues (20)
- E TypeError: __init__() got an unexpected keyword argument 'prov_class' HOT 1
- partial_match does not support parenthesis () in object
- Table widget: tbody row indexing starts from 1 when there's a row in table header HOT 4
- Element not found with Zalenium webdriver and scrolled down HOT 1
- Inconsistency in indexing of Table rows and columns HOT 1
- Get wrong browser object for non top view in hierarchy HOT 7
- Provide method to pull browser debug console content
- TableRow.__dir__ is broken
- table.headers is incorrectly calculated when there are non-text header rows HOT 1
- TableWidget with rowspan and with a column widget does not return widget value when reading HOT 5
- refactor Table widget in order to make it less awkward
- Preferred way of performing action on view before reading?
- Move WT as multi-window framework
- Readme file missing
- DeprecationWarning driver.switch_to.alert instead self.selenium.switch_to_alert() HOT 2
- Deprecation of getargspec as we are using py3
- OUIA component ID cannot be None
- clear() does not work reliably HOT 1
- "force_scroll" must be enabled for Chrome
- PyPI upload filename has to match project name HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from widgetastic.core.