Redirects and DB transactions
Changes
Breaking changes:
- Now the dispatching of incoming events from the front-end are not
atomictransactions. You will have to put@atomicwhen you want something to be atomic. The reason for this is that some events don't have to deal at all with the database because they just change the local state of the component.
Added:
reactor.broadcast(*names): this broadcasts the messages that you can subscribe to usingComponent.subscribe().Component.send_redirect(url): now you can send a URL redirect to the front-end, when the component is being rendered for first time the redirect is rendered as a<meta http-equiv="refresh" content="0; url={{ url }}">, if the component is alive then the front-end controller executes the redirect.AuthComponent, this component has auserattributed taken from theComponent._contextand onmountif the user is authenticated returns the True, if the user is not returnsNoneand sends a redirect tosettings.LOGIN_URL.- Serialization of arrays in the front-end, in case you have:
<input name="query" value="q">
<input name="persons[].name" value="a">
<input name="persons[].name" value="b">This will be serialized as: {query: "q", persons: [{name: "a"}, {name: "b"}]}
Room for improvement:
- Proper documentation.
- More testing.