Merge lp:~pieter-equinox/reahl/reahl-declarative into lp:~iv/reahl/trunk

Proposed by Pieter Nagel
Status: Merged
Merged at revision: 56
Proposed branch: lp:~pieter-equinox/reahl/reahl-declarative
Merge into: lp:~iv/reahl/trunk
Diff against target: 14576 lines (+3770/-2339) (has conflicts)
397 files modified
.bzrignore (+3/-2)
.reahlproject (+11/-3)
MANIFEST.in (+1/-1)
debian/changelog (+25/-8)
debian/control (+5/-1)
reahl-bzrsupport/reahl/__init__.py (+2/-3)
reahl-bzrsupport/reahl/bzrsupport.py (+32/-35)
reahl-bzrsupport/reahl/bzrsupport_dev/bzrtests.py (+4/-5)
reahl-component/.reahlproject (+2/-2)
reahl-component/etc/reahl.config.py (+3/-4)
reahl-component/reahl/__init__.py (+2/-3)
reahl-component/reahl/component/__init__.py (+2/-4)
reahl-component/reahl/component/config.py (+5/-8)
reahl-component/reahl/component/context.py (+2/-3)
reahl-component/reahl/component/dbutils.py (+16/-12)
reahl-component/reahl/component/decorators.py (+2/-3)
reahl-component/reahl/component/eggs.py (+9/-5)
reahl-component/reahl/component/exceptions.py (+22/-25)
reahl-component/reahl/component/i18n.py (+4/-3)
reahl-component/reahl/component/migration.py (+110/-4)
reahl-component/reahl/component/modelinterface.py (+31/-16)
reahl-component/reahl/component/prodshell.py (+2/-3)
reahl-component/reahl/component/py3compat.py (+21/-4)
reahl-component/reahl/component/shelltools.py (+2/-3)
reahl-component/reahl/component_dev/argumentchecks.py (+2/-3)
reahl-component/reahl/component_dev/attachmenttests.py (+2/-3)
reahl-component/reahl/component_dev/componenttests.py (+3/-4)
reahl-component/reahl/component_dev/configtests.py (+2/-3)
reahl-component/reahl/component_dev/contexttests.py (+2/-3)
reahl-component/reahl/component_dev/domainaccesscontrol.py (+24/-5)
reahl-component/reahl/component_dev/fieldtests.py (+2/-3)
reahl-component/reahl/component_dev/fixtures.py (+2/-3)
reahl-component/reahl/component_dev/i18ntests.py (+2/-3)
reahl-component/reahl/component_dev/migrationtests.py (+238/-8)
reahl-component/reahl/messages/__init__.py (+2/-3)
reahl-component/reahl/messages/af/LC_MESSAGES/reahl-component.po (+10/-2)
reahl-component/reahl/messages/reahl-component (+13/-1)
reahl-dev/.reahlproject (+1/-1)
reahl-dev/reahl/__init__.py (+2/-3)
reahl-dev/reahl/dev/__init__.py (+2/-4)
reahl-dev/reahl/dev/devdomain.py (+22/-22)
reahl-dev/reahl/dev/devshell.py (+2/-5)
reahl-dev/reahl/dev/exceptions.py (+2/-3)
reahl-dev/reahl/dev/fixtures.py (+2/-3)
reahl-dev/reahl/dev/mailtest.py (+2/-3)
reahl-dev/reahl/dev/tools.py (+2/-3)
reahl-dev/reahl/dev/xmlreader.py (+2/-4)
reahl-dev/reahl/dev_dev/__init__.py (+1/-1)
reahl-dev/reahl/dev_dev/domaintests.py (+2/-3)
reahl-dev/reahl/dev_dev/xmlreadertests.py (+2/-3)
reahl-dev/reahl_dev.egg-info/PKG-INFO (+4/-0)
reahl-dev/reahl_dev.egg-info/SOURCES.txt (+0/-1)
reahl-dev/reahl_dev.egg-info/entry_points.txt (+42/-42)
reahl-dev/reahl_dev.egg-info/requires.txt (+4/-4)
reahl-doc/.reahlproject (+3/-1)
reahl-doc/doc/component/index.rst (+1/-1)
reahl-doc/doc/conf.py (+2/-3)
reahl-doc/doc/declarativemigration.rst (+49/-0)
reahl-doc/doc/devtools/index.rst (+1/-1)
reahl-doc/doc/devtools/stubble.rst (+9/-6)
reahl-doc/doc/domain/index.rst (+1/-1)
reahl-doc/doc/domain/systemaccountui.rst (+1/-1)
reahl-doc/doc/domain/workflowui.rst (+1/-1)
reahl-doc/doc/features/accesscontrol.rst (+1/-1)
reahl-doc/doc/features/enduserfunctionality.rst (+1/-1)
reahl-doc/doc/features/i18n.rst (+1/-1)
reahl-doc/doc/features/index.rst (+1/-1)
reahl-doc/doc/features/layout.rst (+1/-1)
reahl-doc/doc/features/pageflow.rst (+1/-1)
reahl-doc/doc/features/persistence.rst (+1/-1)
reahl-doc/doc/features/security.rst (+1/-1)
reahl-doc/doc/features/tabbedpanel.rst (+1/-1)
reahl-doc/doc/features/tools.rst (+1/-1)
reahl-doc/doc/features/validation.rst (+1/-1)
reahl-doc/doc/index.rst (+1/-1)
reahl-doc/doc/overview.rst (+3/-3)
reahl-doc/doc/overview.svg (+6/-6)
reahl-doc/doc/tutorial/accesscontrolinc2.rst (+1/-1)
reahl-doc/doc/tutorial/buttonwidgets.rst (+1/-1)
reahl-doc/doc/tutorial/connectingviews.rst (+1/-1)
reahl-doc/doc/tutorial/dependencyinjection.rst (+14/-14)
reahl-doc/doc/tutorial/depinjection.svg (+1/-1)
reahl-doc/doc/tutorial/deployment.rst (+1/-1)
reahl-doc/doc/tutorial/exampleapp.rst (+1/-1)
reahl-doc/doc/tutorial/gettingstarted-develop.rst (+19/-17)
reahl-doc/doc/tutorial/gettingstarted-install.rst (+50/-1)
reahl-doc/doc/tutorial/gettingstarted.rst (+12/-4)
reahl-doc/doc/tutorial/i18n.rst (+1/-1)
reahl-doc/doc/tutorial/index.rst (+1/-1)
reahl-doc/doc/tutorial/inputwidgets.rst (+3/-3)
reahl-doc/doc/tutorial/install-ubuntu.rst (+1/-1)
reahl-doc/doc/tutorial/install-win.rst (+1/-1)
reahl-doc/doc/tutorial/loggingin.rst (+1/-1)
reahl-doc/doc/tutorial/models.rst (+1/-1)
reahl-doc/doc/tutorial/owncomponent.rst (+1/-1)
reahl-doc/doc/tutorial/ownwidget.rst (+1/-1)
reahl-doc/doc/tutorial/parameterised.rst (+1/-1)
reahl-doc/doc/tutorial/persistence.rst (+37/-33)
reahl-doc/doc/tutorial/sessions.rst (+3/-4)
reahl-doc/doc/tutorial/slots.rst (+1/-1)
reahl-doc/doc/tutorial/styling.rst (+1/-1)
reahl-doc/doc/tutorial/testing.rst (+1/-1)
reahl-doc/doc/tutorial/uibasics.rst (+1/-1)
reahl-doc/doc/web/dhtml.rst (+1/-1)
reahl-doc/doc/web/fw.rst (+1/-1)
reahl-doc/doc/web/index.rst (+1/-1)
reahl-doc/doc/web/ui.rst (+1/-1)
reahl-doc/doc/whatchanged.rst (+112/-1)
reahl-doc/etc/componentconfig.config.py (+1/-2)
reahl-doc/etc/reahl.config.py (+3/-2)
reahl-doc/etc/web.config.py (+2/-3)
reahl-doc/reahl/__init__.py (+2/-3)
reahl-doc/reahl/doc/basichtmlinputs-etc/reahl.config.py (+2/-3)
reahl-doc/reahl/doc/basichtmlinputs-etc/web.config.py (+2/-3)
reahl-doc/reahl/doc/basichtmlinputs.py (+2/-3)
reahl-doc/reahl/doc/basichtmlwidgets-etc/reahl.config.py (+2/-3)
reahl-doc/reahl/doc/basichtmlwidgets-etc/web.config.py (+2/-3)
reahl-doc/reahl/doc/basichtmlwidgets.py (+2/-3)
reahl-doc/reahl/doc/commands.py (+2/-3)
reahl-doc/reahl/doc/examples/features/access/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/features/access/access.py (+1/-2)
reahl-doc/reahl/doc/examples/features/access/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/features/i18nexample/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/features/i18nexample/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/features/i18nexample/i18nexample.py (+1/-2)
reahl-doc/reahl/doc/examples/features/layout/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/features/layout/etc/web.config.py (+2/-3)
reahl-doc/reahl/doc/examples/features/layout/layout.py (+1/-2)
reahl-doc/reahl/doc/examples/features/pageflow/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/features/pageflow/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/features/pageflow/pageflow.py (+1/-2)
reahl-doc/reahl/doc/examples/features/persistence/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/features/persistence/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/features/persistence/persistence.py (+9/-10)
reahl-doc/reahl/doc/examples/features/tabbedpanel/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/features/tabbedpanel/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/features/tabbedpanel/tabbedpanel.py (+1/-2)
reahl-doc/reahl/doc/examples/features/validation/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/features/validation/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/features/validation/validation.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/access/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/access/access.py (+45/-35)
reahl-doc/reahl/doc/examples/tutorial/access/access_dev/accesstests.py (+6/-6)
reahl-doc/reahl/doc/examples/tutorial/access/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/access1/access1.py (+44/-36)
reahl-doc/reahl/doc/examples/tutorial/access1/access1_dev/accesstests1.py (+8/-4)
reahl-doc/reahl/doc/examples/tutorial/access2/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/access2/access2.py (+43/-36)
reahl-doc/reahl/doc/examples/tutorial/access2/access2_dev/accesstests2.py (+6/-4)
reahl-doc/reahl/doc/examples/tutorial/access2/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/addressbook1/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/addressbook1/addressbook1.py (+12/-12)
reahl-doc/reahl/doc/examples/tutorial/addressbook1/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/addressbook2/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/addressbook2/addressbook2.py (+10/-11)
reahl-doc/reahl/doc/examples/tutorial/addressbook2/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/ajax/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/ajax/ajax.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/ajax/ajax_dev/ajaxtests.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/ajax/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/componentconfig/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/componentconfig/componentconfig.py (+11/-11)
reahl-doc/reahl/doc/examples/tutorial/componentconfig/componentconfig_dev/componentconfigtests.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/componentconfig/etc/componentconfig.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/componentconfig/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/datatable/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/datatable/datatable.py (+14/-16)
reahl-doc/reahl/doc/examples/tutorial/datatable/datatable_dev/datatabletests.py (+2/-3)
reahl-doc/reahl/doc/examples/tutorial/datatable/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/hello/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/hello/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/hello/hello.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/helloapache/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/helloapache/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/helloapache/helloapache.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/helloapache/prod/etc/reahl.config.py (+2/-3)
reahl-doc/reahl/doc/examples/tutorial/helloapache/prod/etc/systemaccountmodel.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/helloapache/prod/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/hellonginx/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/hellonginx/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/hellonginx/hellonginx.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/hellonginx/hellonginxwsgi.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/hellonginx/prod/etc/reahl.config.py (+2/-3)
reahl-doc/reahl/doc/examples/tutorial/hellonginx/prod/etc/systemaccountmodel.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/hellonginx/prod/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/i18nexample/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/i18nexample/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/i18nexample/i18nexample.py (+9/-11)
reahl-doc/reahl/doc/examples/tutorial/i18nexample/i18nexamplemessages/af/LC_MESSAGES/reahl-doc.po (+27/-1)
reahl-doc/reahl/doc/examples/tutorial/i18nexample/i18nexamplemessages/reahl-doc (+30/-0)
reahl-doc/reahl/doc/examples/tutorial/jobs/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/jobs/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/jobs/jobs.py (+14/-16)
reahl-doc/reahl/doc/examples/tutorial/jobs/jobs_dev/jobstests.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/login1/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/login1/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/login1/login1.py (+2/-3)
reahl-doc/reahl/doc/examples/tutorial/login1/login1_dev/logintests1.py (+4/-3)
reahl-doc/reahl/doc/examples/tutorial/login2/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/login2/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/login2/login2.py (+2/-3)
reahl-doc/reahl/doc/examples/tutorial/login2/login2_dev/logintests2.py (+4/-3)
reahl-doc/reahl/doc/examples/tutorial/migrationexample/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/migrationexample/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/migrationexample/migrationexample.py (+13/-17)
reahl-doc/reahl/doc/examples/tutorial/migrationexample/migrationexample_dev/migrationtests.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/modeltests1.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/modeltests2.py (+11/-12)
reahl-doc/reahl/doc/examples/tutorial/modeltests3.py (+12/-11)
reahl-doc/reahl/doc/examples/tutorial/pageflow1/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/pageflow1/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/pageflow1/pageflow1.py (+11/-11)
reahl-doc/reahl/doc/examples/tutorial/pageflow2/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/pageflow2/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/pageflow2/pageflow2.py (+11/-11)
reahl-doc/reahl/doc/examples/tutorial/pager/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/pager/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/pager/pager.py (+2/-3)
reahl-doc/reahl/doc/examples/tutorial/pager/pager_dev/pagertests.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/parameterised1/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/parameterised1/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/parameterised1/parameterised1.py (+11/-11)
reahl-doc/reahl/doc/examples/tutorial/parameterised2/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/parameterised2/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/parameterised2/parameterised2.py (+11/-11)
reahl-doc/reahl/doc/examples/tutorial/parameterised2/parameterised2_dev/parameterised2tests1.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/parameterised2/parameterised2_dev/parameterised2tests2.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/parameterised2/parameterised2_dev/parameterised2tests3.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/sessionscope/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/sessionscope/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/sessionscope/sessionscope.py (+22/-17)
reahl-doc/reahl/doc/examples/tutorial/sessionscope/sessionscope_dev/sessionscopetests.py (+3/-2)
reahl-doc/reahl/doc/examples/tutorial/slots/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/slots/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/slots/slots.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/table/.reahlproject (+1/-1)
reahl-doc/reahl/doc/examples/tutorial/table/etc/web.config.py (+1/-2)
reahl-doc/reahl/doc/examples/tutorial/table/table.py (+13/-13)
reahl-doc/reahl/doc/examples/tutorial/table/table_dev/tabletests.py (+2/-3)
reahl-doc/reahl/doc/examples/tutorial/testbasics.py (+1/-2)
reahl-doc/reahl/doc/fileupload-etc/reahl.config.py (+2/-3)
reahl-doc/reahl/doc/fileupload-etc/web.config.py (+2/-3)
reahl-doc/reahl/doc/fileupload.py (+21/-19)
reahl-doc/reahl/doc_dev/tests.py (+12/-12)
reahl-domain/.reahlproject (+4/-1)
reahl-domain/etc/reahl.config.py (+2/-3)
reahl-domain/reahl/__init__.py (+2/-3)
reahl-domain/reahl/domain/elixirmigration.py (+134/-0)
reahl-domain/reahl/domain/partymodel.py (+11/-16)
reahl-domain/reahl/domain/systemaccountmodel.py (+257/-219)
reahl-domain/reahl/domain/workflowmodel.py (+66/-32)
reahl-domain/reahl/domain_dev/fixtures.py (+12/-9)
reahl-domain/reahl/domain_dev/partytests.py (+47/-37)
reahl-domain/reahl/domain_dev/workflowtests.py (+52/-33)
reahl-domain/reahl/messages/__init__.py (+2/-3)
reahl-domain/reahl/messages/af/LC_MESSAGES/reahl-domain.po (+134/-2)
reahl-domain/reahl/messages/reahl-domain (+137/-1)
reahl-domain/reahl/partymodel.py (+2/-0)
reahl-domain/reahl/systemaccountmodel.py (+2/-0)
reahl-domain/reahl/workflowmodel.py (+2/-0)
reahl-domainui/etc/reahl.config.py (+2/-3)
reahl-domainui/etc/web.config.py (+2/-3)
reahl-domainui/reahl/__init__.py (+2/-3)
reahl-domainui/reahl/domainui/accounts.py (+3/-4)
reahl-domainui/reahl/domainui/workflow.py (+3/-4)
reahl-domainui/reahl/domainui_dev/accounttests.py (+12/-7)
reahl-domainui/reahl/domainui_dev/fixtures.py (+2/-3)
reahl-domainui/reahl/domainui_dev/workflowtests.py (+13/-23)
reahl-domainui/reahl/domainuiegg.py (+2/-3)
reahl-domainui/reahl/messages/__init__.py (+2/-3)
reahl-domainui/reahl/messages/af/LC_MESSAGES/reahl-domainui.po (+6/-2)
reahl-domainui/reahl/messages/reahl-domainui (+9/-1)
reahl-interfaces/reahl/__init__.py (+2/-3)
reahl-interfaces/reahl/interfaces.py (+2/-3)
reahl-mailutil/.reahlproject (+1/-1)
reahl-mailutil/reahl/__init__.py (+2/-3)
reahl-mailutil/reahl/mailutil/mail.py (+8/-9)
reahl-mailutil/reahl/mailutil/reusableconfig.py (+2/-3)
reahl-mailutil/reahl/mailutil/rst.py (+2/-3)
reahl-mailutil/reahl/mailutil_dev/mailtests.py (+2/-3)
reahl-postgresqlsupport/.reahlproject (+1/-1)
reahl-postgresqlsupport/reahl/__init__.py (+2/-3)
reahl-postgresqlsupport/reahl/postgresqlsupport.py (+6/-5)
reahl-sqlalchemysupport/.reahlproject (+7/-3)
reahl-sqlalchemysupport/reahl/__init__.py (+2/-3)
reahl-sqlalchemysupport/reahl/elixirsupport.py (+0/-36)
reahl-sqlalchemysupport/reahl/sqlalchemysupport/__init__.py (+4/-0)
reahl-sqlalchemysupport/reahl/sqlalchemysupport/elixirmigration.py (+84/-0)
reahl-sqlalchemysupport/reahl/sqlalchemysupport/sqlalchemysupport.py (+68/-23)
reahl-sqlalchemysupport/reahl/sqlalchemysupport_dev/fixtures.py (+6/-24)
reahl-sqlalchemysupport/reahl/sqlalchemysupport_dev/sqlalchemytests.py (+2/-3)
reahl-sqlitesupport/reahl/__init__.py (+2/-3)
reahl-sqlitesupport/reahl/sqlitesupport.py (+3/-5)
reahl-stubble/examples/__init__.py (+1/-1)
reahl-stubble/examples/example.py (+2/-3)
reahl-stubble/examples/setuptools.py (+2/-3)
reahl-stubble/ideas/stubble.py (+3/-5)
reahl-stubble/reahl/__init__.py (+2/-3)
reahl-stubble/reahl/stubble/__init__.py (+2/-3)
reahl-stubble/reahl/stubble/easteregg.py (+2/-3)
reahl-stubble/reahl/stubble/intercept.py (+54/-37)
reahl-stubble/reahl/stubble/stub.py (+11/-9)
reahl-stubble/reahl/stubble_dev/BasicStubRequirementsTests.py (+104/-130)
reahl-stubble/reahl/stubble_dev/DelegationTests.py (+2/-3)
reahl-stubble/reahl/stubble_dev/EasterEggTests.py (+4/-5)
reahl-stubble/reahl/stubble_dev/ImpostoringTests.py (+2/-3)
reahl-stubble/reahl/stubble_dev/InstanceVariablesTests.py (+2/-3)
reahl-stubble/reahl/stubble_dev/InterceptTests.py (+60/-21)
reahl-stubble/reahl/stubble_dev/__init__.py (+1/-1)
reahl-tofu/devenv/TestHarness.py (+2/-3)
reahl-tofu/examples/example.py (+2/-3)
reahl-tofu/reahl/__init__.py (+2/-3)
reahl-tofu/reahl/tofu/__init__.py (+2/-3)
reahl-tofu/reahl/tofu/checks.py (+2/-3)
reahl-tofu/reahl/tofu/files.py (+23/-25)
reahl-tofu/reahl/tofu/fixture.py (+8/-8)
reahl-tofu/reahl/tofu/nosesupport.py (+12/-13)
reahl-tofu/reahl/tofu_dev/FixtureTests.py (+2/-3)
reahl-tofu/reahl/tofu_dev/nose_support.py (+2/-3)
reahl-tofu/tofu_test/__init__.py (+1/-1)
reahl-tofu/tofu_test/mod.py (+2/-3)
reahl-tofu/tofu_test/stubs.py (+2/-3)
reahl-web-declarative/.bzrignore (+3/-3)
reahl-web-declarative/.reahlproject (+12/-7)
reahl-web-declarative/etc/reahl.config.py (+3/-13)
reahl-web-declarative/etc/web.config.py (+2/-3)
reahl-web-declarative/reahl/__init__.py (+2/-3)
reahl-web-declarative/reahl/webdeclarative/migrations.py (+64/-0)
reahl-web-declarative/reahl/webdeclarative/webdeclarative.py (+66/-59)
reahl-web-declarative/reahl/webdeclarative_dev/__init__.py (+1/-1)
reahl-web-declarative/reahl/webdeclarative_dev/basic_tests.py (+56/-12)
reahl-web/.reahlproject (+6/-6)
reahl-web/etc/reahl.config.py (+3/-4)
reahl-web/etc/web.config.py (+2/-3)
reahl-web/reahl/__init__.py (+2/-3)
reahl-web/reahl/messages/__init__.py (+2/-3)
reahl-web/reahl/messages/af/LC_MESSAGES/reahl-web.po (+14/-2)
reahl-web/reahl/messages/reahl-web (+17/-1)
reahl-web/reahl/web/dhtml.py (+9/-10)
reahl-web/reahl/web/egg.py (+2/-3)
reahl-web/reahl/web/fw.py (+124/-56)
reahl-web/reahl/web/interfaces.py (+23/-21)
reahl-web/reahl/web/pager.py (+3/-4)
reahl-web/reahl/web/reahl.ajaxlink.js (+1/-1)
reahl-web/reahl/web/reahl.cueinput.js (+1/-1)
reahl-web/reahl/web/reahl.fileuploadli.js (+1/-1)
reahl-web/reahl/web/reahl.fileuploadpanel.js (+1/-1)
reahl-web/reahl/web/reahl.form.js (+1/-1)
reahl-web/reahl/web/reahl.hashchange.js (+1/-1)
reahl-web/reahl/web/reahl.hmenu.css (+1/-1)
reahl-web/reahl/web/reahl.labelledinput.css (+1/-1)
reahl-web/reahl/web/reahl.labeloverinput.css (+1/-1)
reahl-web/reahl/web/reahl.labeloverinput.js (+1/-1)
reahl-web/reahl/web/reahl.menu.css (+1/-1)
reahl-web/reahl/web/reahl.popupa.js (+1/-1)
reahl-web/reahl/web/reahl.textinput.js (+1/-1)
reahl-web/reahl/web/static/css/basic.css (+1/-1)
reahl-web/reahl/web/static/reahl.css (+1/-1)
reahl-web/reahl/web/static/reahl.modaldialog.js (+1/-1)
reahl-web/reahl/web/static/reahl.validate.js (+1/-1)
reahl-web/reahl/web/table.py (+1/-0)
reahl-web/reahl/web/ui.py (+15/-14)
reahl-web/reahl/web_dev/advanced/factories.py (+5/-5)
reahl-web/reahl/web_dev/advanced/requesthandling.py (+7/-4)
reahl-web/reahl/web_dev/advanced/staticfiles.py (+16/-20)
reahl-web/reahl/web_dev/advanced/subresources/fieldvalidator.py (+3/-4)
reahl-web/reahl/web_dev/advanced/subresources/remotemethods.py (+9/-7)
reahl-web/reahl/web_dev/advanced/subresources/resourcebasics.py (+2/-3)
reahl-web/reahl/web_dev/appstructure/appbasics.py (+4/-4)
reahl-web/reahl/web_dev/appstructure/parameterised.py (+2/-3)
reahl-web/reahl/web_dev/appstructure/parameterised_errors.py (+2/-3)
reahl-web/reahl/web_dev/appstructure/user_interface_errors.py (+2/-3)
reahl-web/reahl/web_dev/appstructure/user_interfaces.py (+2/-3)
reahl-web/reahl/web_dev/dhtmltests.py (+7/-7)
reahl-web/reahl/web_dev/fixtures.py (+10/-6)
reahl-web/reahl/web_dev/i18ntests.py (+2/-3)
reahl-web/reahl/web_dev/inputandvalidation/eventhandling.py (+9/-9)
reahl-web/reahl/web_dev/inputandvalidation/fieldtests.py (+3/-4)
reahl-web/reahl/web_dev/inputandvalidation/files.py (+15/-14)
reahl-web/reahl/web_dev/inputandvalidation/inputtests.py (+2/-3)
reahl-web/reahl/web_dev/inputandvalidation/widgetqueryargs.py (+2/-3)
reahl-web/reahl/web_dev/pageflow.py (+3/-4)
reahl-web/reahl/web_dev/securitytests.py (+2/-3)
reahl-web/reahl/web_dev/widgets/datatabletests.py (+2/-3)
reahl-web/reahl/web_dev/widgets/htmlwidgets.py (+4/-5)
reahl-web/reahl/web_dev/widgets/pagertests.py (+2/-3)
reahl-web/reahl/web_dev/widgets/specificwidgets.py (+2/-3)
reahl-web/reahl/web_dev/widgets/tabletests.py (+2/-3)
reahl-web/reahl/web_dev/widgets/widgetbasics.py (+5/-5)
reahl-webdev/.reahlproject (+4/-4)
reahl-webdev/reahl/__init__.py (+2/-3)
reahl-webdev/reahl/webdev/commands.py (+2/-3)
reahl-webdev/reahl/webdev/fixtures.py (+5/-6)
reahl-webdev/reahl/webdev/tools.py (+31/-15)
reahl-webdev/reahl/webdev/webserver.py (+40/-42)
scripts/bootstrap.py (+9/-8)
scripts/makeenv.sh (+1/-1)
Text conflict in debian/changelog
Text conflict in debian/control
Text conflict in reahl-component/reahl/component/dbutils.py
Text conflict in reahl-component/reahl/component/migration.py
Text conflict in reahl-component/reahl/component_dev/migrationtests.py
Text conflict in reahl-component/reahl/messages/af/LC_MESSAGES/reahl-component.po
Text conflict in reahl-component/reahl/messages/reahl-component
Text conflict in reahl-dev/reahl_dev.egg-info/PKG-INFO
Text conflict in reahl-doc/doc/tutorial/gettingstarted-install.rst
Text conflict in reahl-doc/doc/tutorial/gettingstarted.rst
Text conflict in reahl-doc/doc/whatchanged.rst
Text conflict in reahl-doc/reahl/doc/examples/tutorial/i18nexample/i18nexamplemessages/af/LC_MESSAGES/reahl-doc.po
Text conflict in reahl-doc/reahl/doc/examples/tutorial/i18nexample/i18nexamplemessages/reahl-doc
Text conflict in reahl-domain/reahl/domain/workflowmodel.py
Text conflict in reahl-domain/reahl/messages/af/LC_MESSAGES/reahl-domain.po
Text conflict in reahl-domain/reahl/messages/reahl-domain
Text conflict in reahl-domainui/reahl/messages/af/LC_MESSAGES/reahl-domainui.po
Text conflict in reahl-domainui/reahl/messages/reahl-domainui
Text conflict in reahl-sqlalchemysupport/reahl/sqlalchemysupport/sqlalchemysupport.py
Text conflict in reahl-web/reahl/messages/af/LC_MESSAGES/reahl-web.po
Text conflict in reahl-web/reahl/messages/reahl-web
To merge this branch: bzr merge lp:~pieter-equinox/reahl/reahl-declarative
Reviewer Review Type Date Requested Status
Iwan Vosloo Pending
Review via email: mp+231357@code.launchpad.net
To post a comment you must log in.
106. By Pieter Nagel

Merged

107. By Pieter Nagel

Fix some temporary files that were opened in binary mode for writing text to. Tried to document the issue by making the file open mode a parameter, defaulting to text mode

108. By Pieter Nagel

Add __future__ imports for absolute_import, division, and ensure all py files have them

109. By Pieter Nagel

Fix broken ambiguous imports revealed by enabling absolute_import

110. By Pieter Nagel

Standardize all multiline future imports into a sngle one-liner

111. By Pieter Nagel

from __future__ import with_statement not needed since Python 2.6, reahl is on Python 2.7

112. By Pieter Nagel

Fix bogus import of exceptions module that no longer exists in Py3

113. By Pieter Nagel

Fix DeclarativeMeta/ABCMeta hackery at the root (hackery anyway didn't work under Py3)

114. By Pieter Nagel

Fix another case of text files opened in binary mode

115. By Pieter Nagel

Fix import that needed to go through six.moves

116. By Pieter Nagel

Python 2 identifiers are limited to pure ASCII, Python 3 are a larger subset of Unicode

117. By Pieter Nagel

Ensure arg_checks applies to the actual callable that checkargs() is going to check

118. By Pieter Nagel

No longer redundantly specify __init__ to checkargs

119. By Pieter Nagel

checkargs no longer magically adds 'self' for you, the sender has to specify NotYetAvailalbe('self') whenever relevant

120. By Pieter Nagel

Clean up checkargs() a bit (overbroad try/except scope, etc)

121. By Pieter Nagel

Silence test noise under Py3 about cgi.escape deprecation

122. By Pieter Nagel

Try to reduce the misconception that UTF-8 is magic compatibility sauce for *all* context where bytes-as-text is used (it only applies where protocol specifies it receives UTF-8)

123. By Pieter Nagel

WebOb does not want bytes for header values under Python 3. Also, UTF-8 encoding the headers showed conceptual misunderstaning

124. By Pieter Nagel

merged

125. By Pieter Nagel

Adapt test to fact that classes str themselves differently under Py3

126. By Pieter Nagel

Fix nondeterministic sort order

127. By Pieter Nagel

Leave comment on UploadedFile about file-like object issues, fixing it now seems a bit of a tangent

128. By Pieter Nagel

Adapt tests to fact that uploaded files are bytes

129. By Pieter Nagel

For some strange reason MultiDict sometimes returns empty string and sometimes empty bytes?

130. By Pieter Nagel

keys() in Py3 is a view

131. By Pieter Nagel

Baby step: small refactorings

132. By Pieter Nagel

Baby step: fix confysion between content encoding and charset

133. By Pieter Nagel

WSGI spec does want iterator over bytes in Py3 as well. Adapt test accordingly

134. By Pieter Nagel

Fix: ViewableFile intended encoding to mean encoding, not charset.

135. By Pieter Nagel

Change API of FileFromBlob to rather take contents in the form of unicode/str (Py2) or str/bytes (Py3)

136. By Pieter Nagel

Remove the mucking with setdefaultencoding

137. By Pieter Nagel

Reduce more UTF-8 magic constants

138. By Pieter Nagel

Reduce more UTF-8 magic constants

139. By Pieter Nagel

Remove more utf-8 magic contants

140. By Pieter Nagel

Less utf-8 magic constants

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2014-07-17 08:49:33 +0000
3+++ .bzrignore 2014-09-04 15:41:33 +0000
4@@ -5,6 +5,7 @@
5 debian/*.debhelper
6 debian/*.substvars
7 debian/files
8+__pycache__
9 *.old
10 build
11 _build
12@@ -28,7 +29,7 @@
13 debian/python-reahl-domain/
14 debian/python-reahl-domainui/
15 debian/python-reahl-web/
16-debian/python-reahl-web-elixirimpl/
17+debian/python-reahl-web-declarative/
18 debian/*.debhelper.log
19 reahl-component/reahl_component.egg-info/
20 reahl-doc/reahl_doc.egg-info/
21@@ -42,7 +43,7 @@
22 reahl-stubble/reahl_stubble.egg-info/
23 reahl-tofu/reahl_tofu.egg-info/
24 reahl-web/reahl_web.egg-info/
25-reahl-web-elixirimpl/reahl_web_elixirimpl.egg-info/
26+reahl-web-declarative/reahl_web_webdeclarative.egg-info/
27 reahl-webdev/reahl_webdev.egg-info/
28
29 reahl.egg-info/
30
31=== modified file '.reahlproject'
32--- .reahlproject 2014-08-16 07:15:07 +0000
33+++ .reahlproject 2014-09-04 15:41:33 +0000
34@@ -33,10 +33,18 @@
35 <egg name="reahl-postgresqlsupport"/>
36 </extras>
37
38+ <extras name="declarative">
39+ <egg name="reahl-sqlalchemysupport"/>
40+ <egg name="reahl-web-declarative"/>
41+ <egg name="reahl-domain"/>
42+ <egg name="reahl-domainui"/>
43+ </extras>
44+
45 <extras name="elixir">
46- <egg name="reahl-sqlalchemysupport"/>
47- <egg name="reahl-domain"/>
48- <egg name="reahl-domainui"/>
49+ <egg name="reahl-sqlalchemysupport" version="2.1"/>
50+ <egg name="reahl-domain" version="2.1"/>
51+ <egg name="reahl-domainui" version="2.1"/>
52+ <egg name="reahl-web-elixirimpl" version="2.1"/>
53 <egg name="reahl-web-elixirimpl"/>
54 </extras>
55
56
57=== modified file 'MANIFEST.in'
58--- MANIFEST.in 2013-12-08 19:02:48 +0000
59+++ MANIFEST.in 2014-09-04 15:41:33 +0000
60@@ -13,4 +13,4 @@
61 prune reahl-tofu
62 prune reahl-web
63 prune reahl-webdev
64-prune reahl-web-elixirimpl
65+prune reahl-web-declarative
66
67=== modified file 'debian/changelog'
68--- debian/changelog 2014-08-24 12:09:36 +0000
69+++ debian/changelog 2014-09-04 15:41:33 +0000
70@@ -1,11 +1,28 @@
71-python-reahl (2.1.2) unstable; urgency=low
72-
73- * Implements https://blueprints.launchpad.net/reahl/+spec/phased-migration.
74- * Implements https://blueprints.launchpad.net/reahl/+spec/datatable.
75- * Closes bugs: #1326745, #1335641, #1336039, #1336042, #1356992, #1345577, #1345579.
76-
77- -- Iwan Vosloo <iwan@reahl.org> Sun, 24 Aug 2014 13:50:00 +0200
78-
79+<<<<<<< TREE
80+python-reahl (2.1.2) unstable; urgency=low
81+
82+ * Implements https://blueprints.launchpad.net/reahl/+spec/phased-migration.
83+ * Implements https://blueprints.launchpad.net/reahl/+spec/datatable.
84+ * Closes bugs: #1326745, #1335641, #1336039, #1336042, #1356992, #1345577, #1345579.
85+
86+ -- Iwan Vosloo <iwan@reahl.org> Sun, 24 Aug 2014 13:50:00 +0200
87+
88+=======
89+python-reahl (3.0) unstable; urgency=low
90+
91+ * xxx.
92+
93+ -- Iwan Vosloo <iwan@reahl.org> Sun, 24 Aug 2014 13:50:00 +0200
94+
95+python-reahl (2.1.2) unstable; urgency=low
96+
97+ * Implements https://blueprints.launchpad.net/reahl/+spec/phased-migration.
98+ * Implements https://blueprints.launchpad.net/reahl/+spec/datatable.
99+ * Closes bugs: #1326745, #1335641, #1336039, #1336042, #1356992, #1345577, #1345579.
100+
101+ -- Iwan Vosloo <iwan@reahl.org> Sun, 24 Aug 2014 13:50:00 +0200
102+
103+>>>>>>> MERGE-SOURCE
104 python-reahl (2.1.1) unstable; urgency=low
105
106 * Closes small bugs: #1322652, #1322833, #1322855, #1324018, #1324040.
107
108=== modified file 'debian/control'
109--- debian/control 2014-08-19 06:23:54 +0000
110+++ debian/control 2014-09-04 15:41:33 +0000
111@@ -24,7 +24,11 @@
112 This package does not contain much itself, but is an entry point for installing
113 a set of Reahl eggs:
114 .
115+<<<<<<< TREE
116 Install Reahl by installing with extras, eg: easy_install "reahl[elixir,sqlite,dev,doc]"
117+=======
118+ Install Reahl by installing with extras, eg: easy_install "reahl[declarative,sqlite,dev,doc]"
119+>>>>>>> MERGE-SOURCE
120 to install everything needed to run Reahl on sqlite, the dev tools and documentation.
121 .
122 See http://www.reahl.org/docs/current/tutorial/gettingstarted.d.html for
123@@ -253,7 +257,7 @@
124 See http://www.reahl.org/docs/current/tutorial/gettingstarted.d.html for
125 installation instructions.
126
127-Package: python-reahl-web-elixirimpl
128+Package: python-reahl-web-declarative
129 Architecture: all
130 Depends: ${python:Depends}, ${reahl:Depends}
131 Provides: ${python:Provides}
132
133=== modified file 'reahl-bzrsupport/reahl/__init__.py'
134--- reahl-bzrsupport/reahl/__init__.py 2014-07-06 10:25:15 +0000
135+++ reahl-bzrsupport/reahl/__init__.py 2014-09-04 15:41:33 +0000
136@@ -1,4 +1,4 @@
137-# Copyright 2008, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
138+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
139 #
140 # This file is part of Reahl.
141 #
142@@ -16,8 +16,7 @@
143
144 # -*- mode: python; mode: font-lock -*-
145
146-from __future__ import unicode_literals
147-from __future__ import print_function
148+from __future__ import print_function, unicode_literals, absolute_import, division
149
150 __import__('pkg_resources').declare_namespace(__name__)
151
152
153=== modified file 'reahl-bzrsupport/reahl/bzrsupport.py'
154--- reahl-bzrsupport/reahl/bzrsupport.py 2014-07-06 10:25:15 +0000
155+++ reahl-bzrsupport/reahl/bzrsupport.py 2014-09-04 15:41:33 +0000
156@@ -1,4 +1,4 @@
157-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
158+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
159 #
160 # This file is part of Reahl.
161 #
162@@ -15,8 +15,7 @@
163 # along with this program. If not, see <http://www.gnu.org/licenses/>.
164
165
166-from __future__ import unicode_literals
167-from __future__ import print_function
168+from __future__ import print_function, unicode_literals, absolute_import, division
169
170 import subprocess
171 import logging
172@@ -112,18 +111,17 @@
173 return None
174
175 def uses_bzr(self):
176- with TemporaryFile() as err:
177- with TemporaryFile() as out:
178- try:
179- return_code = Executable('bzr').call(['info', self.directory], stdout=out, stderr=err)
180- return return_code == 0
181- except Exception as ex:
182- logging.error('Error trying to execute "bzr info %s": %s' % (self.directory, ex))
183- return False
184+ with open(os.devnull, 'w') as DEVNULL:
185+ try:
186+ return_code = Executable('bzr').call(['info', self.directory], stdout=DEVNULL, stderr=DEVNULL)
187+ return return_code == 0
188+ except Exception as ex:
189+ logging.error('Error trying to execute "bzr info %s": %s' % (self.directory, ex))
190+ return False
191
192 def inventory(self):
193- with TemporaryFile() as err:
194- with TemporaryFile() as out:
195+ with TemporaryFile(mode='w+') as err:
196+ with TemporaryFile(mode='w+') as out:
197 bzr_args = 'inventory %s --kind=file' % self.directory
198 try:
199 return_code = Executable('bzr').call(bzr_args.split(), stdout=out, stderr=err)
200@@ -137,24 +135,23 @@
201 return ['']
202
203 def bzr_installed(self):
204- with TemporaryFile() as err:
205- with TemporaryFile() as out:
206- try:
207- return_code = Executable('bzr').call([], stdout=out, stderr=err, shell=True)
208- return return_code == 0
209- except OSError as ex:
210- if ex.errno == os.errno.ENOENT:
211- return False
212- else:
213- logging.error('Error trying to execute "bzr": %s' % ex)
214- except ExecutableNotInstalledException as ex:
215- pass
216- except Exception as ex:
217+ with open(os.devnull, 'w') as DEVNULL:
218+ try:
219+ return_code = Executable('bzr').call([], stdout=DEVNULL, stderr=DEVNULL, shell=True)
220+ return return_code == 0
221+ except OSError as ex:
222+ if ex.errno == os.errno.ENOENT:
223+ return False
224+ else:
225 logging.error('Error trying to execute "bzr": %s' % ex)
226- return False
227+ except ExecutableNotInstalledException as ex:
228+ pass
229+ except Exception as ex:
230+ logging.error('Error trying to execute "bzr": %s' % ex)
231+ return False
232
233 def commit(self, message, unchanged=False):
234- with file(os.devnull, 'w') as DEVNULL:
235+ with open(os.devnull, 'w') as DEVNULL:
236 args = '-m %s' % message
237 if unchanged:
238 args += ' --unchanged'
239@@ -162,20 +159,20 @@
240 return return_code == 0
241
242 def is_version_controlled(self):
243- with file(os.devnull, 'w') as DEVNULL:
244+ with open(os.devnull, 'w') as DEVNULL:
245 return_code = Executable('bzr').call('info'.split(), cwd=self.directory, stdout=DEVNULL, stderr=DEVNULL)
246 return return_code == 0
247
248 def is_checked_in(self):
249- with TemporaryFile() as out:
250+ with TemporaryFile(mode='w+') as out:
251 return_code = Executable('bzr').call('status'.split(), cwd=self.directory, stdout=out, stderr=out)
252 out.seek(0)
253 return return_code == 0 and not out.read()
254
255 @property
256 def last_commit_time(self):
257- with TemporaryFile() as out:
258- with file(os.devnull, 'w') as DEVNULL:
259+ with TemporaryFile(mode='w+') as out:
260+ with open(os.devnull, 'w') as DEVNULL:
261 Executable('bzr').check_call('log -r -1'.split(), cwd=self.directory, stdout=out, stderr=DEVNULL)
262 out.seek(0)
263 [timestamp] = [line for line in out if line.startswith('timestamp')]
264@@ -183,13 +180,13 @@
265 return datetime.datetime.strptime(timestamp, 'timestamp: %a %Y-%m-%d %H:%M:%S')
266
267 def tag(self, tag_string):
268- with file(os.devnull, 'w') as DEVNULL:
269+ with open(os.devnull, 'w') as DEVNULL:
270 Executable('bzr').check_call(('tag %s' % tag_string).split(), cwd=self.directory, stdout=DEVNULL, stderr=DEVNULL)
271
272 def get_tags(self, head_only=False):
273 tags = []
274- with TemporaryFile() as out:
275- with file(os.devnull, 'w') as DEVNULL:
276+ with TemporaryFile(mode='w+') as out:
277+ with open(os.devnull, 'w') as DEVNULL:
278 head_only = ' -r -1 ' if head_only else ''
279 Executable('bzr').check_call(('tags'+head_only).split(), cwd=self.directory, stdout=out, stderr=DEVNULL)
280 out.seek(0)
281
282=== modified file 'reahl-bzrsupport/reahl/bzrsupport_dev/bzrtests.py'
283--- reahl-bzrsupport/reahl/bzrsupport_dev/bzrtests.py 2014-07-06 10:25:15 +0000
284+++ reahl-bzrsupport/reahl/bzrsupport_dev/bzrtests.py 2014-09-04 15:41:33 +0000
285@@ -1,4 +1,4 @@
286-# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
287+# Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
288 #
289 # This file is part of Reahl.
290 #
291@@ -16,8 +16,7 @@
292
293 """Tests for the bzrsupport module."""
294
295-from __future__ import unicode_literals
296-from __future__ import print_function
297+from __future__ import print_function, unicode_literals, absolute_import, division
298
299 import os
300 import os.path
301@@ -33,7 +32,7 @@
302 def new_bzr_directory(self, initialised=True):
303 bzr_directory = temp_dir()
304 if initialised:
305- with file(os.devnull, 'w') as DEVNULL:
306+ with open(os.devnull, 'w') as DEVNULL:
307 Executable('bzr').check_call(['init'], cwd=bzr_directory.name, stdout=DEVNULL, stderr=DEVNULL)
308 return bzr_directory
309
310@@ -54,7 +53,7 @@
311 bzr = Bzr(fixture.bzr_directory.name)
312 vassert( bzr.is_checked_in() )
313
314- file(os.path.join(fixture.bzr_directory.name, 'afile'), 'w').close()
315+ open(os.path.join(fixture.bzr_directory.name, 'afile'), 'w').close()
316 vassert( not bzr.is_checked_in() )
317
318 @test(BzrFixture)
319
320=== modified file 'reahl-component/.reahlproject'
321--- reahl-component/.reahlproject 2014-07-04 08:35:49 +0000
322+++ reahl-component/.reahlproject 2014-09-04 15:41:33 +0000
323@@ -8,8 +8,8 @@
324
325 <deps purpose="run">
326 <thirdpartyegg name="six"/>
327- <thirdpartyegg name="Babel" minversion="0.9" maxversion="0.10"/>
328- <thirdpartyegg name="python-dateutil" minversion="1.5" maxversion="1.6"/>
329+ <thirdpartyegg name="Babel" minversion="1.3" maxversion="1.3.9999"/>
330+ <thirdpartyegg name="python-dateutil" minversion="2.2" maxversion="2.2.999"/>
331 <thirdpartyegg name="decorator" minversion="3.4" maxversion="3.4"/>
332 </deps>
333
334
335=== modified file 'reahl-component/etc/reahl.config.py'
336--- reahl-component/etc/reahl.config.py 2014-07-06 10:25:15 +0000
337+++ reahl-component/etc/reahl.config.py 2014-09-04 15:41:33 +0000
338@@ -1,4 +1,4 @@
339-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
340+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
341 #
342 # This file is part of Reahl.
343 #
344@@ -15,12 +15,11 @@
345 # along with this program. If not, see <http://www.gnu.org/licenses/>.
346
347
348-from __future__ import unicode_literals
349-from __future__ import print_function
350+from __future__ import print_function, unicode_literals, absolute_import, division
351 from reahl.sqlalchemysupport import SqlAlchemyControl
352
353 reahlsystem.root_egg = 'reahl-component'
354-#reahlsystem.connection_uri = 'postgres://rhug:rhug@localhost/rhug'
355+#reahlsystem.connection_uri = 'postgresql://rhug:rhug@localhost/rhug'
356 reahlsystem.connection_uri = 'sqlite:///:memory:'
357
358 reahlsystem.orm_control = SqlAlchemyControl(echo=False)
359
360=== modified file 'reahl-component/reahl/__init__.py'
361--- reahl-component/reahl/__init__.py 2014-07-06 10:25:15 +0000
362+++ reahl-component/reahl/__init__.py 2014-09-04 15:41:33 +0000
363@@ -1,4 +1,4 @@
364-# Copyright 2007, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
365+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
366 #
367 # This file is part of Reahl.
368 #
369@@ -16,8 +16,7 @@
370
371 # -*- mode: python; mode: font-lock -*-
372
373-from __future__ import unicode_literals
374-from __future__ import print_function
375+from __future__ import print_function, unicode_literals, absolute_import, division
376
377 __import__('pkg_resources').declare_namespace(__name__)
378
379
380=== modified file 'reahl-component/reahl/component/__init__.py'
381--- reahl-component/reahl/component/__init__.py 2014-07-05 10:41:49 +0000
382+++ reahl-component/reahl/component/__init__.py 2014-09-04 15:41:33 +0000
383@@ -1,4 +1,4 @@
384-# Copyright 2009, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
385+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
386 #
387 # This file is part of Reahl.
388 #
389@@ -16,8 +16,6 @@
390
391 """This package consists of the component framework used by Reahl Components.
392
393-from __future__ import unicode_literals
394-from __future__ import print_function
395-import six
396 It includes all component-related functionality needed in a production environment.
397 """
398+from __future__ import print_function, unicode_literals, absolute_import, division
399
400=== modified file 'reahl-component/reahl/component/config.py'
401--- reahl-component/reahl/component/config.py 2014-07-06 10:25:15 +0000
402+++ reahl-component/reahl/component/config.py 2014-09-04 15:41:33 +0000
403@@ -1,4 +1,4 @@
404-# Copyright 2008-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
405+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
406 #
407 # This file is part of Reahl.
408 #
409@@ -16,9 +16,9 @@
410
411 """The Reahl configuration utilities."""
412
413-from __future__ import unicode_literals
414-from __future__ import print_function
415+from __future__ import print_function, unicode_literals, absolute_import, division
416 import sys
417+import six
418 import os.path
419 import logging
420 import tempfile
421@@ -256,10 +256,6 @@
422 self.in_production = in_production
423
424 def configure(self, validate=True):
425- #http://mail.python.org/pipermail/tutor/2005-August/040993.html
426- imp.reload(sys); #read setdefaultencoding python docs - it "enables" the method again
427- sys.setdefaultencoding('utf-8')
428-
429 self.configure_logging()
430 logging.getLogger(__name__).info('Using config in %s' % self.config_directory)
431 sys.path.insert(0,self.config_directory)
432@@ -316,7 +312,8 @@
433 file_path = os.path.join(self.config_directory, new_config.filename)
434 if os.path.isfile(file_path):
435 locals_dict = ConfigAsDict(self)
436- exec(compile(open(file_path).read(), file_path, 'exec'), globals(), locals_dict)
437+ with open(file_path) as f:
438+ exec(compile(f.read(), file_path, 'exec'), globals(), locals_dict)
439 locals_dict.update_required(new_config.config_key)
440 else:
441 message = 'file "%s" not found, using defaults' % file_path
442
443=== modified file 'reahl-component/reahl/component/context.py'
444--- reahl-component/reahl/component/context.py 2014-07-24 08:26:45 +0000
445+++ reahl-component/reahl/component/context.py 2014-09-04 15:41:33 +0000
446@@ -1,4 +1,4 @@
447-# Copyright 2008-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
448+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
449 #
450 # This file is part of Reahl.
451 #
452@@ -16,8 +16,7 @@
453
454 """The Reahl context utilities."""
455
456-from __future__ import unicode_literals
457-from __future__ import print_function
458+from __future__ import print_function, unicode_literals, absolute_import, division
459 import inspect
460
461
462
463=== modified file 'reahl-component/reahl/component/dbutils.py'
464--- reahl-component/reahl/component/dbutils.py 2014-08-21 11:55:07 +0000
465+++ reahl-component/reahl/component/dbutils.py 2014-09-04 15:41:33 +0000
466@@ -1,4 +1,4 @@
467-# Copyright 2008-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
468+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
469 #
470 # This file is part of Reahl.
471 #
472@@ -16,8 +16,7 @@
473
474 """Utilities to manipulate underlying databases - sometimes via an ORM tool."""
475
476-from __future__ import unicode_literals
477-from __future__ import print_function
478+from __future__ import print_function, unicode_literals, absolute_import, division
479 import re
480 from contextlib import contextmanager
481 import logging
482@@ -159,6 +158,7 @@
483 raise InvalidConnectionURIException()
484 return match.groupdict()
485
486+
487 class NullDatabaseControl(DatabaseControl):
488 uri_regex_string = r''
489 @classmethod
490@@ -175,17 +175,21 @@
491
492
493 class ORMControl(object):
494- is_elixir = False
495-
496 def migrate_db(self, eggs_in_order):
497 with self.managed_transaction():
498- migration_run = MigrationRun(self, eggs_in_order)
499- migration_run.schedule_migrations()
500- migration_run.execute_migrations()
501-
502-
503-
504-
505+<<<<<<< TREE
506+ migration_run = MigrationRun(self, eggs_in_order)
507+ migration_run.schedule_migrations()
508+ migration_run.execute_migrations()
509+
510+
511+
512+
513+=======
514+ migration_run = MigrationRun(self, eggs_in_order)
515+ migration_run.schedule_migrations()
516+ migration_run.execute_migrations()
517+>>>>>>> MERGE-SOURCE
518
519
520
521
522=== modified file 'reahl-component/reahl/component/decorators.py'
523--- reahl-component/reahl/component/decorators.py 2014-07-06 10:25:15 +0000
524+++ reahl-component/reahl/component/decorators.py 2014-09-04 15:41:33 +0000
525@@ -1,4 +1,4 @@
526-# Copyright 2010-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
527+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
528 #
529 # This file is part of Reahl.
530 #
531@@ -41,8 +41,7 @@
532 # THE SOFTWARE.
533
534
535-from __future__ import unicode_literals
536-from __future__ import print_function
537+from __future__ import print_function, unicode_literals, absolute_import, division
538
539 from functools import partial, wraps
540 import inspect
541
542=== modified file 'reahl-component/reahl/component/eggs.py'
543--- reahl-component/reahl/component/eggs.py 2014-08-19 06:23:54 +0000
544+++ reahl-component/reahl/component/eggs.py 2014-09-04 15:41:33 +0000
545@@ -1,4 +1,4 @@
546-# Copyright 2007-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
547+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
548 #
549 # This file is part of Reahl.
550 #
551@@ -16,8 +16,7 @@
552
553 """Classes that aid in dealing with Eggs and setting them up."""
554
555-from __future__ import unicode_literals
556-from __future__ import print_function
557+from __future__ import print_function, unicode_literals, absolute_import, division
558 import os
559 import os.path
560 import logging
561@@ -90,6 +89,11 @@
562
563 def get_ordered_classes_exported_on(self, entry_point):
564 entry_point_dict = self.distribution.get_entry_map().get(entry_point, {})
565+ found_eps = set()
566+ for ep in entry_point_dict.values():
567+ if ep in found_eps:
568+ raise AssertionError('%s is listed twice' % ep)
569+ found_eps.add(ep)
570 return [entry.load() for order, entry in sorted([(int(order), e) for order, e in entry_point_dict.items()])]
571
572 def get_classes_exported_on(self, entry_point):
573@@ -148,7 +152,7 @@
574
575 if resource_isdir(requirement, egg_internal_path):
576 languages = [d for d in resource_listdir(requirement, egg_internal_path)
577- if resource_isdir(requirement, '%s/%s' % (egg_internal_path, d))]
578+ if (resource_isdir(requirement, '%s/%s' % (egg_internal_path, d)) and not d.startswith('__'))]
579 else:
580 logging.error('Translations of %s not found in %s' % (requirement, egg_internal_path))
581 languages = []
582@@ -244,7 +248,7 @@
583 for i in cls.compute_ordered_dependent_distributions(main_egg):
584 entry_map = i.get_entry_map('reahl.eggs')
585 if entry_map:
586- classes = entry_map.values()
587+ classes = list(entry_map.values())
588 assert len(classes) == 1, 'Only one eggdeb class per egg allowed'
589 interfaces.append(classes[0].load()(i))
590
591
592=== modified file 'reahl-component/reahl/component/exceptions.py'
593--- reahl-component/reahl/component/exceptions.py 2014-07-06 10:25:15 +0000
594+++ reahl-component/reahl/component/exceptions.py 2014-09-04 15:41:33 +0000
595@@ -1,4 +1,4 @@
596-# Copyright 2010-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
597+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
598 #
599 # This file is part of Reahl.
600 #
601@@ -16,8 +16,7 @@
602
603 """Exceptions used throughout several Reahl components."""
604
605-from __future__ import unicode_literals
606-from __future__ import print_function
607+from __future__ import print_function, unicode_literals, absolute_import, division
608 import six
609 import inspect
610 import sys
611@@ -40,9 +39,10 @@
612 def __init__(self, commit=False):
613 self.commit = commit
614
615- __hash__ = None
616- def __eq__(self, other):
617- return isinstance(other, self.__class__) and self.commit == other.commit
618+# __hash__ = None
619+# def __eq__(self, other):
620+# import pdb; pdb.set_trace()
621+# return isinstance(other, self.__class__) and self.commit == other.commit
622
623 def __reduce__(self):
624 return (self.__class__, (self.commit,))
625@@ -151,6 +151,7 @@
626 def __str__(self):
627 return '%s: %s should be %s or subclass of it (got %s instead)' % (self.func, self.arg_name, self.type_.value, self.value)
628
629+
630 class IsCallable(ArgumentCheck):
631 def __init__(self, args=(), kwargs={}, allow_none=False):
632 super(IsCallable, self).__init__(allow_none=allow_none)
633@@ -179,29 +180,25 @@
634 def __str__(self):
635 return '%s: %s should be a callable object (got %s)' % (self.func, self.arg_name, self.value)
636
637-def checkargs(method, *args, **kwargs):
638- arg_checks = getattr(method, 'arg_checks', {})
639+def checkargs(target, *args, **kwargs):
640+ if inspect.ismethod(target) or inspect.isfunction(target):
641+ to_check = target
642+ elif inspect.isclass(target):
643+ to_check = target.__init__
644+ elif isinstance(target, collections.Callable):
645+ to_check = target.__call__
646+ else:
647+ raise ProgrammerError('%s was expected to be a callable object' % target)
648+
649 try:
650- if inspect.ismethod(method) or inspect.isfunction(method):
651- to_check = method
652- elif inspect.isclass(method):
653- to_check = method.__init__
654- elif isinstance(method, collections.Callable):
655- to_check = method.__call__
656- else:
657- raise ProgrammerError('%s was expected to be a callable object' % method)
658-
659- if inspect.ismethod(to_check) and not to_check.__self__:
660- call_args = (NotYetAvailable('self'),)+args
661- else:
662- call_args = args
663- bound_args = inspect.getcallargs(to_check, *call_args, **kwargs)
664+ bound_args = inspect.getcallargs(to_check, *args, **kwargs)
665 except TypeError as ex:
666- ex.args = (('%s: ' % method)+ex.args[0],) + ex.args[1:]
667+ ex.args = (('%s: ' % target)+ex.args[0],) + ex.args[1:]
668 raise
669- for arg_name, arg_check in arg_checks.items():
670+ args_to_check = getattr(to_check, 'arg_checks', {})
671+ for arg_name, arg_check in args_to_check.items():
672 if arg_name in bound_args.keys():
673- arg_check.check(method, arg_name, bound_args[arg_name])
674+ arg_check.check(target, arg_name, bound_args[arg_name])
675
676 def checkargs_explained(explanation, method, *args, **kwargs):
677 try:
678
679=== modified file 'reahl-component/reahl/component/i18n.py'
680--- reahl-component/reahl/component/i18n.py 2014-07-06 10:25:15 +0000
681+++ reahl-component/reahl/component/i18n.py 2014-09-04 15:41:33 +0000
682@@ -1,4 +1,4 @@
683-# Copyright 2009, 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
684+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
685 #
686 # This file is part of Reahl.
687 #
688@@ -14,8 +14,7 @@
689 # You should have received a copy of the GNU Affero General Public License
690 # along with this program. If not, see <http://www.gnu.org/licenses/>.
691
692-from __future__ import unicode_literals
693-from __future__ import print_function
694+from __future__ import print_function, unicode_literals, absolute_import, division
695 import gettext
696 import threading
697
698@@ -46,6 +45,8 @@
699 for locale_dir in package.__path__:
700 if not isinstance(translation, Translations):
701 translation = Translations.load(dirname=locale_dir, locales=[locale], domain=domain)
702+ # Babel 1.3 bug under Python 3: files is a filter object, not a list like in Python 2
703+ translation.files = list(translation.files)
704 else:
705 translation.merge(Translations.load(dirname=locale_dir, locales=[locale], domain=domain))
706 self.translations[(locale, domain)] = translation
707
708=== modified file 'reahl-component/reahl/component/migration.py'
709--- reahl-component/reahl/component/migration.py 2014-08-24 12:09:36 +0000
710+++ reahl-component/reahl/component/migration.py 2014-09-04 15:41:33 +0000
711@@ -1,4 +1,4 @@
712-# Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
713+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
714 #
715 # This file is part of Reahl.
716 #
717@@ -16,13 +16,18 @@
718
719 """Support for database schema migration."""
720
721-from __future__ import unicode_literals
722-from __future__ import print_function
723+from __future__ import print_function, unicode_literals, absolute_import, division
724 from pkg_resources import parse_version
725-import logging
726+<<<<<<< TREE
727+import logging
728+=======
729+import logging
730+import warnings
731+>>>>>>> MERGE-SOURCE
732
733 from reahl.component.exceptions import ProgrammerError
734
735+<<<<<<< TREE
736
737 class MigrationRun(object):
738 def __init__(self, orm_control, eggs_in_order):
739@@ -83,6 +88,75 @@
740 self.execute(phase)
741
742
743+=======
744+
745+class MigrationRun(object):
746+ def __init__(self, orm_control, eggs_in_order):
747+ self.orm_control = orm_control
748+ self.changes = MigrationSchedule('drop_fk', 'drop_pk', 'pre_alter', 'alter',
749+ 'create_pk', 'indexes', 'data', 'create_fk', 'cleanup')
750+ self.eggs_in_order = eggs_in_order
751+
752+ def migrations_to_run_for(self, egg):
753+ return [migration(self.changes)
754+ for migration in egg.compute_migrations(self.orm_control.schema_version_for(egg, default='0.0'))]
755+
756+ def schedule_migrations(self):
757+ migrations_per_egg = [(egg, self.migrations_to_run_for(egg))
758+ for egg in self.eggs_in_order]
759+
760+ self.schedule_migration_changes(reversed(migrations_per_egg), 'upgrade')
761+ self.schedule_migration_changes(migrations_per_egg, 'upgrade_cleanup')
762+ self.schedule_migration_changes(migrations_per_egg, 'schedule_upgrades')
763+
764+ def schedule_migration_changes(self, migrations_per_egg, method_name):
765+ for egg, migration_list in migrations_per_egg:
766+ current_schema_version = self.orm_control.schema_version_for(egg, default='0.0')
767+ message = 'Scheduling %s %s migrations for %s - from version %s to %s' % \
768+ (len(migration_list), method_name, egg.name,
769+ current_schema_version, egg.version)
770+ logging.getLogger(__name__).info(message)
771+ for migration in migration_list:
772+ if (method_name in ['upgrade', 'upgrade_cleanup']) and hasattr(migration, method_name):
773+ message = 'Please override Migration.schedule_upgrades() instead.'
774+ warnings.warn('DEPRECATED: %s.%s. %s' % (migration.__class__.__name__, method_name, message), DeprecationWarning, stacklevel=-1)
775+ if hasattr(migration, method_name):
776+ getattr(migration, method_name)()
777+
778+ def execute_migrations(self):
779+ self.changes.execute_all()
780+ self.update_schema_versions()
781+
782+ def update_schema_versions(self):
783+ for egg in self.eggs_in_order:
784+ if self.orm_control.schema_version_for(egg, default='0.0') != egg.version:
785+ logging.getLogger(__name__).info('Migrating %s - updating schema version to %s' % (egg.name, egg.version))
786+ self.orm_control.update_schema_version_for(egg)
787+
788+
789+class MigrationSchedule(object):
790+ def __init__(self, *phases):
791+ self.phases_in_order = phases
792+ self.phases = dict([(i, []) for i in phases])
793+
794+ def schedule(self, phase, to_call, *args, **kwargs):
795+ try:
796+ self.phases[phase].append((to_call, args, kwargs))
797+ except KeyError as e:
798+ raise ProgrammerError('A phase with name<%s> does not exist.' % phase)
799+
800+ def execute(self, phase):
801+ logging.getLogger(__name__).info('Executing schema change phase %s' % phase)
802+ for to_call, args, kwargs in self.phases[phase]:
803+ logging.getLogger(__name__).debug(' change: %s(%s, %s)' % (to_call.__name__, args, kwargs))
804+ to_call(*args, **kwargs)
805+
806+ def execute_all(self):
807+ for phase in self.phases_in_order:
808+ self.execute(phase)
809+
810+
811+>>>>>>> MERGE-SOURCE
812 class Migration(object):
813 """Represents one logical change that can be made to an existing database schema.
814
815@@ -101,6 +175,7 @@
816 return parse_version(cls.version) > parse_version(current_schema_version) and \
817 parse_version(cls.version) <= parse_version(new_version)
818
819+<<<<<<< TREE
820 def __init__(self, changes):
821 self.changes = changes
822
823@@ -141,6 +216,37 @@
824 for execution in phases. Rather use :meth:`reahl.component.migration.Migration.schedule_upgrades`.
825 (See :meth:`reahl.component.migration.Migration.schedule`).
826 """
827+=======
828+ def __init__(self, changes):
829+ self.changes = changes
830+
831+ def schedule(self, phase, to_call, *args, **kwargs):
832+ """Call this method to schedule a method call for execution later during the specified migration phase.
833+
834+ Scheduled migrations are first collected from all components, then the calls scheduled for each defined
835+ phase are executed. Calls in one phase are executed in the order they were scheduled. Phases are executed
836+ in the following order:
837+
838+ 'drop_fk', 'drop_pk', 'pre_alter', 'alter', 'create_pk', 'indexes', 'data', 'create_fk', 'cleanup'
839+
840+ :param phase: The name of the phase to schedule this call.
841+ :param to_call: The method or function to call.
842+ :param args: The positional arguments to be passed in the call.
843+ :param kwargs: The keyword arguments to be passed in the call.
844+ """
845+ self.changes.schedule(phase, to_call, *args, **kwargs)
846+
847+ def schedule_upgrades(self):
848+ """Override this method in a subclass in order to supply custom logic for changing the database schema. This
849+ method will be called for each of the applicable Migrations listed for all components, in order of
850+ dependency of components (the component deepest down in the dependency tree, first).
851+
852+ **Added in 2.1.2**: Supply custom upgrade logic by calling `self.schedule()`.
853+ """
854+ warnings.warn('Ignoring %s.schedule_upgrades(): it does not override schedule_upgrades() (method name typo perhaps?)' % self.__class__.__name__ ,
855+ UserWarning, stacklevel=-1)
856+
857+>>>>>>> MERGE-SOURCE
858
859
860
861
862=== modified file 'reahl-component/reahl/component/modelinterface.py'
863--- reahl-component/reahl/component/modelinterface.py 2014-08-12 12:38:44 +0000
864+++ reahl-component/reahl/component/modelinterface.py 2014-09-04 15:41:33 +0000
865@@ -1,4 +1,4 @@
866-# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
867+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
868 #
869 # This file is part of Reahl.
870 #
871@@ -16,8 +16,7 @@
872
873 """Facilities to govern user input and output, as well as what access the current user has to model objects."""
874
875-from __future__ import unicode_literals
876-from __future__ import print_function
877+from __future__ import print_function, unicode_literals, absolute_import, division
878 import six
879 import copy
880 import re
881@@ -1051,7 +1050,8 @@
882
883
884 class SecuredMethod(object):
885- def __init__(self, to_be_called, secured_declaration):
886+ def __init__(self, instance, to_be_called, secured_declaration):
887+ self.instance = instance
888 self.to_be_called = to_be_called
889 self.secured_declaration = secured_declaration
890
891@@ -1060,21 +1060,19 @@
892 raise AccessRestricted()
893 return self.to_be_called(*args, **kwargs)
894
895- def check_right(self, right_to_check, called_self, *args, **kwargs):
896- args_to_send = args
897- if called_self:
898- args_to_send = [called_self]+list(args)
899+ def check_right(self, right_to_check, *args, **kwargs):
900 if right_to_check:
901+ args_to_send = (args if self.instance is None
902+ else (self.instance,)+args)
903 return right_to_check(*args_to_send, **kwargs)
904 else:
905 return True
906
907 def read_check(self, *args, **kwargs):
908- return self.check_right(self.secured_declaration.read_check, six.get_method_self(self.to_be_called), *args, **kwargs)
909+ return self.check_right(self.secured_declaration.read_check, *args, **kwargs)
910
911 def write_check(self, *args, **kwargs):
912- return self.check_right(self.secured_declaration.write_check, six.get_method_self(self.to_be_called), *args, **kwargs)
913-
914+ return self.check_right(self.secured_declaration.write_check, *args, **kwargs)
915
916
917 class SecuredDeclaration(object):
918@@ -1130,8 +1128,9 @@
919 return arg_spec.args[:positional_args_end]
920
921 def __get__(self, instance, owner):
922- method = types.MethodType(self.func, instance, owner)
923- return SecuredMethod(method, self)
924+ method = (self.func if instance is None
925+ else six.create_bound_method(self.func, instance))
926+ return SecuredMethod(instance, method, self)
927
928
929 secured = SecuredDeclaration #: An alias for :class:`SecuredDeclaration`
930@@ -1142,7 +1141,7 @@
931 def __init__(self):
932 account = ExecutionContext.get_context().session.account
933 if account:
934- party = account.party
935+ party = account.owner
936 else:
937 party = None
938 super(CurrentUser, self).__init__(required=True, default=party)
939@@ -1293,7 +1292,7 @@
940 def parse_input(self, unparsed_input):
941 try:
942 return dateutil.parser.parse(unparsed_input, dayfirst=True, parserinfo=self.parser_info).date()
943- except ValueError:
944+ except (ValueError, TypeError): # For TypeError, see https://bugs.launchpad.net/dateutil/+bug/1247643
945 raise InputParseException()
946
947 def unparse_input(self, parsed_value):
948@@ -1462,7 +1461,23 @@
949
950
951 class UploadedFile(object):
952- """Represents a file that was input by a user."""
953+ """Represents a file that was input by a user.
954+
955+ FIXME: This would work better if it just took the bytes of the file as
956+ parameter, and computed size from that, instead of taking a file-like object.
957+ Any idea that using a file is more optimal is a fiction, because we seek
958+ the file to the end which forces the whole file to be buffered in memory
959+ anyway.
960+
961+ The contents of the file should be represented as bytes, because knowing what
962+ the encoding is is a tricky issue. The user only sits in front of the browser
963+ and selects files on their filesystem and hits 'upload'. Those files can be
964+ binary or text. If text, they may or may not be in the same encoding as their
965+ system's preferred encoding. If binary, their browser may guess their content
966+ type correctly or may not, and if we go and decode them with i.e UTF-8, the
967+ system could break with UnicodeDecodeError on jpegs and the like.
968+ """
969+
970 def __init__(self, filename, file_obj, content_type, size):
971 self.file_obj = file_obj
972 self.filename = filename
973
974=== modified file 'reahl-component/reahl/component/prodshell.py'
975--- reahl-component/reahl/component/prodshell.py 2014-08-14 17:42:07 +0000
976+++ reahl-component/reahl/component/prodshell.py 2014-09-04 15:41:33 +0000
977@@ -1,4 +1,4 @@
978-# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
979+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
980 #
981 # This file is part of Reahl.
982 #
983@@ -16,8 +16,7 @@
984
985 """The Reahl production commandline utility."""
986
987-from __future__ import unicode_literals
988-from __future__ import print_function
989+from __future__ import print_function, unicode_literals, absolute_import, division
990
991
992 from pkg_resources import DistributionNotFound
993
994=== modified file 'reahl-component/reahl/component/py3compat.py'
995--- reahl-component/reahl/component/py3compat.py 2014-07-06 13:28:05 +0000
996+++ reahl-component/reahl/component/py3compat.py 2014-09-04 15:41:33 +0000
997@@ -1,7 +1,24 @@
998+from __future__ import print_function, unicode_literals, absolute_import, division
999
1000 import six
1001
1002-def old_str(something):
1003- if six.PY2:
1004- return something.encode('utf-8')
1005- return something
1006+
1007+def ascii_as_bytes_or_str(unicode_str):
1008+ if six.PY2:
1009+ return unicode_str.encode('ascii')
1010+ else:
1011+ return unicode_str
1012+
1013+
1014+def _html_escape_function():
1015+ if six.PY2:
1016+ import cgi
1017+ def html_escape(s, quote=True):
1018+ return cgi.escape(s, quote=quote)
1019+ return html_escape
1020+ else:
1021+ import html
1022+ return html.escape
1023+
1024+
1025+html_escape = _html_escape_function()
1026
1027=== modified file 'reahl-component/reahl/component/shelltools.py'
1028--- reahl-component/reahl/component/shelltools.py 2014-07-06 10:25:15 +0000
1029+++ reahl-component/reahl/component/shelltools.py 2014-09-04 15:41:33 +0000
1030@@ -1,4 +1,4 @@
1031-# Copyright 2009, 2011, 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1032+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1033 #
1034 # This file is part of Reahl.
1035 #
1036@@ -16,8 +16,7 @@
1037
1038 """A basic framework for writing commandline utilities."""
1039
1040-from __future__ import unicode_literals
1041-from __future__ import print_function
1042+from __future__ import print_function, unicode_literals, absolute_import, division
1043 import sys
1044 import os.path
1045 import logging
1046
1047=== modified file 'reahl-component/reahl/component_dev/argumentchecks.py'
1048--- reahl-component/reahl/component_dev/argumentchecks.py 2014-07-06 10:25:15 +0000
1049+++ reahl-component/reahl/component_dev/argumentchecks.py 2014-09-04 15:41:33 +0000
1050@@ -1,4 +1,4 @@
1051-# Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1052+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1053 #
1054 # This file is part of Reahl.
1055 #
1056@@ -15,8 +15,7 @@
1057 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1058
1059
1060-from __future__ import unicode_literals
1061-from __future__ import print_function
1062+from __future__ import print_function, unicode_literals, absolute_import, division
1063 import six
1064 from nose.tools import istest
1065 from reahl.tofu import Fixture
1066
1067=== modified file 'reahl-component/reahl/component_dev/attachmenttests.py'
1068--- reahl-component/reahl/component_dev/attachmenttests.py 2014-07-06 10:25:15 +0000
1069+++ reahl-component/reahl/component_dev/attachmenttests.py 2014-09-04 15:41:33 +0000
1070@@ -1,4 +1,4 @@
1071-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1072+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1073 #
1074 # This file is part of Reahl.
1075 #
1076@@ -16,8 +16,7 @@
1077
1078
1079
1080-from __future__ import unicode_literals
1081-from __future__ import print_function
1082+from __future__ import print_function, unicode_literals, absolute_import, division
1083 from nose.tools import istest
1084 from reahl.tofu import test, Fixture, vassert
1085 from reahl.stubble import easter_egg
1086
1087=== modified file 'reahl-component/reahl/component_dev/componenttests.py'
1088--- reahl-component/reahl/component_dev/componenttests.py 2014-07-06 10:25:15 +0000
1089+++ reahl-component/reahl/component_dev/componenttests.py 2014-09-04 15:41:33 +0000
1090@@ -1,4 +1,4 @@
1091-# Copyright 2011, 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1092+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1093 #
1094 # This file is part of Reahl.
1095 #
1096@@ -15,8 +15,7 @@
1097 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1098
1099
1100-from __future__ import unicode_literals
1101-from __future__ import print_function
1102+from __future__ import print_function, unicode_literals, absolute_import, division
1103
1104 from nose.tools import istest
1105 from reahl.tofu import test, Fixture
1106@@ -38,7 +37,7 @@
1107 # All eggs for a root egg can be found in dependency order
1108 components_in_order = ReahlEgg.compute_ordered_dependent_distributions(easter_egg.as_requirement_string())
1109 component_names_in_order = [i.project_name for i in components_in_order]
1110- vassert( component_names_in_order == [easter_egg.project_name, 'reahl-component', 'decorator', 'python-dateutil', 'Babel', 'six'] )
1111+ vassert( component_names_in_order == [easter_egg.project_name, 'reahl-component', 'decorator', 'python-dateutil', 'six', 'Babel', 'pytz'] )
1112
1113 @test(Fixture)
1114 def interface_with_meta_info(self, fixture):
1115
1116=== modified file 'reahl-component/reahl/component_dev/configtests.py'
1117--- reahl-component/reahl/component_dev/configtests.py 2014-07-06 10:25:15 +0000
1118+++ reahl-component/reahl/component_dev/configtests.py 2014-09-04 15:41:33 +0000
1119@@ -1,4 +1,4 @@
1120-# Copyright 2008-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1121+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1122 #
1123 # This file is part of Reahl.
1124 #
1125@@ -15,8 +15,7 @@
1126 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1127
1128
1129-from __future__ import unicode_literals
1130-from __future__ import print_function
1131+from __future__ import print_function, unicode_literals, absolute_import, division
1132 import six
1133 import pkg_resources
1134 import re
1135
1136=== modified file 'reahl-component/reahl/component_dev/contexttests.py'
1137--- reahl-component/reahl/component_dev/contexttests.py 2014-07-06 10:25:15 +0000
1138+++ reahl-component/reahl/component_dev/contexttests.py 2014-09-04 15:41:33 +0000
1139@@ -1,4 +1,4 @@
1140-# Copyright 2011, 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1141+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1142 #
1143 # This file is part of Reahl.
1144 #
1145@@ -15,8 +15,7 @@
1146 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1147
1148
1149-from __future__ import unicode_literals
1150-from __future__ import print_function
1151+from __future__ import print_function, unicode_literals, absolute_import, division
1152 from nose.tools import istest
1153 from reahl.tofu import test, Fixture
1154 from reahl.tofu import vassert
1155
1156=== modified file 'reahl-component/reahl/component_dev/domainaccesscontrol.py'
1157--- reahl-component/reahl/component_dev/domainaccesscontrol.py 2014-07-06 10:25:15 +0000
1158+++ reahl-component/reahl/component_dev/domainaccesscontrol.py 2014-09-04 15:41:33 +0000
1159@@ -1,4 +1,4 @@
1160-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1161+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1162 #
1163 # This file is part of Reahl.
1164 #
1165@@ -15,8 +15,7 @@
1166 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1167
1168
1169-from __future__ import unicode_literals
1170-from __future__ import print_function
1171+from __future__ import print_function, unicode_literals, absolute_import, division
1172 from nose.tools import istest
1173 from reahl.tofu import Fixture, test, scenario
1174 from reahl.tofu import expected, NoException, vassert
1175@@ -54,7 +53,7 @@
1176
1177 model_object = ModelObject()
1178
1179- # Case: access not allowed
1180+ # Case: access not allowed, called via bound method
1181 model_object.did_something = False
1182 with expected(AccessRestricted):
1183 model_object.do_something_write_only()
1184@@ -65,12 +64,32 @@
1185 model_object.do_something_read_only()
1186 vassert( not model_object.did_something )
1187
1188- # Case: access allowed
1189+ # Case: access not allowed, called via unbound method
1190+ model_object.did_something = False
1191+ method = ModelObject.do_something_write_only
1192+ with expected(AccessRestricted):
1193+ method(model_object)
1194+ vassert( not model_object.did_something )
1195+
1196+ model_object.did_something = False
1197+ method = ModelObject.do_something_read_only
1198+ with expected(AccessRestricted):
1199+ method(model_object)
1200+ vassert( not model_object.did_something )
1201+
1202+ # Case: access allowed, called via bound method
1203 model_object.did_something = False
1204 with expected(NoException):
1205 model_object.do_something_read_and_write()
1206 vassert( model_object.did_something )
1207
1208+ # Case: access allowed, called via unbound method
1209+ model_object.did_something = False
1210+ method = ModelObject.do_something_read_and_write
1211+ with expected(NoException):
1212+ method(model_object)
1213+ vassert( model_object.did_something )
1214+
1215
1216 @test(Fixture)
1217 def checks_must_match_signature(self, fixture):
1218
1219=== modified file 'reahl-component/reahl/component_dev/fieldtests.py'
1220--- reahl-component/reahl/component_dev/fieldtests.py 2014-08-13 17:10:16 +0000
1221+++ reahl-component/reahl/component_dev/fieldtests.py 2014-09-04 15:41:33 +0000
1222@@ -1,4 +1,4 @@
1223-# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1224+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1225 # -*- encoding: utf-8 -*-
1226 #
1227 # This file is part of Reahl.
1228@@ -16,8 +16,7 @@
1229 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1230
1231
1232-from __future__ import unicode_literals
1233-from __future__ import print_function
1234+from __future__ import print_function, unicode_literals, absolute_import, division
1235 import six
1236 import datetime
1237 import functools
1238
1239=== modified file 'reahl-component/reahl/component_dev/fixtures.py'
1240--- reahl-component/reahl/component_dev/fixtures.py 2014-07-06 10:25:15 +0000
1241+++ reahl-component/reahl/component_dev/fixtures.py 2014-09-04 15:41:33 +0000
1242@@ -1,4 +1,4 @@
1243-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1244+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1245 #
1246 # This file is part of Reahl.
1247 #
1248@@ -15,8 +15,7 @@
1249 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1250
1251
1252-from __future__ import unicode_literals
1253-from __future__ import print_function
1254+from __future__ import print_function, unicode_literals, absolute_import, division
1255 from reahl.tofu import Fixture
1256
1257 from reahl.component.context import ExecutionContext
1258
1259=== modified file 'reahl-component/reahl/component_dev/i18ntests.py'
1260--- reahl-component/reahl/component_dev/i18ntests.py 2014-07-06 10:25:15 +0000
1261+++ reahl-component/reahl/component_dev/i18ntests.py 2014-09-04 15:41:33 +0000
1262@@ -1,4 +1,4 @@
1263-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1264+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1265 #
1266 # This file is part of Reahl.
1267 #
1268@@ -14,8 +14,7 @@
1269 # You should have received a copy of the GNU Affero General Public License
1270 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1271
1272-from __future__ import unicode_literals
1273-from __future__ import print_function
1274+from __future__ import print_function, unicode_literals, absolute_import, division
1275 from threading import Timer
1276 import datetime
1277
1278
1279=== modified file 'reahl-component/reahl/component_dev/migrationtests.py'
1280--- reahl-component/reahl/component_dev/migrationtests.py 2014-08-24 12:09:36 +0000
1281+++ reahl-component/reahl/component_dev/migrationtests.py 2014-09-04 15:41:33 +0000
1282@@ -1,4 +1,4 @@
1283-# Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1284+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1285 #
1286 # This file is part of Reahl.
1287 #
1288@@ -15,18 +15,34 @@
1289 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1290
1291
1292+<<<<<<< TREE
1293 from __future__ import unicode_literals
1294 from __future__ import print_function
1295
1296 import six
1297+=======
1298+from __future__ import print_function, unicode_literals, absolute_import, division
1299+
1300+import six
1301+>>>>>>> MERGE-SOURCE
1302 from contextlib import contextmanager
1303-
1304-from reahl.tofu import Fixture, test, vassert, expected, NoException
1305-from reahl.stubble import CallMonitor, EmptyStub
1306-
1307+<<<<<<< TREE
1308+
1309+from reahl.tofu import Fixture, test, vassert, expected, NoException
1310+from reahl.stubble import CallMonitor, EmptyStub
1311+
1312+=======
1313+import warnings
1314+import re
1315+
1316+from reahl.tofu import Fixture, test, vassert, expected, NoException
1317+from reahl.stubble import CallMonitor, EmptyStub
1318+
1319+>>>>>>> MERGE-SOURCE
1320
1321 from reahl.component.dbutils import ORMControl
1322 from reahl.component.eggs import ReahlEgg
1323+<<<<<<< TREE
1324 from reahl.component.migration import Migration, MigrationSchedule, MigrationRun
1325 from reahl.component.exceptions import ProgrammerError
1326
1327@@ -37,6 +53,19 @@
1328 # All the migrations are scheduled, then run for all the migrations to bring things up to each intermediate version.
1329
1330
1331+=======
1332+from reahl.component.migration import Migration, MigrationSchedule, MigrationRun
1333+from reahl.component.exceptions import ProgrammerError
1334+
1335+class stubclass(object):
1336+ def __init__(self, cls):
1337+ pass
1338+ def __call__(self, cls):
1339+ warnings.warn('This needs to become stubble.stubclass, but stubble does not deal with this scenario - it needs to be fixed')
1340+ return cls
1341+
1342+@stubclass(ReahlEgg)
1343+>>>>>>> MERGE-SOURCE
1344 class ReahlEggStub(ReahlEgg):
1345 def __init__(self, name, version, migrations):
1346 super(ReahlEggStub, self).__init__(None)
1347@@ -55,18 +84,32 @@
1348 def migrations_in_order(self):
1349 return self.migrations
1350
1351-
1352+<<<<<<< TREE
1353+
1354+=======
1355+
1356+@stubclass(ORMControl)
1357+>>>>>>> MERGE-SOURCE
1358 class ORMControlStub(ORMControl):
1359- created_schema_for = None
1360+<<<<<<< TREE
1361+ created_schema_for = None
1362+=======
1363+ created_schema_for = None
1364+
1365+>>>>>>> MERGE-SOURCE
1366 def __init__(self):
1367 self.versions = {}
1368+
1369 @contextmanager
1370 def managed_transaction(self):
1371 yield
1372+
1373 def update_schema_version_for(self, egg):
1374 self.versions[egg.name] = egg.version
1375- def schema_version_for(self, egg):
1376+
1377+ def schema_version_for(self, egg, default=None):
1378 return self.versions[egg.name]
1379+
1380 def initialise_schema_version_for(self, egg):
1381 self.versions[egg.name] = egg.version
1382 def set_currently_installed_version_for(self, egg, version_number):
1383@@ -74,12 +117,17 @@
1384 def create_db_tables(self, transaction, new_eggs):
1385 self.created_schema_for = new_eggs
1386
1387+ def set_currently_installed_version_for(self, egg, version_number):
1388+ self.versions[egg.name] = version_number
1389+
1390+
1391
1392 class MigrateFixture(Fixture):
1393 def new_orm_control(self):
1394 return ORMControlStub()
1395
1396
1397+<<<<<<< TREE
1398 @test(MigrateFixture)
1399 def how_migration_works(fixture):
1400 """Calls that will modify the database are scheduled in the schedule_upgrades() method of all
1401@@ -244,6 +292,188 @@
1402 migration_run = MigrationRun(fixture.orm_control, [egg])
1403 migration_run.execute_migrations()
1404 vassert( fixture.orm_control.schema_version_for(egg) == '2.0' )
1405+=======
1406+@test(MigrateFixture)
1407+def how_migration_works(fixture):
1408+ """Calls that will modify the database are scheduled in the schedule_upgrades() method of all
1409+ the applicable Migrations for a single migration run. `shedule_upgrades()` is called on each
1410+ migration in order of their versions. Once all calls are scheduled,
1411+ they are executed as scheduled.
1412+ """
1413+
1414+ class SomeObject(object):
1415+ calls_made = []
1416+ def do_something(self, arg):
1417+ self.calls_made.append(arg)
1418+ some_object = SomeObject()
1419+
1420+ class Migration1(Migration):
1421+ version = '2.0'
1422+ def schedule_upgrades(self):
1423+ self.schedule('drop_fk', some_object.do_something, 'drop_fk_1')
1424+ self.schedule('data', some_object.do_something, 'data_1')
1425+ self.schedule('drop_fk', some_object.do_something, 'drop_fk_2')
1426+
1427+ class Migration2(Migration):
1428+ version = '3.0'
1429+ def schedule_upgrades(self):
1430+ self.schedule('drop_fk', some_object.do_something, 'drop_fk_3')
1431+
1432+ egg = ReahlEggStub('my_egg', '4.0', [Migration1, Migration2])
1433+ fixture.orm_control.set_currently_installed_version_for(egg, '1.0')
1434+
1435+ fixture.orm_control.migrate_db([egg])
1436+
1437+ expected_order = ['drop_fk_1', 'drop_fk_2', 'drop_fk_3', 'data_1']
1438+ vassert( some_object.calls_made == expected_order )
1439+
1440+
1441+@test(MigrateFixture)
1442+def schedule_executes_in_order(fixture):
1443+ """A MigrationSchedule is used internally to schedule calls in different phases. The calls
1444+ scheduled in each phase are executed in the order the phases have been set up on the MigrationSchedule.
1445+ Within a phase, the calls are executed in the order they were registered in that phase.
1446+ """
1447+
1448+ schedule_names = ['a', 'b', 'c']
1449+ migration_schedule = MigrationSchedule(*schedule_names)
1450+
1451+ class SomeObject(object):
1452+ def do_something(self, arg):
1453+ pass
1454+ some_object = SomeObject()
1455+
1456+ #schedule calls not in registered order
1457+ with CallMonitor(some_object.do_something) as monitor:
1458+ migration_schedule.schedule('c', some_object.do_something, 'c1')
1459+ migration_schedule.schedule('a', some_object.do_something, 'a1')
1460+ migration_schedule.schedule('b', some_object.do_something, 'b')
1461+ migration_schedule.schedule('a', some_object.do_something, 'a2')
1462+ migration_schedule.schedule('c', some_object.do_something, 'c2')
1463+
1464+ migration_schedule.execute_all()
1465+
1466+ actual_order = [call.args[0] for call in monitor.calls]
1467+ expected_order = ['a1', 'a2', 'b', 'c1', 'c2']
1468+ vassert( actual_order == expected_order )
1469+
1470+
1471+@test(MigrateFixture)
1472+def schedule_executes_phases_with_parameters(fixture):
1473+ """When a MigrationSchedule executes the calls that were scheduled from a Migration,
1474+ the methods are actually called, and passed the correct arguments."""
1475+
1476+ class SomeObject(object):
1477+ def please_call_me(self, arg, kwarg=None):
1478+ pass
1479+ some_object = SomeObject()
1480+
1481+ migration_schedule = MigrationSchedule('phase_name')
1482+ migration = Migration(migration_schedule)
1483+
1484+ with CallMonitor(some_object.please_call_me) as monitor:
1485+ migration.schedule('phase_name', some_object.please_call_me, 'myarg', kwarg='mykwarg')
1486+
1487+ migration_schedule.execute_all()
1488+
1489+ vassert( monitor.calls[0].args == ('myarg',) )
1490+ vassert( monitor.calls[0].kwargs == dict(kwarg='mykwarg') )
1491+
1492+
1493+@test(MigrateFixture)
1494+def invalid_schedule_name_raises(fixture):
1495+ """A useful error is raised when an attempt is made to schedule a call in a phase that is not defined."""
1496+
1497+ valid_schedule_names = ['a', 'b']
1498+ migration_schedule = MigrationSchedule(*valid_schedule_names)
1499+
1500+ def check_exception(ex):
1501+ vassert( six.text_type(ex) == 'A phase with name<wrong_name> does not exist.' )
1502+
1503+ with expected(ProgrammerError, test=check_exception):
1504+ migration_schedule.schedule('wrong_name', None)
1505+
1506+
1507+@test(MigrateFixture)
1508+def version_dictates_execution_of_migration_(fixture):
1509+ """Each Migration should have a class attribute `version` that states which version of the component
1510+ it upgrades the database schema to. Only the Migrations with versions greater than the current
1511+ schema version are included in a MigrationRun for a given egg.
1512+ """
1513+
1514+ class PreviousVersionMigration(Migration):
1515+ version = '1.0'
1516+ class MatchingCurrentVersionMigration(Migration):
1517+ version = '2.0'
1518+ class NewerVersionMigration(Migration):
1519+ version = '3.0'
1520+ class EvenNewerVersionMigration(Migration):
1521+ version = '4.0'
1522+
1523+ egg = ReahlEggStub('my_egg', '4.0', [PreviousVersionMigration, MatchingCurrentVersionMigration,
1524+ NewerVersionMigration, EvenNewerVersionMigration])
1525+ fixture.orm_control.set_currently_installed_version_for(egg, '2.0')
1526+
1527+ migration_run = MigrationRun(fixture.orm_control, [egg])
1528+ migrations_to_run = migration_run.migrations_to_run_for(egg)
1529+ classes_to_run = [m.__class__ for m in migrations_to_run]
1530+ vassert( classes_to_run == [NewerVersionMigration, EvenNewerVersionMigration] )
1531+
1532+
1533+@test(MigrateFixture)
1534+def version_of_migration_not_set_error(fixture):
1535+ """If the version to which a Migration is applicable is not set, an error is raised."""
1536+ class TestMigration(Migration):
1537+ pass
1538+
1539+ egg = ReahlEggStub('my_egg', '1.0', [TestMigration])
1540+ fixture.orm_control.set_currently_installed_version_for(egg, '0.0')
1541+
1542+ def check_exception(ex):
1543+ vassert( re.match('Migration <class \'reahl\.component_dev\.migrationtests\..*TestMigration\'> does not have a version set', six.text_type(ex) ))
1544+
1545+ with expected(ProgrammerError, test=check_exception):
1546+ fixture.orm_control.migrate_db([egg])
1547+
1548+
1549+@test(MigrateFixture)
1550+def missing_schedule_upgrades_warns(fixture):
1551+ """If a programmer does not override schedule_upgrades, a warning is raised."""
1552+ class TestMigration(Migration):
1553+ pass
1554+
1555+ with warnings.catch_warnings(record=True) as raised_warnings:
1556+ warnings.simplefilter("always")
1557+
1558+ TestMigration(EmptyStub()).schedule_upgrades()
1559+
1560+ [warning] = raised_warnings
1561+ expected_message = 'Ignoring TestMigration.schedule_upgrades(): it does not override schedule_upgrades() (method name typo perhaps?)'
1562+ vassert( six.text_type(warning.message) == expected_message )
1563+
1564+
1565+@test(MigrateFixture)
1566+def available_migration_phases(fixture):
1567+ """These are the phases, and order of the phases in a MigrationRun."""
1568+
1569+ migration_run = MigrationRun(fixture.orm_control, [])
1570+
1571+ expected_order = ('drop_fk', 'drop_pk', 'pre_alter', 'alter', 'create_pk', 'indexes', 'data', 'create_fk', 'cleanup')
1572+ vassert( migration_run.changes.phases_in_order == expected_order )
1573+
1574+
1575+@test(MigrateFixture)
1576+def schema_version_housekeeping(fixture):
1577+ """The database keeps track of the schema for each installed component. After a migration run
1578+ the currently installed versions are updated.
1579+ """
1580+
1581+ egg = ReahlEggStub('my_egg', '2.0', [])
1582+ fixture.orm_control.set_currently_installed_version_for(egg, '1.0')
1583+ migration_run = MigrationRun(fixture.orm_control, [egg])
1584+ migration_run.execute_migrations()
1585+ vassert( fixture.orm_control.schema_version_for(egg) == '2.0' )
1586+>>>>>>> MERGE-SOURCE
1587
1588
1589
1590
1591=== modified file 'reahl-component/reahl/messages/__init__.py'
1592--- reahl-component/reahl/messages/__init__.py 2014-07-06 10:25:15 +0000
1593+++ reahl-component/reahl/messages/__init__.py 2014-09-04 15:41:33 +0000
1594@@ -1,4 +1,4 @@
1595-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1596+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1597 #
1598 # This file is part of Reahl.
1599 #
1600@@ -16,7 +16,6 @@
1601
1602 # -*- mode: python; mode: font-lock -*-
1603
1604-from __future__ import unicode_literals
1605-from __future__ import print_function
1606+from __future__ import print_function, unicode_literals, absolute_import, division
1607 __import__('pkg_resources').declare_namespace(__name__)
1608
1609
1610=== modified file 'reahl-component/reahl/messages/af/LC_MESSAGES/reahl-component.po'
1611--- reahl-component/reahl/messages/af/LC_MESSAGES/reahl-component.po 2014-08-23 17:45:01 +0000
1612+++ reahl-component/reahl/messages/af/LC_MESSAGES/reahl-component.po 2014-09-04 15:41:33 +0000
1613@@ -1,4 +1,4 @@
1614-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights
1615+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights
1616 # reserved.
1617 #
1618 # Afrikaans translations for reahl-component.
1619@@ -6,7 +6,11 @@
1620 msgstr ""
1621 "Project-Id-Version: reahl-component 2.0.0a1\n"
1622 "Report-Msgid-Bugs-To: info@reahl.org\n"
1623+<<<<<<< TREE
1624 "POT-Creation-Date: 2014-08-23 19:27+0200\n"
1625+=======
1626+"POT-Creation-Date: 2014-08-23 19:48+0200\n"
1627+>>>>>>> MERGE-SOURCE
1628 "PO-Revision-Date: 2012-04-13 08:38+0200\n"
1629 "Last-Translator: Iwan Vosloo <iwan@reahl.org>\n"
1630 "Language-Team: af <info@reahl.org>\n"
1631@@ -14,9 +18,13 @@
1632 "MIME-Version: 1.0\n"
1633 "Content-Type: text/plain; charset=utf-8\n"
1634 "Content-Transfer-Encoding: 8bit\n"
1635-"Generated-By: Babel 0.9.6\n"
1636+"Generated-By: Babel 1.3\n"
1637
1638+<<<<<<< TREE
1639 #: reahl/component/config.py:137
1640+=======
1641+#: reahl/component/config.py:138
1642+>>>>>>> MERGE-SOURCE
1643 msgid "MISSING!!"
1644 msgstr "NIE GESPESIFISEER!!"
1645
1646
1647=== modified file 'reahl-component/reahl/messages/reahl-component'
1648--- reahl-component/reahl/messages/reahl-component 2014-08-23 17:45:01 +0000
1649+++ reahl-component/reahl/messages/reahl-component 2014-09-04 15:41:33 +0000
1650@@ -7,18 +7,30 @@
1651 #, fuzzy
1652 msgid ""
1653 msgstr ""
1654+<<<<<<< TREE
1655 "Project-Id-Version: reahl-component 2.1.1\n"
1656+=======
1657+"Project-Id-Version: reahl-component 3.0\n"
1658+>>>>>>> MERGE-SOURCE
1659 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
1660+<<<<<<< TREE
1661 "POT-Creation-Date: 2014-08-23 19:27+0200\n"
1662+=======
1663+"POT-Creation-Date: 2014-08-23 19:48+0200\n"
1664+>>>>>>> MERGE-SOURCE
1665 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1666 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1667 "Language-Team: LANGUAGE <LL@li.org>\n"
1668 "MIME-Version: 1.0\n"
1669 "Content-Type: text/plain; charset=utf-8\n"
1670 "Content-Transfer-Encoding: 8bit\n"
1671-"Generated-By: Babel 0.9.6\n"
1672+"Generated-By: Babel 1.3\n"
1673
1674+<<<<<<< TREE
1675 #: reahl/component/config.py:137
1676+=======
1677+#: reahl/component/config.py:138
1678+>>>>>>> MERGE-SOURCE
1679 msgid "MISSING!!"
1680 msgstr ""
1681
1682
1683=== modified file 'reahl-dev/.reahlproject'
1684--- reahl-dev/.reahlproject 2014-03-04 07:34:43 +0000
1685+++ reahl-dev/.reahlproject 2014-09-04 15:41:33 +0000
1686@@ -7,7 +7,7 @@
1687 <egg name="reahl-component"/>
1688 <egg name="reahl-tofu"/>
1689 <egg name="reahl-bzrsupport"/>
1690- <thirdpartyegg name="Babel" minversion="0.9" maxversion="0.10"/>
1691+ <thirdpartyegg name="Babel" minversion="1.3" maxversion="1.3.9999"/>
1692 </deps>
1693
1694 <deps purpose="test">
1695
1696=== modified file 'reahl-dev/reahl/__init__.py'
1697--- reahl-dev/reahl/__init__.py 2014-07-06 10:25:15 +0000
1698+++ reahl-dev/reahl/__init__.py 2014-09-04 15:41:33 +0000
1699@@ -1,4 +1,4 @@
1700-# Copyright 2008, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1701+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1702 #
1703 # This file is part of Reahl.
1704 #
1705@@ -16,7 +16,6 @@
1706
1707 # -*- mode: python; mode: font-lock -*-
1708
1709-from __future__ import unicode_literals
1710-from __future__ import print_function
1711+from __future__ import print_function, unicode_literals, absolute_import, division
1712 __import__('pkg_resources').declare_namespace(__name__)
1713
1714
1715=== modified file 'reahl-dev/reahl/dev/__init__.py'
1716--- reahl-dev/reahl/dev/__init__.py 2014-07-05 10:41:49 +0000
1717+++ reahl-dev/reahl/dev/__init__.py 2014-09-04 15:41:33 +0000
1718@@ -1,4 +1,4 @@
1719-# Copyright 2009, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1720+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1721 #
1722 # This file is part of Reahl.
1723 #
1724@@ -16,8 +16,6 @@
1725
1726 """Tools used during development on Reahl projects.
1727
1728-from __future__ import unicode_literals
1729-from __future__ import print_function
1730-import six
1731 These tools are not deployed in a production environment, only in a development environment.
1732 """
1733+from __future__ import print_function, unicode_literals, absolute_import, division
1734
1735=== modified file 'reahl-dev/reahl/dev/devdomain.py'
1736--- reahl-dev/reahl/dev/devdomain.py 2014-07-26 08:39:42 +0000
1737+++ reahl-dev/reahl/dev/devdomain.py 2014-09-04 15:41:33 +0000
1738@@ -1,4 +1,4 @@
1739-# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1740+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1741 #
1742 # This file is part of Reahl.
1743 #
1744@@ -15,10 +15,10 @@
1745 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1746
1747 """This module houses the main classes used to understand and manipulate Reahl projects in development."""
1748-from __future__ import unicode_literals
1749-from __future__ import print_function
1750+from __future__ import print_function, unicode_literals, absolute_import, division
1751 import six
1752 import os
1753+import io
1754 import sys
1755 import glob
1756 import re
1757@@ -43,7 +43,7 @@
1758 from reahl.dev.xmlreader import XMLReader, TagNotRegisteredException
1759 from reahl.component.exceptions import ProgrammerError
1760 from reahl.component.eggs import ReahlEgg
1761-from reahl.component.py3compat import old_str
1762+from reahl.component.py3compat import ascii_as_bytes_or_str
1763
1764 from reahl.dev.exceptions import NoException, StatusException, AlreadyUploadedException, NotBuiltException, NotAValidProjectException, \
1765 InvalidProjectFileException, NotUploadedException, NotVersionedException, NotCheckedInException, \
1766@@ -199,7 +199,7 @@
1767 return os.path.join('debian', 'python-%s.install' % self.egg_project.project_name)
1768
1769 def generate(self):
1770- with open(self.filename, 'w') as out_file:
1771+ with io.open(self.filename, 'w') as out_file:
1772 out_file.write(os.path.join('debian', self.package_set.deb_base_name, self.egg_project.project_name, 'usr'))
1773 out_file.write(' /\n')
1774
1775@@ -248,12 +248,12 @@
1776 self.uploaded_project_ids = set()
1777 if not os.path.exists(self.upload_state_filename):
1778 return
1779- f = open(self.upload_state_filename, 'r')
1780+ f = io.open(self.upload_state_filename, 'r')
1781 self.uploaded_project_ids = set(f.read().splitlines())
1782 f.close()
1783
1784 def write(self):
1785- f = open(self.upload_state_filename, 'w')
1786+ f = io.open(self.upload_state_filename, 'w')
1787 f.writelines(['%s\n' % i for i in self.uploaded_project_ids])
1788 f.close()
1789
1790@@ -394,11 +394,11 @@
1791
1792 class LocalAptRepository(LocalRepository):
1793 def build_index_files(self):
1794- with open( os.path.join(self.root_directory, 'Packages'), 'w' ) as packages_file:
1795+ with io.open( os.path.join(self.root_directory, 'Packages'), 'w' ) as packages_file:
1796 Executable('apt-ftparchive').check_call(['packages', '.'], cwd=self.root_directory, stdout=packages_file)
1797
1798 path_name, directory_name = os.path.split(self.root_directory)
1799- with open( os.path.join(self.root_directory, 'Release'), 'w' ) as release_file:
1800+ with io.open( os.path.join(self.root_directory, 'Release'), 'w' ) as release_file:
1801 Executable('apt-ftparchive').check_call(['release', directory_name], cwd=path_name, stdout=release_file)
1802
1803 Executable('gpg').check_call(['-abs', '--yes', '-o', 'Release.gpg', 'Release'], cwd=self.root_directory)
1804@@ -523,7 +523,7 @@
1805 self.name = name
1806 self.ignore_version = ignore_version
1807 self.version = Version(version) if version else None
1808-
1809+
1810 @classmethod
1811 def get_xml_registration_info(cls):
1812 return ('egg', cls, None)
1813@@ -1135,7 +1135,7 @@
1814 self.filename = filename
1815
1816 def parse_heading_for(self, element):
1817- with open(self.filename) as changelog_file:
1818+ with io.open(self.filename) as changelog_file:
1819 for line in changelog_file:
1820 if line.strip():
1821 match = re.match(self.heading_regex, line)
1822@@ -1159,7 +1159,7 @@
1823 def stanzas(self):
1824 stanzas = []
1825 current_stanza = ''
1826- with open(self.filename) as control_file:
1827+ with io.open(self.filename) as control_file:
1828 for line in control_file:
1829 if not line.strip():
1830 if current_stanza:
1831@@ -1292,7 +1292,7 @@
1832 project_filename = os.path.join(directory, '.reahlproject')
1833 if not os.path.isfile(project_filename):
1834 raise NotAValidProjectException(project_filename)
1835- input_file = open(project_filename, 'r')
1836+ input_file = io.open(project_filename, 'r')
1837 try:
1838 reader = XMLReader()
1839 project = reader.read_file(input_file, (workspace, directory))
1840@@ -1611,7 +1611,7 @@
1841 sources = []
1842 sources_filename = os.path.join(self.egg_info_directory, 'SOURCES.txt')
1843
1844- with open(sources_filename) as in_file:
1845+ with io.open(sources_filename) as in_file:
1846 for line in in_file:
1847 sources.append(line)
1848 return sources
1849@@ -1651,7 +1651,7 @@
1850 extras_require=self.extras_require_for_setup() )
1851
1852 def generate_setup_py(self):
1853- with open(os.path.join(self.directory, 'setup.py'), 'w') as setup_file:
1854+ with io.open(os.path.join(self.directory, 'setup.py'), 'w') as setup_file:
1855 setup_file.write('from setuptools import setup\n')
1856 setup_file.write('setup(\n')
1857 setup_file.write(' name=%s,\n' % repr(self.project_name))
1858@@ -1701,13 +1701,13 @@
1859 return find_packages(where=self.directory, exclude=exclusions)
1860
1861 def namespace_packages_for_setup(self):
1862- return [old_str(i.name) for i in self.namespaces] # Note: this has to return non-six.text_type strings for setuptools!
1863+ return [ascii_as_bytes_or_str(i.name) for i in self.namespaces] # Note: this has to return non-six.text_type strings for setuptools!
1864
1865 def py_modules_for_setup(self):
1866 return list(set(['setup']+[i[1] for i in pkgutil.iter_modules('.') if not i[2]]))
1867
1868 def package_data_for_setup(self):
1869- return {old_str(''): [old_str('*/LC_MESSAGES/*.mo')]}
1870+ return {ascii_as_bytes_or_str(''): [ascii_as_bytes_or_str('*/LC_MESSAGES/*.mo')]}
1871
1872 @property
1873 def test_suite(self):
1874@@ -1871,7 +1871,7 @@
1875 return directories
1876
1877 def read(self, filename):
1878- f = open(filename, 'r')
1879+ f = io.open(filename, 'r')
1880 dirnames = f.read().splitlines()
1881 f.close()
1882 for name in dirnames:
1883@@ -1932,7 +1932,7 @@
1884 dirs[:] = [] # This prunes the tree so it does not walk deeper in here
1885
1886 def save(self, filename):
1887- f = open(filename, 'w')
1888+ f = io.open(filename, 'w')
1889 f.writelines(['%s\n' % i.relative_directory for i in self])
1890 f.close()
1891
1892@@ -1943,7 +1943,7 @@
1893 self[:] = []
1894 if not os.path.isfile(filename):
1895 return
1896- with open(filename, 'r') as f:
1897+ with io.open(filename, 'r') as f:
1898 project_dirs = f.read().splitlines()
1899 for name in project_dirs:
1900 full_dir = os.path.join(self.workspace.directory, name)
1901@@ -2108,7 +2108,7 @@
1902 if not os.path.isfile(self.filename):
1903 return
1904
1905- with open(self.filename) as f:
1906+ with io.open(self.filename) as f:
1907 for line in f:
1908 bits = line.strip().split('=')
1909 key = bits[0]
1910@@ -2116,7 +2116,7 @@
1911 self[key] = value
1912
1913 def write(self):
1914- with open(self.filename, 'w') as f:
1915+ with io.open(self.filename, 'w') as f:
1916 for key, value in self:
1917 f.write('%s=%s\n' % (key, value))
1918
1919
1920=== modified file 'reahl-dev/reahl/dev/devshell.py'
1921--- reahl-dev/reahl/dev/devshell.py 2014-07-06 10:25:15 +0000
1922+++ reahl-dev/reahl/dev/devshell.py 2014-09-04 15:41:33 +0000
1923@@ -1,4 +1,4 @@
1924-# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1925+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1926 #
1927 # This file is part of Reahl.
1928 #
1929@@ -15,10 +15,7 @@
1930 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1931
1932 """The module contains code to implement commands that can be issued from a commandline to manipulate Reahl projects."""
1933-from __future__ import unicode_literals
1934-from __future__ import with_statement
1935-
1936-from __future__ import print_function
1937+from __future__ import print_function, unicode_literals, absolute_import, division
1938 import six
1939 import sys
1940 import os
1941
1942=== modified file 'reahl-dev/reahl/dev/exceptions.py'
1943--- reahl-dev/reahl/dev/exceptions.py 2014-07-26 08:39:42 +0000
1944+++ reahl-dev/reahl/dev/exceptions.py 2014-09-04 15:41:33 +0000
1945@@ -1,4 +1,4 @@
1946-# Copyright 2009, 2010, 2011, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1947+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1948 #
1949 # This file is part of Reahl.
1950 #
1951@@ -16,8 +16,7 @@
1952
1953 """Exceptions used by modules in this package."""
1954
1955-from __future__ import unicode_literals
1956-from __future__ import print_function
1957+from __future__ import print_function, unicode_literals, absolute_import, division
1958 import inspect
1959
1960 class StatusException(Exception):
1961
1962=== modified file 'reahl-dev/reahl/dev/fixtures.py'
1963--- reahl-dev/reahl/dev/fixtures.py 2014-07-06 10:25:15 +0000
1964+++ reahl-dev/reahl/dev/fixtures.py 2014-09-04 15:41:33 +0000
1965@@ -1,4 +1,4 @@
1966-# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1967+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1968 #
1969 # This file is part of Reahl.
1970 #
1971@@ -17,8 +17,7 @@
1972 # Copyright (C) 2006 Reahl Software Services (Pty) Ltd. All rights reserved. (www.reahl.org)
1973
1974
1975-from __future__ import unicode_literals
1976-from __future__ import print_function
1977+from __future__ import print_function, unicode_literals, absolute_import, division
1978 from reahl.tofu import Fixture, set_up, tear_down
1979
1980 from reahl.component.context import ExecutionContext
1981
1982=== modified file 'reahl-dev/reahl/dev/mailtest.py'
1983--- reahl-dev/reahl/dev/mailtest.py 2014-07-06 10:25:15 +0000
1984+++ reahl-dev/reahl/dev/mailtest.py 2014-09-04 15:41:33 +0000
1985@@ -1,4 +1,4 @@
1986-# Copyright 2009, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
1987+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
1988 #
1989 # This file is part of Reahl.
1990 #
1991@@ -20,8 +20,7 @@
1992 Copyright (C) 2006 Reahl Software Services (Pty) Ltd. All rights reserved. (www.reahl.org)
1993
1994 """
1995-from __future__ import unicode_literals
1996-from __future__ import print_function
1997+from __future__ import print_function, unicode_literals, absolute_import, division
1998
1999 import asyncore
2000 import logging
2001
2002=== modified file 'reahl-dev/reahl/dev/tools.py'
2003--- reahl-dev/reahl/dev/tools.py 2014-07-06 10:25:15 +0000
2004+++ reahl-dev/reahl/dev/tools.py 2014-09-04 15:41:33 +0000
2005@@ -1,4 +1,4 @@
2006-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2007+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2008 #
2009 # This file is part of Reahl.
2010 #
2011@@ -15,8 +15,7 @@
2012 # along with this program. If not, see <http://www.gnu.org/licenses/>.
2013
2014
2015-from __future__ import unicode_literals
2016-from __future__ import print_function
2017+from __future__ import print_function, unicode_literals, absolute_import, division
2018 class EventTester(object):
2019 def __init__(self, event, **arguments):
2020 self.occurring_event = event.with_arguments(**arguments)
2021
2022=== modified file 'reahl-dev/reahl/dev/xmlreader.py'
2023--- reahl-dev/reahl/dev/xmlreader.py 2014-07-06 10:25:15 +0000
2024+++ reahl-dev/reahl/dev/xmlreader.py 2014-09-04 15:41:33 +0000
2025@@ -1,4 +1,4 @@
2026-# Copyright 2011, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2027+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2028 #
2029 # This file is part of Reahl.
2030 #
2031@@ -16,9 +16,6 @@
2032
2033 """A generic factory that can construct Python classes from XML.
2034
2035-from __future__ import unicode_literals
2036-from __future__ import print_function
2037-import six
2038 This package provides infrastructure that will read an XML file with
2039 clean, human readable XML and provide you with a bunch of classes that
2040 have been constructed and initialised according to the information in
2041@@ -96,6 +93,7 @@
2042
2043
2044 """
2045+from __future__ import print_function, unicode_literals, absolute_import, division
2046
2047 from xml.dom.minidom import parse
2048
2049
2050=== modified file 'reahl-dev/reahl/dev_dev/__init__.py'
2051--- reahl-dev/reahl/dev_dev/__init__.py 2013-12-05 14:13:07 +0000
2052+++ reahl-dev/reahl/dev_dev/__init__.py 2014-09-04 15:41:33 +0000
2053@@ -1,4 +1,4 @@
2054-# Copyright 2009, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2055+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2056 #
2057 # This file is part of Reahl.
2058 #
2059
2060=== modified file 'reahl-dev/reahl/dev_dev/domaintests.py'
2061--- reahl-dev/reahl/dev_dev/domaintests.py 2014-07-26 08:39:42 +0000
2062+++ reahl-dev/reahl/dev_dev/domaintests.py 2014-09-04 15:41:33 +0000
2063@@ -1,4 +1,4 @@
2064-# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2065+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2066 #
2067 # This file is part of Reahl.
2068 #
2069@@ -16,8 +16,7 @@
2070
2071 """Tests for the devdomain module."""
2072
2073-from __future__ import unicode_literals
2074-from __future__ import print_function
2075+from __future__ import print_function, unicode_literals, absolute_import, division
2076 import six
2077 import os
2078 import os.path
2079
2080=== modified file 'reahl-dev/reahl/dev_dev/xmlreadertests.py'
2081--- reahl-dev/reahl/dev_dev/xmlreadertests.py 2014-07-05 10:41:49 +0000
2082+++ reahl-dev/reahl/dev_dev/xmlreadertests.py 2014-09-04 15:41:33 +0000
2083@@ -1,4 +1,4 @@
2084-# Copyright 2011, 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2085+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2086 #
2087 # This file is part of Reahl.
2088 #
2089@@ -17,8 +17,7 @@
2090 # -*- mode: python; mode: font-lock -*-
2091 # Copyright 2005 Iwan Vosloo
2092
2093-from __future__ import unicode_literals
2094-from __future__ import print_function
2095+from __future__ import print_function, unicode_literals, absolute_import, division
2096 import six
2097 import time
2098
2099
2100=== modified file 'reahl-dev/reahl_dev.egg-info/PKG-INFO'
2101--- reahl-dev/reahl_dev.egg-info/PKG-INFO 2014-08-24 12:09:36 +0000
2102+++ reahl-dev/reahl_dev.egg-info/PKG-INFO 2014-09-04 15:41:33 +0000
2103@@ -1,6 +1,10 @@
2104 Metadata-Version: 1.0
2105 Name: reahl-dev
2106+<<<<<<< TREE
2107 Version: 2.1.2
2108+=======
2109+Version: 3.0
2110+>>>>>>> MERGE-SOURCE
2111 Summary: The core Reahl development tools.
2112 Home-page: http://www.reahl.org
2113 Author: Iwan Vosloo
2114
2115=== modified file 'reahl-dev/reahl_dev.egg-info/SOURCES.txt'
2116--- reahl-dev/reahl_dev.egg-info/SOURCES.txt 2014-08-24 13:32:16 +0000
2117+++ reahl-dev/reahl_dev.egg-info/SOURCES.txt 2014-09-04 15:41:33 +0000
2118@@ -18,7 +18,6 @@
2119 reahl/dev_dev/xmlreadertests.py
2120 reahl_dev.egg-info/PKG-INFO
2121 reahl_dev.egg-info/SOURCES.txt
2122-reahl_dev.egg-info/SOURCES.txt.~1~
2123 reahl_dev.egg-info/dependency_links.txt
2124 reahl_dev.egg-info/entry_points.txt
2125 reahl_dev.egg-info/namespace_packages.txt
2126
2127=== modified file 'reahl-dev/reahl_dev.egg-info/entry_points.txt'
2128--- reahl-dev/reahl_dev.egg-info/entry_points.txt 2013-12-12 08:39:26 +0000
2129+++ reahl-dev/reahl_dev.egg-info/entry_points.txt 2014-09-04 15:41:33 +0000
2130@@ -1,68 +1,68 @@
2131+[reahl.eggs]
2132+Egg = reahl.component.eggs:ReahlEgg
2133+
2134 [reahl.dev.xmlclasses]
2135-NamespaceList = reahl.dev.devdomain:NamespaceList
2136-DebianPackage = reahl.dev.devdomain:DebianPackage
2137-ScriptExport = reahl.dev.devdomain:ScriptExport
2138-BzrSourceControl = reahl.dev.devdomain:BzrSourceControl
2139-ExtraPath = reahl.dev.devdomain:ExtraPath
2140-ThirdpartyDependency = reahl.dev.devdomain:ThirdpartyDependency
2141-EntryPointExport = reahl.dev.devdomain:EntryPointExport
2142+AttachmentList = reahl.dev.devdomain:AttachmentList
2143+XMLDependencyList = reahl.dev.devdomain:XMLDependencyList
2144+ProjectTag = reahl.dev.devdomain:ProjectTag
2145 MigrationList = reahl.dev.devdomain:MigrationList
2146-NamespaceEntry = reahl.dev.devdomain:NamespaceEntry
2147-FileList = reahl.dev.devdomain:FileList
2148-MetaInfo = reahl.dev.devdomain:MetaInfo
2149-DebianPackageSet = reahl.dev.devdomain:DebianPackageSet
2150 ExcludedPackage = reahl.dev.devdomain:ExcludedPackage
2151-OrderedPersistedClass = reahl.dev.devdomain:OrderedPersistedClass
2152-TranslationPackage = reahl.dev.devdomain:TranslationPackage
2153-PersistedClassesList = reahl.dev.devdomain:PersistedClassesList
2154-PackageIndex = reahl.dev.devdomain:PackageIndex
2155+Dependency = reahl.dev.devdomain:Dependency
2156 SshRepository = reahl.dev.devdomain:SshRepository
2157-AttachmentList = reahl.dev.devdomain:AttachmentList
2158+BzrSourceControl = reahl.dev.devdomain:BzrSourceControl
2159+MetaInfo = reahl.dev.devdomain:MetaInfo
2160 Project = reahl.dev.devdomain:Project
2161-Dependency = reahl.dev.devdomain:Dependency
2162 CommandAlias = reahl.dev.devdomain:CommandAlias
2163+ScriptExport = reahl.dev.devdomain:ScriptExport
2164 ConfigurationSpec = reahl.dev.devdomain:ConfigurationSpec
2165 ExtrasList = reahl.dev.devdomain:ExtrasList
2166+TranslationPackage = reahl.dev.devdomain:TranslationPackage
2167+ScheduledJobSpec = reahl.dev.devdomain:ScheduledJobSpec
2168+HardcodedMetadata = reahl.dev.devdomain:HardcodedMetadata
2169+PersistedClassesList = reahl.dev.devdomain:PersistedClassesList
2170+DebianPackageSet = reahl.dev.devdomain:DebianPackageSet
2171+PythonSourcePackage = reahl.dev.devdomain:PythonSourcePackage
2172 EggProject = reahl.dev.devdomain:EggProject
2173-ProjectTag = reahl.dev.devdomain:ProjectTag
2174-HardcodedMetadata = reahl.dev.devdomain:HardcodedMetadata
2175+DebianPackageMetadata = reahl.dev.devdomain:DebianPackageMetadata
2176+NamespaceEntry = reahl.dev.devdomain:NamespaceEntry
2177+ThirdpartyDependency = reahl.dev.devdomain:ThirdpartyDependency
2178+DebianPackage = reahl.dev.devdomain:DebianPackage
2179+PackageIndex = reahl.dev.devdomain:PackageIndex
2180+ChickenProject = reahl.dev.devdomain:ChickenProject
2181+OrderedPersistedClass = reahl.dev.devdomain:OrderedPersistedClass
2182+ExtraPath = reahl.dev.devdomain:ExtraPath
2183 ShippedFile = reahl.dev.devdomain:ShippedFile
2184-XMLDependencyList = reahl.dev.devdomain:XMLDependencyList
2185-ChickenProject = reahl.dev.devdomain:ChickenProject
2186-DebianPackageMetadata = reahl.dev.devdomain:DebianPackageMetadata
2187-ScheduledJobSpec = reahl.dev.devdomain:ScheduledJobSpec
2188-PythonSourcePackage = reahl.dev.devdomain:PythonSourcePackage
2189+EntryPointExport = reahl.dev.devdomain:EntryPointExport
2190+NamespaceList = reahl.dev.devdomain:NamespaceList
2191+FileList = reahl.dev.devdomain:FileList
2192
2193 [console_scripts]
2194 reahl = reahl.dev.devshell:WorkspaceCommandline.execute_one
2195
2196-[reahl.eggs]
2197-Egg = reahl.component.eggs:ReahlEgg
2198-
2199 [reahl.dev.commands]
2200-DebInstall = reahl.dev.devshell:DebInstall
2201-MergeTranslations = reahl.dev.devshell:MergeTranslations
2202-AddLocale = reahl.dev.devshell:AddLocale
2203 SubstVars = reahl.dev.devshell:SubstVars
2204 Build = reahl.dev.devshell:Build
2205-Save = reahl.dev.devshell:Save
2206-Debianise = reahl.dev.devshell:Debianise
2207+DeleteSelection = reahl.dev.devshell:DeleteSelection
2208+UpdateAptRepository = reahl.dev.devshell:UpdateAptRepository
2209+ServeSMTP = reahl.dev.mailtest:ServeSMTP
2210 Shell = reahl.dev.devshell:Shell
2211 Read = reahl.dev.devshell:Read
2212-UpdateAptRepository = reahl.dev.devshell:UpdateAptRepository
2213+ListMissingDependencies = reahl.dev.devshell:ListMissingDependencies
2214+ExtractMessages = reahl.dev.devshell:ExtractMessages
2215+MergeTranslations = reahl.dev.devshell:MergeTranslations
2216+CompileTranslations = reahl.dev.devshell:CompileTranslations
2217+AddLocale = reahl.dev.devshell:AddLocale
2218+ExplainLegend = reahl.dev.devshell:ExplainLegend
2219+Setup = reahl.dev.devshell:Setup
2220 ListSelections = reahl.dev.devshell:ListSelections
2221 Info = reahl.dev.devshell:Info
2222+Debianise = reahl.dev.devshell:Debianise
2223 ClearSelection = reahl.dev.devshell:ClearSelection
2224-Setup = reahl.dev.devshell:Setup
2225-List = reahl.dev.devshell:List
2226-Upload = reahl.dev.devshell:Upload
2227 Refresh = reahl.dev.devshell:Refresh
2228-ExplainLegend = reahl.dev.devshell:ExplainLegend
2229+DebInstall = reahl.dev.devshell:DebInstall
2230+Save = reahl.dev.devshell:Save
2231 MarkReleased = reahl.dev.devshell:MarkReleased
2232-ExtractMessages = reahl.dev.devshell:ExtractMessages
2233-ListMissingDependencies = reahl.dev.devshell:ListMissingDependencies
2234-ServeSMTP = reahl.dev.mailtest:ServeSMTP
2235-DeleteSelection = reahl.dev.devshell:DeleteSelection
2236-CompileTranslations = reahl.dev.devshell:CompileTranslations
2237+List = reahl.dev.devshell:List
2238 Select = reahl.dev.devshell:Select
2239+Upload = reahl.dev.devshell:Upload
2240
2241
2242=== modified file 'reahl-dev/reahl_dev.egg-info/requires.txt'
2243--- reahl-dev/reahl_dev.egg-info/requires.txt 2014-04-21 09:33:22 +0000
2244+++ reahl-dev/reahl_dev.egg-info/requires.txt 2014-09-04 15:41:33 +0000
2245@@ -1,4 +1,4 @@
2246-reahl-component>=2.1,<2.2
2247-reahl-tofu>=2.1,<2.2
2248-reahl-bzrsupport>=2.1,<2.2
2249-Babel>=0.9,<0.10
2250\ No newline at end of file
2251+reahl-component>=3.0,<3.1
2252+reahl-tofu>=3.0,<3.1
2253+reahl-bzrsupport>=3.0,<3.1
2254+Babel>=1.3,<1.3.9999
2255\ No newline at end of file
2256
2257=== modified file 'reahl-doc/.reahlproject'
2258--- reahl-doc/.reahlproject 2014-08-05 14:00:06 +0000
2259+++ reahl-doc/.reahlproject 2014-09-04 15:41:33 +0000
2260@@ -10,7 +10,7 @@
2261 <egg name="reahl-web"/>
2262 <egg name="reahl-component"/>
2263 <egg name="reahl-sqlalchemysupport"/>
2264- <egg name="reahl-web-elixirimpl"/>
2265+ <egg name="reahl-web-declarative"/>
2266 <egg name="reahl-domain"/>
2267 <egg name="reahl-domainui"/>
2268 </deps>
2269@@ -42,12 +42,14 @@
2270 <class locator="reahl.doc.examples.tutorial.access1.access1:AddressBook"/>
2271 <class locator="reahl.doc.examples.tutorial.access1.access1:Collaborator"/>
2272 <class locator="reahl.doc.examples.tutorial.access1.access1:Address"/>
2273+
2274 <class locator="reahl.doc.examples.tutorial.access2.access2:AddressBook"/>
2275 <class locator="reahl.doc.examples.tutorial.access2.access2:Collaborator"/>
2276 <class locator="reahl.doc.examples.tutorial.access2.access2:Address"/>
2277 <class locator="reahl.doc.examples.tutorial.access.access:AddressBook"/>
2278 <class locator="reahl.doc.examples.tutorial.access.access:Collaborator"/>
2279 <class locator="reahl.doc.examples.tutorial.access.access:Address"/>
2280+
2281 <class locator="reahl.doc.examples.tutorial.i18nexample.i18nexample:Address"/>
2282 <class locator="reahl.doc.examples.tutorial.componentconfig.componentconfig:Address"/>
2283 <class locator="reahl.doc.examples.tutorial.migrationexample.migrationexample:Address"/>
2284
2285=== modified file 'reahl-doc/doc/component/index.rst'
2286--- reahl-doc/doc/component/index.rst 2013-12-05 14:13:07 +0000
2287+++ reahl-doc/doc/component/index.rst 2014-09-04 15:41:33 +0000
2288@@ -1,4 +1,4 @@
2289-.. Copyright 2011, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2290+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2291
2292 Component framework
2293 ===================
2294
2295=== modified file 'reahl-doc/doc/conf.py'
2296--- reahl-doc/doc/conf.py 2014-08-13 17:10:16 +0000
2297+++ reahl-doc/doc/conf.py 2014-09-04 15:41:33 +0000
2298@@ -1,4 +1,4 @@
2299-# Copyright 2011, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2300+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2301 #
2302 # This file is part of Reahl.
2303 #
2304@@ -17,8 +17,7 @@
2305 # -*- coding: utf-8 -*-
2306 #
2307
2308-from __future__ import unicode_literals
2309-from __future__ import print_function
2310+from __future__ import print_function, unicode_literals, absolute_import, division
2311 import six
2312 import sys, os, datetime
2313
2314
2315=== added file 'reahl-doc/doc/declarativemigration.rst'
2316--- reahl-doc/doc/declarativemigration.rst 1970-01-01 00:00:00 +0000
2317+++ reahl-doc/doc/declarativemigration.rst 2014-09-04 15:41:33 +0000
2318@@ -0,0 +1,49 @@
2319+.. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2320+
2321+Elixir to Declarative migration guide
2322+=====================================
2323+
2324+This guide is meant for those who opt to change older Elixir-based
2325+model classes to use SqlALchemy Declarative instead. If you go down
2326+this route, you will have to change your code to use Declarative and
2327+you may need some Migrations for your own code. SqlAlchemy and
2328+Declarative have excellent documentation to help users use
2329+Declarative. This guide explains what changed in the database, and how
2330+to migrate to cater for these changes.
2331+
2332+Reahl 3.0 also includes a class you can inherit your own Migrations
2333+from which includes a number of handy methods related to the Elixir ->
2334+Declarative migration.
2335+
2336+Summary of changes
2337+------------------
2338+
2339+ * The new SqlAlchemy provides a mechanism for dictating the naming
2340+ convention used to name database objects (constraints, etc). Using
2341+ this means the same conventions will be used across different
2342+ database backends -- something that will make migrations easier in
2343+ future. Reahl 3.0 now uses these conventions, and they differ from
2344+ names chosen automatically by PostgreSQL in the past.
2345+
2346+ This means that all of the following need to be dropped, and
2347+ recreated with their new names:
2348+ - primary keys
2349+ - foreign keys
2350+
2351+ * All our Elixir classes used joined table inheritance (where they did indeed inherit).
2352+ Perhaps yours do too... In this case, Elixir automatically created a column on the table
2353+ of a child class to refer to the table of the parent class. This column if a primary key
2354+ but is also a foreign key to the parent. It is also used for joins to implement polymorphism.
2355+
2356+ Elixir used to include the name of the parent in this column name, ie: party_id. In your
2357+ own code, you can stick to that convention to ease the migration. We opted to clean house
2358+ and rename all these just to 'id'.
2359+
2360+ * In the Elixir implementation, any object decorated with @session_scoped had
2361+ a column (acting as foreign key) added, named 'session_id'. The name of this column
2362+ was changed to 'user_session_id' for clarity.
2363+
2364+ For any @session_scoped classes, this column needs to be renamed, and its associated
2365+ foreign key constraint should be updated.
2366+
2367+ *
2368
2369=== modified file 'reahl-doc/doc/devtools/index.rst'
2370--- reahl-doc/doc/devtools/index.rst 2013-12-05 14:13:07 +0000
2371+++ reahl-doc/doc/devtools/index.rst 2014-09-04 15:41:33 +0000
2372@@ -1,4 +1,4 @@
2373-.. Copyright 2011, 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2374+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2375
2376 Development tools
2377 =================
2378
2379=== modified file 'reahl-doc/doc/devtools/stubble.rst'
2380--- reahl-doc/doc/devtools/stubble.rst 2013-12-05 14:13:07 +0000
2381+++ reahl-doc/doc/devtools/stubble.rst 2014-09-04 15:41:33 +0000
2382@@ -1,8 +1,9 @@
2383-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2384+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2385
2386 Stubble -- A collection of tools for writing stubs in unit tests (reahl.stubble)
2387 ================================================================================
2388
2389+
2390 Introduction
2391 ^^^^^^^^^^^^
2392
2393@@ -81,10 +82,10 @@
2394 b = 123
2395
2396 def foo(self, a):
2397- print 'i am the real foo'
2398+ print('i am the real foo')
2399
2400 def bar(self):
2401- print 'i am the real bar'
2402+ print('i am the real bar')
2403
2404
2405 Basic functionality
2406@@ -143,7 +144,7 @@
2407 class Stub(object):
2408 @exempt
2409 def my_own_method(self):
2410- print 'i am my own method'
2411+ print('i am my own method')
2412
2413
2414 Attributes
2415@@ -208,7 +209,7 @@
2416
2417 # (we just print out each class it finds...)
2418 for i in pkg_resources.iter_entry_points(group_name):
2419- print i.load()
2420+ print(i.load())
2421
2422
2423 Where you tear down test fixtures after a test run, you should clear
2424@@ -249,6 +250,7 @@
2425 -----------
2426
2427 .. autoclass:: reahl.stubble.intercept.CallMonitor
2428+ :inherited-members:
2429 :members:
2430
2431 MonitoredCall
2432@@ -261,6 +263,7 @@
2433 -----------
2434
2435 .. autoclass:: reahl.stubble.intercept.InitMonitor
2436+ :inherited-members:
2437 :members:
2438
2439 replaced
2440@@ -346,7 +349,7 @@
2441 shadowed = ['foo', 'aa']
2442
2443 def foo(self, a):
2444- print 'i am a fake foo'
2445+ print('i am a fake foo')
2446
2447
2448 And instance of it is then created like this::
2449
2450=== modified file 'reahl-doc/doc/domain/index.rst'
2451--- reahl-doc/doc/domain/index.rst 2013-12-05 14:13:07 +0000
2452+++ reahl-doc/doc/domain/index.rst 2014-09-04 15:41:33 +0000
2453@@ -1,4 +1,4 @@
2454-.. Copyright 2011, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2455+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2456
2457 Domain functionality
2458 ====================
2459
2460=== modified file 'reahl-doc/doc/domain/systemaccountui.rst'
2461--- reahl-doc/doc/domain/systemaccountui.rst 2014-04-18 11:34:16 +0000
2462+++ reahl-doc/doc/domain/systemaccountui.rst 2014-09-04 15:41:33 +0000
2463@@ -1,4 +1,4 @@
2464-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2465+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2466
2467 Module reahl.domainui.accounts
2468 ------------------------------
2469
2470=== modified file 'reahl-doc/doc/domain/workflowui.rst'
2471--- reahl-doc/doc/domain/workflowui.rst 2014-04-18 11:34:16 +0000
2472+++ reahl-doc/doc/domain/workflowui.rst 2014-09-04 15:41:33 +0000
2473@@ -1,4 +1,4 @@
2474-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2475+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2476
2477 Module reahl.domainui.workflow
2478 ------------------------------
2479
2480=== modified file 'reahl-doc/doc/features/accesscontrol.rst'
2481--- reahl-doc/doc/features/accesscontrol.rst 2014-04-10 11:32:33 +0000
2482+++ reahl-doc/doc/features/accesscontrol.rst 2014-09-04 15:41:33 +0000
2483@@ -1,4 +1,4 @@
2484-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2485+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2486
2487 Access control example
2488 ======================
2489
2490=== modified file 'reahl-doc/doc/features/enduserfunctionality.rst'
2491--- reahl-doc/doc/features/enduserfunctionality.rst 2014-08-12 13:56:25 +0000
2492+++ reahl-doc/doc/features/enduserfunctionality.rst 2014-09-04 15:41:33 +0000
2493@@ -1,4 +1,4 @@
2494-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2495+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2496
2497 Off-the-shelf functionality
2498 ===========================
2499
2500=== modified file 'reahl-doc/doc/features/i18n.rst'
2501--- reahl-doc/doc/features/i18n.rst 2014-04-10 11:32:33 +0000
2502+++ reahl-doc/doc/features/i18n.rst 2014-09-04 15:41:33 +0000
2503@@ -1,4 +1,4 @@
2504-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2505+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2506
2507 Internationalisation
2508 ====================
2509
2510=== modified file 'reahl-doc/doc/features/index.rst'
2511--- reahl-doc/doc/features/index.rst 2014-08-17 12:45:00 +0000
2512+++ reahl-doc/doc/features/index.rst 2014-09-04 15:41:33 +0000
2513@@ -1,4 +1,4 @@
2514-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2515+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2516
2517 ===============
2518 Reahl features
2519
2520=== modified file 'reahl-doc/doc/features/layout.rst'
2521--- reahl-doc/doc/features/layout.rst 2014-04-20 11:21:37 +0000
2522+++ reahl-doc/doc/features/layout.rst 2014-09-04 15:41:33 +0000
2523@@ -1,4 +1,4 @@
2524-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2525+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2526
2527 Layout example
2528 ==============
2529
2530=== modified file 'reahl-doc/doc/features/pageflow.png'
2531Binary files reahl-doc/doc/features/pageflow.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/features/pageflow.png 2014-09-04 15:41:33 +0000 differ
2532=== modified file 'reahl-doc/doc/features/pageflow.rst'
2533--- reahl-doc/doc/features/pageflow.rst 2014-04-20 11:21:37 +0000
2534+++ reahl-doc/doc/features/pageflow.rst 2014-09-04 15:41:33 +0000
2535@@ -1,4 +1,4 @@
2536-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2537+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2538
2539 Reacting to user events
2540 =======================
2541
2542=== modified file 'reahl-doc/doc/features/persistence.rst'
2543--- reahl-doc/doc/features/persistence.rst 2014-04-10 11:32:33 +0000
2544+++ reahl-doc/doc/features/persistence.rst 2014-09-04 15:41:33 +0000
2545@@ -1,4 +1,4 @@
2546-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2547+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2548
2549 Persistence
2550 ===========
2551
2552=== modified file 'reahl-doc/doc/features/security.rst'
2553--- reahl-doc/doc/features/security.rst 2013-12-05 14:13:07 +0000
2554+++ reahl-doc/doc/features/security.rst 2014-09-04 15:41:33 +0000
2555@@ -1,4 +1,4 @@
2556-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2557+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2558
2559 Security considerations
2560 =======================
2561
2562=== modified file 'reahl-doc/doc/features/tabbedpanel.rst'
2563--- reahl-doc/doc/features/tabbedpanel.rst 2014-04-18 14:00:05 +0000
2564+++ reahl-doc/doc/features/tabbedpanel.rst 2014-09-04 15:41:33 +0000
2565@@ -1,4 +1,4 @@
2566-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2567+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2568
2569 A tabbed panel example
2570 ======================
2571
2572=== modified file 'reahl-doc/doc/features/tools.rst'
2573--- reahl-doc/doc/features/tools.rst 2013-12-05 14:13:07 +0000
2574+++ reahl-doc/doc/features/tools.rst 2014-09-04 15:41:33 +0000
2575@@ -1,4 +1,4 @@
2576-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2577+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2578
2579 Tool support
2580 ============
2581
2582=== modified file 'reahl-doc/doc/features/validation.rst'
2583--- reahl-doc/doc/features/validation.rst 2014-04-10 11:32:33 +0000
2584+++ reahl-doc/doc/features/validation.rst 2014-09-04 15:41:33 +0000
2585@@ -1,4 +1,4 @@
2586-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2587+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2588
2589 Validating user input
2590 =====================
2591
2592=== modified file 'reahl-doc/doc/features/views.png'
2593Binary files reahl-doc/doc/features/views.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/features/views.png 2014-09-04 15:41:33 +0000 differ
2594=== modified file 'reahl-doc/doc/index.rst'
2595--- reahl-doc/doc/index.rst 2014-04-21 09:27:25 +0000
2596+++ reahl-doc/doc/index.rst 2014-09-04 15:41:33 +0000
2597@@ -1,4 +1,4 @@
2598-.. Copyright 2011, 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2599+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2600
2601 Reahl documentation
2602 ===================
2603
2604=== modified file 'reahl-doc/doc/overview.png'
2605Binary files reahl-doc/doc/overview.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/overview.png 2014-09-04 15:41:33 +0000 differ
2606=== modified file 'reahl-doc/doc/overview.rst'
2607--- reahl-doc/doc/overview.rst 2014-04-10 11:32:33 +0000
2608+++ reahl-doc/doc/overview.rst 2014-09-04 15:41:33 +0000
2609@@ -1,4 +1,4 @@
2610-.. Copyright 2011, 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2611+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2612
2613 Overview
2614 ========
2615@@ -61,8 +61,8 @@
2616 The core of the web framework is written such that it is independent
2617 of the technology used for object persistence. This core is in the
2618 `reahl-web` component. The web framework does use some objects that
2619-are persisted though -- an implementation of these using Elixir is
2620-provided in `reahl-web-elixirimpl`.
2621+are persisted though -- an implementation of these using SqlAlchemy's
2622+declarative is provided in `reahl-web-declarative`.
2623
2624 These components are discussed under :doc:`web/index`.
2625
2626
2627=== modified file 'reahl-doc/doc/overview.svg'
2628--- reahl-doc/doc/overview.svg 2013-12-05 14:13:07 +0000
2629+++ reahl-doc/doc/overview.svg 2014-09-04 15:41:33 +0000
2630@@ -13,7 +13,7 @@
2631 height="372.04724"
2632 id="svg2"
2633 version="1.1"
2634- inkscape:version="0.48.3.1 r9886"
2635+ inkscape:version="0.48.4 r9939"
2636 sodipodi:docname="overview.svg">
2637 <defs
2638 id="defs4" />
2639@@ -356,13 +356,13 @@
2640 <text
2641 xml:space="preserve"
2642 style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
2643- x="63.396584"
2644+ x="55.396584"
2645 y="779.86212"
2646 id="text3781-2-0-0"
2647 sodipodi:linespacing="125%"><tspan
2648 sodipodi:role="line"
2649 id="tspan3783-1-7-1"
2650- x="63.396584"
2651+ x="55.396584"
2652 y="779.86212">reahl-web</tspan></text>
2653 <rect
2654 style="fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:0.5, 0.5;stroke-dashoffset:0"
2655@@ -375,14 +375,14 @@
2656 <text
2657 xml:space="preserve"
2658 style="font-size:11px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
2659- x="63.396584"
2660+ x="55.396584"
2661 y="809.86218"
2662 id="text3781-2-9-7-1"
2663 sodipodi:linespacing="125%"><tspan
2664 sodipodi:role="line"
2665 id="tspan3783-1-9-6-5"
2666- x="63.396584"
2667- y="809.86218">reahl-web-elixirimpl</tspan></text>
2668+ x="55.396584"
2669+ y="809.86218">reahl-web-declarative</tspan></text>
2670 <text
2671 xml:space="preserve"
2672 style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:AlHor;-inkscape-font-specification:AlHor"
2673
2674=== modified file 'reahl-doc/doc/tutorial/accessapp.png'
2675Binary files reahl-doc/doc/tutorial/accessapp.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/tutorial/accessapp.png 2014-09-04 15:41:33 +0000 differ
2676=== modified file 'reahl-doc/doc/tutorial/accesscontrolinc2.rst'
2677--- reahl-doc/doc/tutorial/accesscontrolinc2.rst 2014-04-18 14:12:05 +0000
2678+++ reahl-doc/doc/tutorial/accesscontrolinc2.rst 2014-09-04 15:41:33 +0000
2679@@ -1,4 +1,4 @@
2680-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2681+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2682
2683 The user interface -- without access control
2684 ============================================
2685
2686=== modified file 'reahl-doc/doc/tutorial/accessmodel.png'
2687Binary files reahl-doc/doc/tutorial/accessmodel.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/tutorial/accessmodel.png 2014-09-04 15:41:33 +0000 differ
2688=== modified file 'reahl-doc/doc/tutorial/buttonwidgets.rst'
2689--- reahl-doc/doc/tutorial/buttonwidgets.rst 2014-06-29 16:29:48 +0000
2690+++ reahl-doc/doc/tutorial/buttonwidgets.rst 2014-09-04 15:41:33 +0000
2691@@ -1,4 +1,4 @@
2692-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2693+.. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2694
2695 Buttons allow users to act
2696 ==========================
2697
2698=== modified file 'reahl-doc/doc/tutorial/connectingviews.rst'
2699--- reahl-doc/doc/tutorial/connectingviews.rst 2014-04-19 09:02:25 +0000
2700+++ reahl-doc/doc/tutorial/connectingviews.rst 2014-09-04 15:41:33 +0000
2701@@ -1,4 +1,4 @@
2702-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2703+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2704
2705 Moving between Views
2706 ====================
2707
2708=== modified file 'reahl-doc/doc/tutorial/dependencyinjection.rst'
2709--- reahl-doc/doc/tutorial/dependencyinjection.rst 2013-12-05 14:13:07 +0000
2710+++ reahl-doc/doc/tutorial/dependencyinjection.rst 2014-09-04 15:41:33 +0000
2711@@ -1,13 +1,13 @@
2712-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2713+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2714
2715 Using a different persistence mechanism
2716 =======================================
2717
2718 The Reahl framework itself contains a few classes that need to be
2719-persisted to a database. For example, the :class:`~reahl.webelixirimpl.WebUserSession` is an object
2720+persisted to a database. For example, the :class:`~reahl.webdeclarative.webdeclarative.WebUserSession` is an object
2721 that represents the :class:`~reahl.systemaccountmodel.UserSession`, and is needed for all the :class:`~reahl.systemaccountmodel.UserSession`\ -related
2722 features explained in :doc:`sessions`. There is a handful of other
2723-classes that work in concert with the :class:`~reahl.webelixirimpl.WebUserSession`.
2724+classes that work in concert with the :class:`~reahl.webdeclarative.webdeclarative.WebUserSession`.
2725
2726 These persisted classes are written using a specific object
2727 persistence technology. The technology used throughout this tutorial
2728@@ -88,7 +88,7 @@
2729 As explained at the beginning of this section, the `reahl-web`
2730 component needs a number of classes that are provided by a different
2731 component. The Elixir-based implementation of these classes live in
2732-the `reahl-web-elixirimpl` component which in turn is written using
2733+the `reahl-web-declarative` component which in turn is written using
2734 the `reahl-domain` component. Diagramatically this is the scenario:
2735
2736 .. figure:: depinjection.png
2737@@ -96,9 +96,9 @@
2738 :width: 90%
2739
2740 Normally, `reahl-web` would merely import the classes it needs from
2741-`reahl-web-elixirimpl`, but that would make `reahl-web` dependent on
2742-`reahl-web-elixir` without any possibility to swap
2743-`reahl-web-elixirimpl` out for a different implementation. So,
2744+`reahl-web-declarative`, but that would make `reahl-web` dependent on
2745+`reahl-web-declarative` without any possibility to swap
2746+`reahl-web-declarative` out for a different implementation. So,
2747 instead, the `reahl-web` component discovers the actual classes it
2748 should use during run-time, when an application starts up. The
2749 mechanism used to do this is simply the configuration of `reahl-web`:
2750@@ -123,25 +123,25 @@
2751 Instead, there's a bit of a twist to the configuration mechanism to
2752 make it usable for this purpose without the need for users to write
2753 anything in a configuration file: One component can set parts of the
2754-configuration of another. Hence, the `reahl-web-elixirimpl` component
2755+configuration of another. Hence, the `reahl-web-declarative` component
2756 itself modifies the configuration of `reahl-web` to supply these
2757 special settings -- without any need for a user to configure anything.
2758
2759 A :class:`~reahl.component.config.Configuration` class can optionally have a method
2760 `.do_injections()`. This method is called after that configuration has
2761 been read. When called, it is passed the entire configuration of the
2762-system. The programmer of `reahl-web-elixirimpl` can thus write code
2763+system. The programmer of `reahl-web-declarative` can thus write code
2764 in this method to supply or change the configuration of any component
2765 that has been read by this time. To ensure that the configuration of
2766-`reahl-web` is read before that of `reahl-web-elixirimpl`,
2767-`reahl-web-elixirimpl` is declared to be dependent on `reahl-web` in
2768+`reahl-web` is read before that of `reahl-web-declarative`,
2769+`reahl-web-declarative` is declared to be dependent on `reahl-web` in
2770 its `.reahlproject` file (an **inverted dependency**).
2771
2772 Here is the :class:`~reahl.component.config.Configuration` of the
2773-`reahl-web-elixirimpl` component:
2774+`reahl-web-declarative` component:
2775
2776-.. literalinclude:: ../../../reahl-web-elixirimpl/reahl/webelixirimpl.py
2777- :pyobject: ElixirImplConfig
2778+.. literalinclude:: ../../../reahl-web-declarative/reahl/webdeclarative/webdeclarative.py
2779+ :pyobject: WebDeclarativeConfig
2780
2781 (The classes assigned here are defined higher up in the same file.)
2782
2783
2784=== modified file 'reahl-doc/doc/tutorial/depinjection.png'
2785Binary files reahl-doc/doc/tutorial/depinjection.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/tutorial/depinjection.png 2014-09-04 15:41:33 +0000 differ
2786=== modified file 'reahl-doc/doc/tutorial/depinjection.svg'
2787--- reahl-doc/doc/tutorial/depinjection.svg 2013-12-05 14:13:07 +0000
2788+++ reahl-doc/doc/tutorial/depinjection.svg 2014-09-04 15:41:33 +0000
2789@@ -222,7 +222,7 @@
2790 sodipodi:role="line"
2791 id="tspan3300"
2792 x="392.1449"
2793- y="85.674118">reahl-web-elixir-impl</tspan></text>
2794+ y="85.674118">reahl-web-declarative</tspan></text>
2795 <text
2796 xml:space="preserve"
2797 style="font-size:7.34066439px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
2798
2799=== modified file 'reahl-doc/doc/tutorial/deployment.rst'
2800--- reahl-doc/doc/tutorial/deployment.rst 2014-04-20 11:45:35 +0000
2801+++ reahl-doc/doc/tutorial/deployment.rst 2014-09-04 15:41:33 +0000
2802@@ -1,4 +1,4 @@
2803-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2804+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2805
2806 Deploying a production site
2807 ===========================
2808
2809=== modified file 'reahl-doc/doc/tutorial/exampleapp.rst'
2810--- reahl-doc/doc/tutorial/exampleapp.rst 2014-08-16 10:42:37 +0000
2811+++ reahl-doc/doc/tutorial/exampleapp.rst 2014-09-04 15:41:33 +0000
2812@@ -1,4 +1,4 @@
2813-.. Copyright 2012, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2814+.. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2815
2816 An application that actually does something
2817 ===========================================
2818
2819=== modified file 'reahl-doc/doc/tutorial/gettingstarted-develop.rst'
2820--- reahl-doc/doc/tutorial/gettingstarted-develop.rst 2014-08-28 08:23:41 +0000
2821+++ reahl-doc/doc/tutorial/gettingstarted-develop.rst 2014-09-04 15:41:33 +0000
2822@@ -1,4 +1,4 @@
2823-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2824+.. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2825
2826 Get developing with Reahl
2827 =========================
2828@@ -47,8 +47,8 @@
2829
2830 .. _create-component:
2831
2832-Creating a Reahl component
2833---------------------------
2834+Create a Reahl component
2835+------------------------
2836
2837 In Reahl, everything -- even your web application -- is a component
2838 (and, Reahl components are Python eggs). The very first thing to do in
2839@@ -72,13 +72,13 @@
2840 reahl-web
2841 The Reahl web framework itself.
2842
2843- reahl-web-elixirimpl
2844+ reahl-web-declarative
2845 An implementation of technology-dependent bits of Reahl, using
2846- using `SqlAlchemy <http://sqlalchemy.org>`_ and `Elixir <http://elixir.ematia.de/>`_.
2847+ using `SqlAlchemy <http://sqlalchemy.org>`__.
2848
2849 reahl-sqlalchemysupport
2850- The necessary glue for using `SqlAlchemy <http://www.sqlalchemy.org/>`_ (and
2851- `Elixir <http://elixir.ematia.de/trac/wiki>`_) with a Reahl program.
2852+ The necessary glue for using `SqlAlchemy <http://www.sqlalchemy.org/>`__
2853+ with a Reahl program.
2854
2855 The presence of the .reahlproject file in a directory alerts the
2856 `reahl` script (a tool used while in development) that the directory
2857@@ -95,14 +95,14 @@
2858 <egg name="reahl-component"/>
2859 <egg name="reahl-web"/>
2860 <egg name="reahl-sqlalchemysupport"/>
2861- <egg name="reahl-web-elixirimpl"/>
2862+ <egg name="reahl-web-declarative"/>
2863 </deps>
2864 </project>
2865
2866 .. _preparing-for-development:
2867
2868-Preparing for development
2869--------------------------
2870+Prepare the component for development
2871+-------------------------------------
2872
2873 Before you can do anything with a new component, you need to register
2874 it with your development environment. This is done by executing the
2875@@ -199,8 +199,8 @@
2876 reahl-control listconfig -h etc
2877
2878
2879-Preparing the database
2880-----------------------
2881+Prepare the database
2882+--------------------
2883
2884 The last step necessary before the web application can be started is to create a
2885 database for it. This is necessary for any web application because the
2886@@ -225,8 +225,8 @@
2887 to alert a user of such "dangerous" default config values.
2888
2889
2890-Running it
2891-----------
2892+Run it
2893+------
2894
2895 It is not necessary to install a web server in your development
2896 environment. To run your application just execute the following from
2897@@ -238,10 +238,12 @@
2898 and see a page which looks empty and is titled "Home".
2899
2900
2901-Checking out an example
2902------------------------
2903+Check out an example
2904+--------------------
2905
2906-You can get a local copy of this example by using the `reahl` script::
2907+Throughout the Reahl documentation (and this tutorial) examples are
2908+provided. You can get a local copy of *this* example by using the
2909+`reahl` script::
2910
2911 reahl example tutorial.hello
2912
2913
2914=== modified file 'reahl-doc/doc/tutorial/gettingstarted-install.rst'
2915--- reahl-doc/doc/tutorial/gettingstarted-install.rst 2014-08-19 06:23:54 +0000
2916+++ reahl-doc/doc/tutorial/gettingstarted-install.rst 2014-09-04 15:41:33 +0000
2917@@ -1,4 +1,4 @@
2918-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
2919+.. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
2920
2921 Reahl installation
2922 ==================
2923@@ -47,6 +47,12 @@
2924
2925 virtualenv ./reahl_env
2926
2927+.. note::
2928+
2929+ If you have more than one version of Python installed, also pass the `-p` argument
2930+ to virtualenv, specifying the path to the Python interpreter you want this
2931+ virtualenv for.
2932+
2933 On Windows, do (in a command shell):
2934
2935 .. code-block:: bash
2936@@ -74,6 +80,7 @@
2937 After activating your new environment, the prompt of the command line
2938 changes to reflect the environment that is currently active.
2939
2940+<<<<<<< TREE
2941 .. sidebar:: For interest's sake
2942
2943 Installing ``reahl[elixir,sqlite,dev,doc]`` results in an installation of
2944@@ -90,12 +97,18 @@
2945
2946 easy_install reahl[postgresql]
2947
2948+=======
2949+>>>>>>> MERGE-SOURCE
2950 With your `virtualenv` activated, Reahl can be installed into it by
2951 issuing:
2952
2953 .. code-block:: bash
2954
2955+<<<<<<< TREE
2956 easy_install reahl[elixir,sqlite,dev,doc]
2957+=======
2958+ easy_install reahl[declarative,sqlite,dev,doc]
2959+>>>>>>> MERGE-SOURCE
2960
2961 .. note::
2962
2963@@ -109,3 +122,39 @@
2964 properly for Python development <prep_install>` before you attempt to
2965 install Reahl.
2966
2967+Choose what to install
2968+----------------------
2969+
2970+Reahl is composed of a number of different components that you
2971+can mix and match depending on your requirements. For example,
2972+you probably do not want the development tools in a production
2973+environment, so they are packaged in a component you can omit.
2974+
2975+In order to specify which sets of components you want installed,
2976+you use keywords in square brackets behind `reahl` in the command
2977+to easy_install as shown above. Here is a list of keywords you can
2978+include, and what they install:
2979+
2980+ declarative
2981+ The declarative implementation of the web framework
2982+
2983+ dev
2984+ The development tools
2985+
2986+ doc
2987+ Documentation and examples
2988+
2989+ sqlite
2990+ Support for sqlite databases
2991+
2992+ postgresql
2993+ Support for postgresql databases
2994+
2995+ elixir
2996+ Support for the older Elixir-based implementation of
2997+ the web framework (uses some components from the 2.1
2998+ series, and only runs on Python 2.7)
2999+
3000+
3001+
3002+
3003
3004=== modified file 'reahl-doc/doc/tutorial/gettingstarted.rst'
3005--- reahl-doc/doc/tutorial/gettingstarted.rst 2014-08-19 06:23:54 +0000
3006+++ reahl-doc/doc/tutorial/gettingstarted.rst 2014-09-04 15:41:33 +0000
3007@@ -1,5 +1,10 @@
3008+<<<<<<< TREE
3009 .. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3010
3011+=======
3012+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3013+
3014+>>>>>>> MERGE-SOURCE
3015
3016 Getting started with Reahl
3017 ==========================
3018@@ -15,10 +20,8 @@
3019 - `virtualenv <http://pypi.python.org/pypi/virtualenv>`_
3020 - `distribute <http://pypi.python.org/pypi/distribute>`_
3021 - `nosetests <https://nose.readthedocs.org/en/latest/>`_
3022- - `SqlAlchemy <http://www.sqlalchemy.org/>`_
3023- - `Alembic <https://pypi.python.org/pypi/alembic/>`_; and
3024- - `Elixir <http://elixir.ematia.de/trac/wiki>`_ (optional, but used
3025- in the tutorial).
3026+ - `SqlAlchemy <http://www.sqlalchemy.org/>`_; and
3027+ - `Alembic <https://pypi.python.org/pypi/alembic/>`_.
3028
3029 There are also projects that are used almost totally behind the
3030 scenes. The most visible of these is a database back-end. For this
3031@@ -30,8 +33,13 @@
3032 Follow this guide to get Reahl installed in your development
3033 environment and to get a skeleton web application going.
3034
3035+<<<<<<< TREE
3036 This version of Reahl requires at least version 2.7 of Python. Check out
3037 Reahl 3.0 and later for Python 3 support.
3038+=======
3039+This version of Reahl requires version 2.7 of Python 2 or versions
3040+of Python greater than 3.3.
3041+>>>>>>> MERGE-SOURCE
3042
3043 We have split the guide into parts:
3044
3045
3046=== modified file 'reahl-doc/doc/tutorial/i18n.rst'
3047--- reahl-doc/doc/tutorial/i18n.rst 2014-04-18 14:12:05 +0000
3048+++ reahl-doc/doc/tutorial/i18n.rst 2014-09-04 15:41:33 +0000
3049@@ -1,4 +1,4 @@
3050-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3051+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3052
3053 Internationalised applications
3054 ==============================
3055
3056=== modified file 'reahl-doc/doc/tutorial/index.rst'
3057--- reahl-doc/doc/tutorial/index.rst 2014-06-29 16:29:48 +0000
3058+++ reahl-doc/doc/tutorial/index.rst 2014-09-04 15:41:33 +0000
3059@@ -1,4 +1,4 @@
3060-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3061+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3062
3063 Tutorial
3064 ========
3065
3066=== modified file 'reahl-doc/doc/tutorial/inputwidgets.rst'
3067--- reahl-doc/doc/tutorial/inputwidgets.rst 2014-06-29 16:29:48 +0000
3068+++ reahl-doc/doc/tutorial/inputwidgets.rst 2014-09-04 15:41:33 +0000
3069@@ -1,4 +1,4 @@
3070-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3071+.. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3072
3073 Getting input from a user
3074 =========================
3075@@ -68,8 +68,8 @@
3076 To augment our Address class with :class:`~reahl.component.modelinterface.Field`\ s, create a special method `fields()` on the class, and annotate it with the `@exposed` decorator. Such a method should take one argument: `fields` on which you can set each :class:`~reahl.component.modelinterface.Field` needed. Take care though -- each :class:`~reahl.component.modelinterface.Field` you create will eventually manipulate an attribute of the same name on instances of your class:
3077
3078 .. literalinclude:: ../../reahl/doc/examples/tutorial/addressbook2/addressbook2.py
3079- :prepend: class Address(elixir.Entity):
3080- :start-after: class Address(elixir.Entity):
3081+ :prepend: class Address(Base):
3082+ :start-after: class Address(Base):
3083 :end-before: def save(self):
3084
3085 The `@exposed` decorator turns your `fields()` method into a property
3086
3087=== modified file 'reahl-doc/doc/tutorial/install-ubuntu.rst'
3088--- reahl-doc/doc/tutorial/install-ubuntu.rst 2014-03-15 08:19:34 +0000
3089+++ reahl-doc/doc/tutorial/install-ubuntu.rst 2014-09-04 15:41:33 +0000
3090@@ -1,4 +1,4 @@
3091-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3092+.. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3093
3094 Preparing for installation on Ubuntu
3095 ====================================
3096
3097=== modified file 'reahl-doc/doc/tutorial/install-win.rst'
3098--- reahl-doc/doc/tutorial/install-win.rst 2014-04-03 19:06:57 +0000
3099+++ reahl-doc/doc/tutorial/install-win.rst 2014-09-04 15:41:33 +0000
3100@@ -19,7 +19,7 @@
3101
3102 Here is the super-short summary:
3103
3104-- Download Python 2.7 from `the official website <http://python.org/>`_, and install it.
3105+- Download Python from `the official website <http://python.org/>`_ (version 2.7 or 3.3), and install it.
3106 - Ensure that your path includes both the directory where the Python executable is located as well as Python's "Scripts" directory.
3107 - Install setuptools:
3108 - download `ez_setup.py <https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py>`_ from the setuptools project on bitbucket.
3109
3110=== modified file 'reahl-doc/doc/tutorial/loggingin.rst'
3111--- reahl-doc/doc/tutorial/loggingin.rst 2014-04-20 11:21:37 +0000
3112+++ reahl-doc/doc/tutorial/loggingin.rst 2014-09-04 15:41:33 +0000
3113@@ -1,4 +1,4 @@
3114-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3115+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3116
3117 Re-use: Allowing users to log in to your system
3118 ===============================================
3119
3120=== modified file 'reahl-doc/doc/tutorial/models.rst'
3121--- reahl-doc/doc/tutorial/models.rst 2014-06-29 16:29:48 +0000
3122+++ reahl-doc/doc/tutorial/models.rst 2014-09-04 15:41:33 +0000
3123@@ -1,4 +1,4 @@
3124-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3125+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3126
3127 A basic model
3128 =============
3129
3130=== modified file 'reahl-doc/doc/tutorial/owncomponent.rst'
3131--- reahl-doc/doc/tutorial/owncomponent.rst 2014-08-24 11:22:20 +0000
3132+++ reahl-doc/doc/tutorial/owncomponent.rst 2014-09-04 15:41:33 +0000
3133@@ -1,4 +1,4 @@
3134-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3135+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3136
3137 Developing your own component
3138 =============================
3139
3140=== modified file 'reahl-doc/doc/tutorial/ownwidget.rst'
3141--- reahl-doc/doc/tutorial/ownwidget.rst 2014-08-12 13:56:25 +0000
3142+++ reahl-doc/doc/tutorial/ownwidget.rst 2014-09-04 15:41:33 +0000
3143@@ -1,4 +1,4 @@
3144-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3145+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3146
3147 Developing your own Widgets
3148 ===========================
3149
3150=== modified file 'reahl-doc/doc/tutorial/parameterised.png'
3151Binary files reahl-doc/doc/tutorial/parameterised.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/tutorial/parameterised.png 2014-09-04 15:41:33 +0000 differ
3152=== modified file 'reahl-doc/doc/tutorial/parameterised.rst'
3153--- reahl-doc/doc/tutorial/parameterised.rst 2014-06-29 16:29:48 +0000
3154+++ reahl-doc/doc/tutorial/parameterised.rst 2014-09-04 15:41:33 +0000
3155@@ -1,4 +1,4 @@
3156-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3157+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3158
3159 Parameterised Views
3160 ====================
3161
3162=== modified file 'reahl-doc/doc/tutorial/persistence.rst'
3163--- reahl-doc/doc/tutorial/persistence.rst 2014-06-29 16:29:48 +0000
3164+++ reahl-doc/doc/tutorial/persistence.rst 2014-09-04 15:41:33 +0000
3165@@ -23,51 +23,55 @@
3166 to a database to avoid losing them. This is especially true for web
3167 applications.
3168
3169-Persisting a model using Elixir
3170--------------------------------
3171+Persisting a model using SqlAlchemy
3172+-----------------------------------
3173
3174+The problem of mapping Object Oriented models to relational databases
3175+is a considerable headache, but necessary if you want to work in
3176+an Object Oriented programming language like Python!
3177 Reahl does not implement persistence mechanisms by itself. That's a
3178 tough nut to crack. Besides there are cool tools for persisting
3179 objects in Python. Reahl merely provides some glue so these tools can
3180-be used easily. `SqlAlchemy <http://www.sqlalchemy.org/>`_ and its
3181-companion project, `Elixir <http://elixir.ematia.de/trac/wiki>`_ work
3182-in unison to deal with this persistence problem. If you are not
3183-familiar with these tools, please refer to their respective
3184-documentation.
3185+be used easily. `SqlAlchemy <http://www.sqlalchemy.org/>`_
3186+deals with this persistence problem.
3187
3188-Let's shift to a more real world model for an address book
3189-application. If Address instances can be persisted in a database,
3190-an AddressBook is not needed anymore. An AddressBook was merely the
3191-thing that held on to our Addresses and the database does the job
3192-just as well, if not better.
3193+Let's shift to a more real world model for an address book application
3194+that uses SqlAlchemy for persistence. If Address instances can be
3195+persisted in a database, an AddressBook is not needed anymore. An
3196+AddressBook was merely the thing that held on to our Addresses and the
3197+database does the job just as well, if not better.
3198
3199 That leaves a model consisting of a single class:
3200
3201 .. literalinclude:: ../../reahl/doc/examples/tutorial/modeltests2.py
3202- :lines: 3-4
3203+ :lines: 5-7
3204
3205 .. literalinclude:: ../../reahl/doc/examples/tutorial/modeltests2.py
3206 :pyobject: Address
3207
3208-This shows mostly Elixir/SqlAlchemy stuff (which you should be
3209-familiar with from reading up on those projects), with a little Reahl
3210-help. Notice that Session and metadata are imported from a Reahl
3211-package. These are provided for working with Elixir/SqlAlchemy in a
3212-Reahl program.
3213-
3214-Elixir needs to be told to use the Session and metadata provided by
3215-Reahl, and that's what the `using_options()` call is for.
3216-
3217-The call to `using_mapper_options()` is needed because by default any
3218-Elixir Entity is immediately saved to the database upon creation and
3219-that's not really what we want in this example. We want to be able to
3220-create an Address in memory, but will only save it to the database
3221-later on if the user decides to click on the "Save" button.
3222-
3223-Of course, the assignment of `elixir.Field` instances to
3224-`email_address` and `name` is how one instructs Elixir to persist
3225-these data items to the database for a particular Address
3226-instance (but you already knew that).
3227+This shows mostly SqlAlchemy stuff, with a little Reahl help. Notice
3228+that Session, Base and metadata are imported from a Reahl
3229+package. These are provided for working with SqlAlchemy in a Reahl
3230+program.
3231+
3232+A discussion of SqlAlchemy is outside the scope of this tutorial, but here
3233+are some pointers to readers unfamiliar with SqlAlchemy:
3234+
3235+In order to map Address to a relational database table, we use SqlALchemy's
3236+Declarative extension:
3237+
3238+ * __tablename__ states which relational table Address instances go into
3239+ * The assignment of `Column` instances to
3240+ `email_address` and `name` states that those attributes of Address
3241+ are to be inserted in similarly named columns on the relational database
3242+ that are defined as per the Columns stated.
3243+ * The id `Column` provides a unique identifier for each Address instance
3244+ (and is also its primary key in the database)
3245+ * To actually persist an Address instance to the database,
3246+ `Session.add()` is called.
3247+
3248+If you are not familiar with SqlAlchemy, please refer to its
3249+documentation: no short introduction can ever do it justice.
3250
3251 Exercising a persistent model
3252 -----------------------------
3253@@ -91,7 +95,7 @@
3254
3255 Have you noticed how the first few lines of the `test_model()`
3256 connects to the database, ensuring that its schema is created for
3257- the test run? That is all standard Elixir/SqlAlchemy without any
3258+ the test run? That is all standard SqlAlchemy without any
3259 Reahl influence.
3260
3261 In a complete Reahl program, none of this database housekeeping is
3262
3263=== modified file 'reahl-doc/doc/tutorial/sessions.png'
3264Binary files reahl-doc/doc/tutorial/sessions.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/tutorial/sessions.png 2014-09-04 15:41:33 +0000 differ
3265=== modified file 'reahl-doc/doc/tutorial/sessions.rst'
3266--- reahl-doc/doc/tutorial/sessions.rst 2014-06-29 16:29:48 +0000
3267+++ reahl-doc/doc/tutorial/sessions.rst 2014-09-04 15:41:33 +0000
3268@@ -1,4 +1,4 @@
3269-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3270+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3271
3272 The web session problem
3273 =======================
3274@@ -98,8 +98,7 @@
3275 onto the :class:`~reahl.systemaccountmodel.UserSession` so that it is discoverable for a particular
3276 :class:`~reahl.systemaccountmodel.UserSession`.
3277
3278-When using Elixir (as is done throughout the tutorial thus far),
3279-creating an Entity that has a `session scoped` lifetime is really
3280+When using SqlAlchemy, creating an object that has a `session scoped` lifetime is really
3281 easy: just use the `@session_scoped` class decorator:
3282
3283 .. literalinclude:: ../../reahl/doc/examples/tutorial/sessionscope/sessionscope.py
3284@@ -109,7 +108,7 @@
3285 The responsibility of a LoginSession starts by keeping track of who is
3286 logged in. That is why it has a `.current_user` attribute. Since
3287 LoginSession is a persisted object itself, it is trivial to make it
3288-hold onto another persisted object (User) via a ManyToOne relationship.
3289+hold onto another persisted object (User) via a relationship.
3290
3291 The other responsibility of the LoginSession is to actually log someone
3292 in. The logic of doing this is quite easily followed by looking at
3293
3294=== modified file 'reahl-doc/doc/tutorial/slots.rst'
3295--- reahl-doc/doc/tutorial/slots.rst 2014-04-20 11:45:35 +0000
3296+++ reahl-doc/doc/tutorial/slots.rst 2014-09-04 15:41:33 +0000
3297@@ -1,4 +1,4 @@
3298-.. Copyright 2013,2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3299+.. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3300
3301 Make light work of similar-looking pages
3302 ========================================
3303
3304=== modified file 'reahl-doc/doc/tutorial/styling.rst'
3305--- reahl-doc/doc/tutorial/styling.rst 2014-08-12 13:56:25 +0000
3306+++ reahl-doc/doc/tutorial/styling.rst 2014-09-04 15:41:33 +0000
3307@@ -1,4 +1,4 @@
3308-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3309+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3310
3311 Styling your application
3312 ========================
3313
3314=== modified file 'reahl-doc/doc/tutorial/testing.rst'
3315--- reahl-doc/doc/tutorial/testing.rst 2014-08-28 08:23:41 +0000
3316+++ reahl-doc/doc/tutorial/testing.rst 2014-09-04 15:41:33 +0000
3317@@ -1,4 +1,4 @@
3318-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3319+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3320
3321 Testing
3322 =======
3323
3324=== modified file 'reahl-doc/doc/tutorial/uibasics.rst'
3325--- reahl-doc/doc/tutorial/uibasics.rst 2014-08-12 13:56:25 +0000
3326+++ reahl-doc/doc/tutorial/uibasics.rst 2014-09-04 15:41:33 +0000
3327@@ -1,4 +1,4 @@
3328-.. Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3329+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3330
3331 User interface basics
3332 =====================
3333
3334=== modified file 'reahl-doc/doc/tutorial/views.png'
3335Binary files reahl-doc/doc/tutorial/views.png 2013-12-05 14:13:07 +0000 and reahl-doc/doc/tutorial/views.png 2014-09-04 15:41:33 +0000 differ
3336=== modified file 'reahl-doc/doc/web/dhtml.rst'
3337--- reahl-doc/doc/web/dhtml.rst 2014-04-18 11:36:58 +0000
3338+++ reahl-doc/doc/web/dhtml.rst 2014-09-04 15:41:33 +0000
3339@@ -1,4 +1,4 @@
3340-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3341+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3342
3343 Module reahl.web.dhtml
3344 -----------------------
3345
3346=== modified file 'reahl-doc/doc/web/fw.rst'
3347--- reahl-doc/doc/web/fw.rst 2014-04-18 12:56:21 +0000
3348+++ reahl-doc/doc/web/fw.rst 2014-09-04 15:41:33 +0000
3349@@ -1,4 +1,4 @@
3350-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3351+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3352
3353 Module reahl.web.fw
3354 -------------------
3355
3356=== modified file 'reahl-doc/doc/web/index.rst'
3357--- reahl-doc/doc/web/index.rst 2014-04-18 11:36:58 +0000
3358+++ reahl-doc/doc/web/index.rst 2014-09-04 15:41:33 +0000
3359@@ -1,4 +1,4 @@
3360-.. Copyright 2011, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3361+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3362
3363 Web framework
3364 =============
3365
3366=== modified file 'reahl-doc/doc/web/ui.rst'
3367--- reahl-doc/doc/web/ui.rst 2014-08-16 10:42:37 +0000
3368+++ reahl-doc/doc/web/ui.rst 2014-09-04 15:41:33 +0000
3369@@ -1,4 +1,4 @@
3370-.. Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3371+.. Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3372
3373 Module reahl.web.ui
3374 -------------------
3375
3376=== modified file 'reahl-doc/doc/whatchanged.rst'
3377--- reahl-doc/doc/whatchanged.rst 2014-08-24 18:58:10 +0000
3378+++ reahl-doc/doc/whatchanged.rst 2014-09-04 15:41:33 +0000
3379@@ -1,8 +1,9 @@
3380 .. Copyright 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3381
3382-What changed in version 2.1
3383+What changed in version 3.0
3384 ===========================
3385
3386+<<<<<<< TREE
3387 Based on some feedback from first users, changes were made to simplify
3388 the learning curve of getting to know Reahl. Backwards-compatibility
3389 remains, just in case...
3390@@ -60,3 +61,113 @@
3391 Deprecation warnings are now shown when running tests. Reahl's own deprecation warnings
3392 used to use the logging system, but are also now using Python's standard warnings module.
3393
3394+=======
3395+.. toctree::
3396+ :hidden:
3397+
3398+ declarativemigration
3399+
3400+Python 3 support
3401+----------------
3402+
3403+This version of Reahl runs on Python 3 (>= 3.3) as well on Python 2.7. In
3404+order to achieve this, some major changes were necessary.
3405+
3406+Updated dependencies
3407+--------------------
3408+
3409+Many of the versions of other packages Reahl 2.1 depends on do not
3410+support Python 3. Thus, almost all dependencies were upgraded to
3411+versions compatible with Python 3. Most of these should go unnoticed
3412+to users of Reahl, barring the exception discussed next.
3413+
3414+The minor upgrades are:
3415+
3416+ ================= ============= ========================
3417+ Name Old version New version
3418+ ================= ============= ========================
3419+ Babel 0.9 1.3
3420+ python-dateutil 1.5 2.2
3421+ docutils 0.8 0.12
3422+ psycopg2 2.4 2.5
3423+ alembic 0.5 0.6
3424+ lxml 3.2 3.3
3425+ WebTest 1.4 2.0
3426+ selenium 2.25 2.42
3427+ pillow 1.7.8 2.5
3428+ cssmin 0.1 0.2
3429+ BeautifulSoup 3.2 BeautifulSoup4 4.3
3430+ webob 3.2 4.3
3431+ ================= ============= ========================
3432+
3433+
3434+SqlAlchemy and Elixir/Declarative
3435+---------------------------------
3436+
3437+SqlAlchemy had to be upgraded from version 0.7 to 0.9. Unfortunately
3438+Elixir does not support these newer versions of SqlAlchemy, prompting
3439+us to implement the framework and all examples using `SqlAlchemy's declarative
3440+extension instead <http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/declarative.html>`_.
3441+
3442+This is a major change which is necessary to make Python 3 support possible.
3443+The switch from Elixir to Declarative impacts model code built on previous versions of Reahl,
3444+using Elixir.
3445+
3446+We provide two upgrade paths for users with code based on Elixir:
3447+
3448+ 1. Reahl 3.0 can be used in conjunction with a few components of
3449+ Reahl 2.1: the Elixir implementation itself, and its small number
3450+ of dependencies. Following this path means there are no code changes
3451+ on your part, but you have to stay on Python 2.7 yourself.
3452+
3453+ In order to follow this route, specify the elixir keyword to
3454+ easy_install when upgrading or installing reahl, eg::
3455+
3456+ easy_install reahl[web,elixir,sqlite] --upgrade
3457+
3458+ 2. Change your own code to use Declarative instead of Elixir. The
3459+ declarative implementation provided with Reahl 3.0 includes
3460+ migrations that change existing database schemas created by the
3461+ Elixir implementation to work with the current, Declarative
3462+ implementation. (This, of course, is necessary if you need to
3463+ preserve a running database through such changes.)
3464+
3465+.. note::
3466+
3467+ The Sqlite database does not support migration of existing data
3468+ very well, and as a result migration is only possible on PostgreSQL
3469+ databases.
3470+
3471+
3472+:doc:`Elixir to Declarative migration guide <declarativemigration>`
3473+-------------------------------------------------------------------
3474+
3475+For any of your own code that gets changed over from Elixir to
3476+Declarative, you will have to write migrations yourself.
3477+
3478+Please see the :doc:`declarativemigration` for details on how to do this,
3479+or discuss on `the mailing list <https://groups.google.com/forum/#!forum/reahl-discuss>`_.
3480+
3481+
3482+Moved modules
3483+-------------
3484+
3485+As a rule, a component named reahl-xxx would contain a package
3486+reahl.xxx, with possibly sub modules, such as reahl.xxx.yyy. For a
3487+small number of components, this is not true. Specifically,
3488+reahl-domain includes reahl.partymodel, reahl.workflowmodel and
3489+reahl.systemaccountmodel that do not fit this structure.
3490+
3491+In this version, these have been moved to reahl.domain.partymodel,
3492+reahl.domain.workflowmodel and reahl.domain.systemaccountmodel
3493+respectively. Older imports will continue to work for now, but
3494+will eventually be removed.
3495+
3496+Renamed attributes
3497+------------------
3498+
3499+Classes that are @session_scoped used to have an attribute 'session'. This has been renamed to 'user_session'.
3500+
3501+
3502+Previously, a Party always had a SystemAccount. It makes more sense to be able to have Party objects with or without SystemAccounts. Hence, the relationship was changed. Now, a Party does not have any knowledge of a SystemAccount, but a SystemAccount has an 'owner', which is a Party.
3503+>>>>>>> MERGE-SOURCE
3504
3505=== modified file 'reahl-doc/etc/componentconfig.config.py'
3506--- reahl-doc/etc/componentconfig.config.py 2014-07-06 10:25:15 +0000
3507+++ reahl-doc/etc/componentconfig.config.py 2014-09-04 15:41:33 +0000
3508@@ -1,3 +1,2 @@
3509-from __future__ import unicode_literals
3510-from __future__ import print_function
3511+from __future__ import print_function, unicode_literals, absolute_import, division
3512 componentconfig.showheader = True
3513
3514=== modified file 'reahl-doc/etc/reahl.config.py'
3515--- reahl-doc/etc/reahl.config.py 2013-12-05 14:13:07 +0000
3516+++ reahl-doc/etc/reahl.config.py 2014-09-04 15:41:33 +0000
3517@@ -1,4 +1,5 @@
3518-# Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3519+from __future__ import print_function, unicode_literals, absolute_import, division
3520+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3521 #
3522 # This file is part of Reahl.
3523 #
3524@@ -15,7 +16,7 @@
3525 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3526
3527
3528-#reahlsystem.connection_uri = 'postgres://rhug:rhug@localhost/rhug'
3529+reahlsystem.connection_uri = 'postgresql://rhug:rhug@localhost/rhug'
3530 #reahlsystem.connection_uri = 'sqlite:////tmp/hj.db'
3531 #reahlsystem.connection_uri = 'sqlite:///:memory:'
3532 #reahlsystem.debug = True
3533
3534=== modified file 'reahl-doc/etc/web.config.py'
3535--- reahl-doc/etc/web.config.py 2014-07-06 10:25:15 +0000
3536+++ reahl-doc/etc/web.config.py 2014-09-04 15:41:33 +0000
3537@@ -1,4 +1,4 @@
3538-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3539+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3540 #
3541 # This file is part of Reahl.
3542 #
3543@@ -14,8 +14,7 @@
3544 # You should have received a copy of the GNU Affero General Public License
3545 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3546
3547-from __future__ import unicode_literals
3548-from __future__ import print_function
3549+from __future__ import print_function, unicode_literals, absolute_import, division
3550 from reahl.web.fw import UserInterface
3551
3552 web.site_root = UserInterface
3553
3554=== modified file 'reahl-doc/reahl/__init__.py'
3555--- reahl-doc/reahl/__init__.py 2014-07-05 10:41:49 +0000
3556+++ reahl-doc/reahl/__init__.py 2014-09-04 15:41:33 +0000
3557@@ -1,4 +1,4 @@
3558-# Copyright 2006, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3559+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3560 #
3561 # This file is part of Reahl.
3562 #
3563@@ -25,8 +25,7 @@
3564
3565 """
3566
3567-from __future__ import unicode_literals
3568-from __future__ import print_function
3569+from __future__ import print_function, unicode_literals, absolute_import, division
3570
3571 __import__('pkg_resources').declare_namespace(__name__)
3572
3573
3574=== modified file 'reahl-doc/reahl/doc/basichtmlinputs-etc/reahl.config.py'
3575--- reahl-doc/reahl/doc/basichtmlinputs-etc/reahl.config.py 2014-07-06 10:25:15 +0000
3576+++ reahl-doc/reahl/doc/basichtmlinputs-etc/reahl.config.py 2014-09-04 15:41:33 +0000
3577@@ -1,4 +1,4 @@
3578-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3579+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3580 #
3581 # This file is part of Reahl.
3582 #
3583@@ -14,8 +14,7 @@
3584 # You should have received a copy of the GNU Affero General Public License
3585 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3586
3587-from __future__ import unicode_literals
3588-from __future__ import print_function
3589+from __future__ import print_function, unicode_literals, absolute_import, division
3590 reahlsystem.root_egg = 'reahl-doc'
3591 reahlsystem.debug = True
3592
3593
3594=== modified file 'reahl-doc/reahl/doc/basichtmlinputs-etc/web.config.py'
3595--- reahl-doc/reahl/doc/basichtmlinputs-etc/web.config.py 2014-07-06 10:25:15 +0000
3596+++ reahl-doc/reahl/doc/basichtmlinputs-etc/web.config.py 2014-09-04 15:41:33 +0000
3597@@ -1,4 +1,4 @@
3598-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3599+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3600 #
3601 # This file is part of Reahl.
3602 #
3603@@ -15,8 +15,7 @@
3604 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3605
3606
3607-from __future__ import unicode_literals
3608-from __future__ import print_function
3609+from __future__ import print_function, unicode_literals, absolute_import, division
3610 from reahl.doc.basichtmlinputs import BasicHTMLInputsUI
3611
3612 web.site_root = BasicHTMLInputsUI
3613
3614=== modified file 'reahl-doc/reahl/doc/basichtmlinputs.py'
3615--- reahl-doc/reahl/doc/basichtmlinputs.py 2014-07-06 10:25:15 +0000
3616+++ reahl-doc/reahl/doc/basichtmlinputs.py 2014-09-04 15:41:33 +0000
3617@@ -1,4 +1,4 @@
3618-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3619+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3620 #
3621 # This file is part of Reahl.
3622 #
3623@@ -15,8 +15,7 @@
3624 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3625
3626
3627-from __future__ import unicode_literals
3628-from __future__ import print_function
3629+from __future__ import print_function, unicode_literals, absolute_import, division
3630 from reahl.web.fw import UserInterface
3631 from reahl.web.ui import TwoColumnPage, Panel, Form, TextInput, Button, Form, \
3632 LabelOverInput, CueInput, CheckboxInput, TextInput, \
3633
3634=== modified file 'reahl-doc/reahl/doc/basichtmlwidgets-etc/reahl.config.py'
3635--- reahl-doc/reahl/doc/basichtmlwidgets-etc/reahl.config.py 2014-07-06 10:25:15 +0000
3636+++ reahl-doc/reahl/doc/basichtmlwidgets-etc/reahl.config.py 2014-09-04 15:41:33 +0000
3637@@ -1,4 +1,4 @@
3638-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3639+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3640 #
3641 # This file is part of Reahl.
3642 #
3643@@ -14,8 +14,7 @@
3644 # You should have received a copy of the GNU Affero General Public License
3645 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3646
3647-from __future__ import unicode_literals
3648-from __future__ import print_function
3649+from __future__ import print_function, unicode_literals, absolute_import, division
3650 reahlsystem.root_egg = 'reahl-doc'
3651
3652
3653
3654=== modified file 'reahl-doc/reahl/doc/basichtmlwidgets-etc/web.config.py'
3655--- reahl-doc/reahl/doc/basichtmlwidgets-etc/web.config.py 2014-07-06 10:25:15 +0000
3656+++ reahl-doc/reahl/doc/basichtmlwidgets-etc/web.config.py 2014-09-04 15:41:33 +0000
3657@@ -1,4 +1,4 @@
3658-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3659+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3660 #
3661 # This file is part of Reahl.
3662 #
3663@@ -15,8 +15,7 @@
3664 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3665
3666
3667-from __future__ import unicode_literals
3668-from __future__ import print_function
3669+from __future__ import print_function, unicode_literals, absolute_import, division
3670 from reahl.doc.basichtmlwidgets import BasicHTMLWidgetsUI
3671
3672 web.site_root = BasicHTMLWidgetsUI
3673
3674=== modified file 'reahl-doc/reahl/doc/basichtmlwidgets.py'
3675--- reahl-doc/reahl/doc/basichtmlwidgets.py 2014-07-06 10:25:15 +0000
3676+++ reahl-doc/reahl/doc/basichtmlwidgets.py 2014-09-04 15:41:33 +0000
3677@@ -1,4 +1,4 @@
3678-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3679+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3680 #
3681 # This file is part of Reahl.
3682 #
3683@@ -15,8 +15,7 @@
3684 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3685
3686
3687-from __future__ import unicode_literals
3688-from __future__ import print_function
3689+from __future__ import print_function, unicode_literals, absolute_import, division
3690 from reahl.web.fw import UserInterface
3691 from reahl.web.ui import TwoColumnPage, Panel, P
3692
3693
3694=== modified file 'reahl-doc/reahl/doc/commands.py'
3695--- reahl-doc/reahl/doc/commands.py 2014-07-31 09:51:28 +0000
3696+++ reahl-doc/reahl/doc/commands.py 2014-09-04 15:41:33 +0000
3697@@ -1,4 +1,4 @@
3698-# Copyright 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3699+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3700 #
3701 # This file is part of Reahl.
3702 #
3703@@ -15,8 +15,7 @@
3704 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3705
3706
3707-from __future__ import unicode_literals
3708-from __future__ import print_function
3709+from __future__ import print_function, unicode_literals, absolute_import, division
3710 import os
3711 import shutil
3712 import pkg_resources
3713
3714=== modified file 'reahl-doc/reahl/doc/examples/features/access/.reahlproject'
3715--- reahl-doc/reahl/doc/examples/features/access/.reahlproject 2013-12-05 14:13:07 +0000
3716+++ reahl-doc/reahl/doc/examples/features/access/.reahlproject 2014-09-04 15:41:33 +0000
3717@@ -3,7 +3,7 @@
3718 <egg name="reahl-web"/>
3719 <egg name="reahl-component"/>
3720 <egg name="reahl-sqlalchemysupport"/>
3721- <egg name="reahl-web-elixirimpl"/>
3722+ <egg name="reahl-web-declarative"/>
3723 </deps>
3724
3725 <deps purpose="test">
3726
3727=== modified file 'reahl-doc/reahl/doc/examples/features/access/access.py'
3728--- reahl-doc/reahl/doc/examples/features/access/access.py 2014-07-06 10:25:15 +0000
3729+++ reahl-doc/reahl/doc/examples/features/access/access.py 2014-09-04 15:41:33 +0000
3730@@ -1,7 +1,6 @@
3731
3732
3733-from __future__ import unicode_literals
3734-from __future__ import print_function
3735+from __future__ import print_function, unicode_literals, absolute_import, division
3736 from reahl.web.fw import UserInterface
3737 from reahl.web.ui import TwoColumnPage, Form, TextInput, Button, LabelledBlockInput
3738 from reahl.component.modelinterface import Action
3739
3740=== modified file 'reahl-doc/reahl/doc/examples/features/access/etc/web.config.py'
3741--- reahl-doc/reahl/doc/examples/features/access/etc/web.config.py 2014-07-06 10:25:15 +0000
3742+++ reahl-doc/reahl/doc/examples/features/access/etc/web.config.py 2014-09-04 15:41:33 +0000
3743@@ -1,6 +1,5 @@
3744
3745-from __future__ import unicode_literals
3746-from __future__ import print_function
3747+from __future__ import print_function, unicode_literals, absolute_import, division
3748 from reahl.doc.examples.features.access.access import AccessUI
3749
3750 web.site_root = AccessUI
3751
3752=== modified file 'reahl-doc/reahl/doc/examples/features/i18nexample/.reahlproject'
3753--- reahl-doc/reahl/doc/examples/features/i18nexample/.reahlproject 2013-12-05 14:13:07 +0000
3754+++ reahl-doc/reahl/doc/examples/features/i18nexample/.reahlproject 2014-09-04 15:41:33 +0000
3755@@ -2,7 +2,7 @@
3756 <deps purpose="run">
3757 <egg name="reahl-web"/>
3758 <egg name="reahl-component"/>
3759- <egg name="reahl-web-elixirimpl"/>
3760+ <egg name="reahl-web-declarative"/>
3761 <egg name="reahl-doc"/>
3762 </deps>
3763
3764
3765=== modified file 'reahl-doc/reahl/doc/examples/features/i18nexample/etc/web.config.py'
3766--- reahl-doc/reahl/doc/examples/features/i18nexample/etc/web.config.py 2014-07-06 10:25:15 +0000
3767+++ reahl-doc/reahl/doc/examples/features/i18nexample/etc/web.config.py 2014-09-04 15:41:33 +0000
3768@@ -1,6 +1,5 @@
3769
3770-from __future__ import unicode_literals
3771-from __future__ import print_function
3772+from __future__ import print_function, unicode_literals, absolute_import, division
3773 from reahl.doc.examples.features.i18nexample.i18nexample import TranslatedUI
3774
3775 web.site_root = TranslatedUI
3776
3777=== modified file 'reahl-doc/reahl/doc/examples/features/i18nexample/i18nexample.py'
3778--- reahl-doc/reahl/doc/examples/features/i18nexample/i18nexample.py 2014-07-06 10:25:15 +0000
3779+++ reahl-doc/reahl/doc/examples/features/i18nexample/i18nexample.py 2014-09-04 15:41:33 +0000
3780@@ -1,6 +1,5 @@
3781
3782-from __future__ import unicode_literals
3783-from __future__ import print_function
3784+from __future__ import print_function, unicode_literals, absolute_import, division
3785 from reahl.web.fw import UserInterface, Url, UserInterface
3786 from reahl.web.ui import HMenu
3787 from reahl.web.ui import P
3788
3789=== modified file 'reahl-doc/reahl/doc/examples/features/layout/.reahlproject'
3790--- reahl-doc/reahl/doc/examples/features/layout/.reahlproject 2013-12-05 14:13:07 +0000
3791+++ reahl-doc/reahl/doc/examples/features/layout/.reahlproject 2014-09-04 15:41:33 +0000
3792@@ -2,7 +2,7 @@
3793 <deps purpose="run">
3794 <egg name="reahl-web"/>
3795 <egg name="reahl-component"/>
3796- <egg name="reahl-web-elixirimpl"/>
3797+ <egg name="reahl-web-declarative"/>
3798 </deps>
3799
3800 <deps purpose="test">
3801
3802=== modified file 'reahl-doc/reahl/doc/examples/features/layout/etc/web.config.py'
3803--- reahl-doc/reahl/doc/examples/features/layout/etc/web.config.py 2014-07-06 10:25:15 +0000
3804+++ reahl-doc/reahl/doc/examples/features/layout/etc/web.config.py 2014-09-04 15:41:33 +0000
3805@@ -1,4 +1,4 @@
3806-# Copyright 2012, 2013 Reahl Software Services (Pty) Ltd. All rights reserved.
3807+# Copyright 2013, 2014 Reahl Software Services (Pty) Ltd. All rights reserved.
3808 #
3809 # This file is part of Reahl.
3810 #
3811@@ -15,8 +15,7 @@
3812 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3813
3814
3815-from __future__ import unicode_literals
3816-from __future__ import print_function
3817+from __future__ import print_function, unicode_literals, absolute_import, division
3818 from reahl.doc.examples.features.layout.layout import LayoutUI
3819
3820 web.site_root = LayoutUI
3821
3822=== modified file 'reahl-doc/reahl/doc/examples/features/layout/layout.py'
3823--- reahl-doc/reahl/doc/examples/features/layout/layout.py 2014-07-06 10:25:15 +0000
3824+++ reahl-doc/reahl/doc/examples/features/layout/layout.py 2014-09-04 15:41:33 +0000
3825@@ -1,6 +1,5 @@
3826
3827-from __future__ import unicode_literals
3828-from __future__ import print_function
3829+from __future__ import print_function, unicode_literals, absolute_import, division
3830 from reahl.web.fw import UserInterface
3831 from reahl.web.ui import TwoColumnPage, Form, TextInput, LabelledBlockInput, P, YuiGrid, YuiUnit
3832 from reahl.component.modelinterface import exposed, Field, EmailField
3833
3834=== modified file 'reahl-doc/reahl/doc/examples/features/pageflow/.reahlproject'
3835--- reahl-doc/reahl/doc/examples/features/pageflow/.reahlproject 2013-12-05 14:13:07 +0000
3836+++ reahl-doc/reahl/doc/examples/features/pageflow/.reahlproject 2014-09-04 15:41:33 +0000
3837@@ -2,7 +2,7 @@
3838 <deps purpose="run">
3839 <egg name="reahl-web"/>
3840 <egg name="reahl-component"/>
3841- <egg name="reahl-web-elixirimpl"/>
3842+ <egg name="reahl-web-declarative"/>
3843 </deps>
3844
3845 <deps purpose="test">
3846
3847=== modified file 'reahl-doc/reahl/doc/examples/features/pageflow/etc/web.config.py'
3848--- reahl-doc/reahl/doc/examples/features/pageflow/etc/web.config.py 2014-07-06 10:25:15 +0000
3849+++ reahl-doc/reahl/doc/examples/features/pageflow/etc/web.config.py 2014-09-04 15:41:33 +0000
3850@@ -1,6 +1,5 @@
3851
3852-from __future__ import unicode_literals
3853-from __future__ import print_function
3854+from __future__ import print_function, unicode_literals, absolute_import, division
3855 from reahl.doc.examples.features.pageflow.pageflow import PageFlowUI
3856
3857 web.site_root = PageFlowUI
3858
3859=== modified file 'reahl-doc/reahl/doc/examples/features/pageflow/pageflow.py'
3860--- reahl-doc/reahl/doc/examples/features/pageflow/pageflow.py 2014-07-06 10:25:15 +0000
3861+++ reahl-doc/reahl/doc/examples/features/pageflow/pageflow.py 2014-09-04 15:41:33 +0000
3862@@ -1,6 +1,5 @@
3863
3864-from __future__ import unicode_literals
3865-from __future__ import print_function
3866+from __future__ import print_function, unicode_literals, absolute_import, division
3867 from reahl.web.fw import UserInterface
3868 from reahl.web.ui import Button
3869 from reahl.web.ui import Form
3870
3871=== modified file 'reahl-doc/reahl/doc/examples/features/persistence/.reahlproject'
3872--- reahl-doc/reahl/doc/examples/features/persistence/.reahlproject 2013-12-05 14:13:07 +0000
3873+++ reahl-doc/reahl/doc/examples/features/persistence/.reahlproject 2014-09-04 15:41:33 +0000
3874@@ -3,7 +3,7 @@
3875 <egg name="reahl-web"/>
3876 <egg name="reahl-component"/>
3877 <egg name="reahl-sqlalchemysupport"/>
3878- <egg name="reahl-web-elixirimpl"/>
3879+ <egg name="reahl-web-declarative"/>
3880 </deps>
3881
3882 <deps purpose="test">
3883
3884=== modified file 'reahl-doc/reahl/doc/examples/features/persistence/etc/web.config.py'
3885--- reahl-doc/reahl/doc/examples/features/persistence/etc/web.config.py 2014-07-06 10:25:15 +0000
3886+++ reahl-doc/reahl/doc/examples/features/persistence/etc/web.config.py 2014-09-04 15:41:33 +0000
3887@@ -1,6 +1,5 @@
3888
3889-from __future__ import unicode_literals
3890-from __future__ import print_function
3891+from __future__ import print_function, unicode_literals, absolute_import, division
3892 from reahl.doc.examples.features.persistence.persistence import PersistenceUI
3893
3894 web.site_root = PersistenceUI
3895
3896=== modified file 'reahl-doc/reahl/doc/examples/features/persistence/persistence.py'
3897--- reahl-doc/reahl/doc/examples/features/persistence/persistence.py 2014-07-06 10:25:15 +0000
3898+++ reahl-doc/reahl/doc/examples/features/persistence/persistence.py 2014-09-04 15:41:33 +0000
3899@@ -1,9 +1,8 @@
3900
3901-from __future__ import unicode_literals
3902-from __future__ import print_function
3903-import elixir
3904+from __future__ import print_function, unicode_literals, absolute_import, division
3905
3906-from reahl.sqlalchemysupport import Session, metadata
3907+from sqlalchemy import Column, UnicodeText, Integer
3908+from reahl.sqlalchemysupport import Session, Base
3909
3910 from reahl.web.fw import UserInterface
3911 from reahl.web.ui import Button
3912@@ -28,16 +27,16 @@
3913
3914 self.main.add_child(CommentForm(view))
3915
3916- for comment in Comment.query.all():
3917+ for comment in Session.query(Comment).all():
3918 self.main.add_child(CommentBox(view, comment))
3919
3920
3921-class Comment(elixir.Entity):
3922- elixir.using_options(session=Session, metadata=metadata, tablename='features_comment')
3923- elixir.using_mapper_options(save_on_init=False)
3924+class Comment(Base):
3925+ __tablename__ = 'features_comment'
3926
3927- email_address = elixir.Field(elixir.UnicodeText)
3928- text = elixir.Field(elixir.UnicodeText)
3929+ id = Column(Integer, primary_key=True)
3930+ email_address = Column(UnicodeText)
3931+ text = Column(UnicodeText)
3932
3933 @exposed
3934 def fields(self, fields):
3935
3936=== modified file 'reahl-doc/reahl/doc/examples/features/tabbedpanel/.reahlproject'
3937--- reahl-doc/reahl/doc/examples/features/tabbedpanel/.reahlproject 2013-12-05 14:13:07 +0000
3938+++ reahl-doc/reahl/doc/examples/features/tabbedpanel/.reahlproject 2014-09-04 15:41:33 +0000
3939@@ -2,7 +2,7 @@
3940 <deps purpose="run">
3941 <egg name="reahl-web"/>
3942 <egg name="reahl-component"/>
3943- <egg name="reahl-web-elixirimpl"/>
3944+ <egg name="reahl-web-declarative"/>
3945 </deps>
3946
3947 <deps purpose="test">
3948
3949=== modified file 'reahl-doc/reahl/doc/examples/features/tabbedpanel/etc/web.config.py'
3950--- reahl-doc/reahl/doc/examples/features/tabbedpanel/etc/web.config.py 2014-07-06 10:25:15 +0000
3951+++ reahl-doc/reahl/doc/examples/features/tabbedpanel/etc/web.config.py 2014-09-04 15:41:33 +0000
3952@@ -1,6 +1,5 @@
3953
3954-from __future__ import unicode_literals
3955-from __future__ import print_function
3956+from __future__ import print_function, unicode_literals, absolute_import, division
3957 from reahl.doc.examples.features.tabbedpanel.tabbedpanel import TabbedPanelUI
3958
3959 web.site_root = TabbedPanelUI
3960
3961=== modified file 'reahl-doc/reahl/doc/examples/features/tabbedpanel/tabbedpanel.py'
3962--- reahl-doc/reahl/doc/examples/features/tabbedpanel/tabbedpanel.py 2014-07-06 10:25:15 +0000
3963+++ reahl-doc/reahl/doc/examples/features/tabbedpanel/tabbedpanel.py 2014-09-04 15:41:33 +0000
3964@@ -1,6 +1,5 @@
3965
3966-from __future__ import unicode_literals
3967-from __future__ import print_function
3968+from __future__ import print_function, unicode_literals, absolute_import, division
3969 from reahl.web.fw import UserInterface
3970 from reahl.web.ui import TwoColumnPage, TabbedPanel, Tab, P
3971
3972
3973=== modified file 'reahl-doc/reahl/doc/examples/features/validation/.reahlproject'
3974--- reahl-doc/reahl/doc/examples/features/validation/.reahlproject 2013-12-05 14:13:07 +0000
3975+++ reahl-doc/reahl/doc/examples/features/validation/.reahlproject 2014-09-04 15:41:33 +0000
3976@@ -2,7 +2,7 @@
3977 <deps purpose="run">
3978 <egg name="reahl-web"/>
3979 <egg name="reahl-component"/>
3980- <egg name="reahl-web-elixirimpl"/>
3981+ <egg name="reahl-web-declarative"/>
3982 </deps>
3983
3984 <deps purpose="test">
3985
3986=== modified file 'reahl-doc/reahl/doc/examples/features/validation/etc/web.config.py'
3987--- reahl-doc/reahl/doc/examples/features/validation/etc/web.config.py 2014-07-06 10:25:15 +0000
3988+++ reahl-doc/reahl/doc/examples/features/validation/etc/web.config.py 2014-09-04 15:41:33 +0000
3989@@ -1,6 +1,5 @@
3990
3991-from __future__ import unicode_literals
3992-from __future__ import print_function
3993+from __future__ import print_function, unicode_literals, absolute_import, division
3994 from reahl.doc.examples.features.validation.validation import ValidationUI
3995
3996 web.site_root = ValidationUI
3997
3998=== modified file 'reahl-doc/reahl/doc/examples/features/validation/validation.py'
3999--- reahl-doc/reahl/doc/examples/features/validation/validation.py 2014-07-06 10:25:15 +0000
4000+++ reahl-doc/reahl/doc/examples/features/validation/validation.py 2014-09-04 15:41:33 +0000
4001@@ -1,6 +1,5 @@
4002
4003-from __future__ import unicode_literals
4004-from __future__ import print_function
4005+from __future__ import print_function, unicode_literals, absolute_import, division
4006 from reahl.web.fw import UserInterface
4007 from reahl.web.ui import TwoColumnPage, Form, TextInput
4008 from reahl.component.modelinterface import exposed, EmailField
4009
4010=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access/.reahlproject'
4011--- reahl-doc/reahl/doc/examples/tutorial/access/.reahlproject 2014-04-01 11:27:49 +0000
4012+++ reahl-doc/reahl/doc/examples/tutorial/access/.reahlproject 2014-09-04 15:41:33 +0000
4013@@ -3,7 +3,7 @@
4014 <egg name="reahl-web"/>
4015 <egg name="reahl-component"/>
4016 <egg name="reahl-sqlalchemysupport"/>
4017- <egg name="reahl-web-elixirimpl"/>
4018+ <egg name="reahl-web-declarative"/>
4019 <egg name="reahl-domain"/>
4020 </deps>
4021
4022
4023=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access/access.py'
4024--- reahl-doc/reahl/doc/examples/tutorial/access/access.py 2014-07-06 10:25:15 +0000
4025+++ reahl-doc/reahl/doc/examples/tutorial/access/access.py 2014-09-04 15:41:33 +0000
4026@@ -1,29 +1,32 @@
4027
4028-from __future__ import unicode_literals
4029-from __future__ import print_function
4030-import elixir
4031-
4032-from reahl.sqlalchemysupport import Session, metadata
4033+from __future__ import print_function, unicode_literals, absolute_import, division
4034+
4035+
4036+from sqlalchemy import Column, ForeignKey, Integer, UnicodeText, Boolean
4037+from sqlalchemy.orm import relationship
4038+
4039+from reahl.sqlalchemysupport import Session, Base
4040
4041 from reahl.web.fw import UserInterface, UrlBoundView, CannotCreate
4042 from reahl.web.ui import TwoColumnPage, Form, TextInput, LabelledBlockInput, Button, Panel, P, H, InputGroup, HMenu,\
4043 PasswordInput, ErrorFeedbackMessage, VMenu, Slot, MenuItem, A, Widget, SelectInput, CheckboxInput
4044-from reahl.systemaccountmodel import AccountManagementInterface, EmailAndPasswordSystemAccount, UserSession
4045+from reahl.domain.systemaccountmodel import AccountManagementInterface, EmailAndPasswordSystemAccount, UserSession
4046 from reahl.component.modelinterface import exposed, IntegerField, BooleanField, Field, EmailField, Event, Action, Choice, ChoiceField
4047
4048
4049
4050-class Address(elixir.Entity):
4051- elixir.using_options(session=Session, metadata=metadata)
4052- elixir.using_mapper_options(save_on_init=False)
4053-
4054- address_book = elixir.ManyToOne('reahl.doc.examples.tutorial.access.access.AddressBook')
4055- email_address = elixir.Field(elixir.UnicodeText)
4056- name = elixir.Field(elixir.UnicodeText)
4057+class Address(Base):
4058+ __tablename__ = 'access_address'
4059+
4060+ id = Column(Integer, primary_key=True)
4061+ address_book_id = Column(Integer, ForeignKey('access_address_book.id'))
4062+ address_book = relationship('reahl.doc.examples.tutorial.access.access.AddressBook')
4063+ email_address = Column(UnicodeText)
4064+ name = Column(UnicodeText)
4065
4066 @classmethod
4067 def by_id(cls, address_id, exception_to_raise):
4068- addresses = Address.query.filter_by(id=address_id)
4069+ addresses = Session.query(cls).filter_by(id=address_id)
4070 if addresses.count() != 1:
4071 raise exception_to_raise
4072 return addresses.one()
4073@@ -51,31 +54,36 @@
4074 return self.address_book.can_be_added_to_by(current_account)
4075
4076
4077-class AddressBook(elixir.Entity):
4078- elixir.using_options(session=Session, metadata=metadata)
4079-
4080- owner = elixir.ManyToOne(EmailAndPasswordSystemAccount, required=True)
4081+class AddressBook(Base):
4082+ __tablename__ = 'access_address_book'
4083+
4084+ id = Column(Integer, primary_key=True)
4085+
4086+ owner_id = Column(Integer, ForeignKey(EmailAndPasswordSystemAccount.id), nullable=False)
4087+ owner = relationship(EmailAndPasswordSystemAccount)
4088+ collaborators = relationship('reahl.doc.examples.tutorial.access.access.Collaborator', lazy='dynamic',
4089+ backref='address_book')
4090
4091 @classmethod
4092 def by_id(cls, address_book_id, exception_to_raise):
4093- address_books = AddressBook.query.filter_by(id=address_book_id)
4094+ address_books = Session.query(cls).filter_by(id=address_book_id)
4095 if address_books.count() != 1:
4096 raise exception_to_raise
4097 return address_books.one()
4098
4099 @classmethod
4100 def owned_by(cls, account):
4101- return cls.query.filter_by(owner=account)
4102+ return Session.query(cls).filter_by(owner=account)
4103
4104 @classmethod
4105 def address_books_visible_to(cls, account):
4106- visible_books = cls.query.join(Collaborator).filter(Collaborator.account == account).all()
4107+ visible_books = Session.query(cls).join(Collaborator).filter(Collaborator.account == account).all()
4108 visible_books.extend(cls.owned_by(account))
4109 return visible_books
4110
4111 @exposed
4112 def fields(self, fields):
4113- collaborators = [Choice(i.id, IntegerField(label=i.email)) for i in EmailAndPasswordSystemAccount.query.all()]
4114+ collaborators = [Choice(i.id, IntegerField(label=i.email)) for i in Session.query(EmailAndPasswordSystemAccount).all()]
4115 fields.chosen_collaborator = ChoiceField(collaborators, label='Choose collaborator')
4116 fields.may_edit_address = BooleanField(label='May edit existing addresses')
4117 fields.may_add_address = BooleanField(label='May add new addresses')
4118@@ -85,22 +93,21 @@
4119 events.add_collaborator = Event(label='Share', action=Action(self.add_collaborator))
4120
4121 def add_collaborator(self):
4122- chosen_account = EmailAndPasswordSystemAccount.query.filter_by(id=self.chosen_collaborator).one()
4123+ chosen_account = Session.query(EmailAndPasswordSystemAccount).filter_by(id=self.chosen_collaborator).one()
4124 self.allow(chosen_account, can_add_addresses=self.may_add_address, can_edit_addresses=self.may_edit_address)
4125
4126 # See https://groups.google.com/forum/?fromgroups=#!topic/sqlelixir/ZlR9Kvcor6Q
4127 # addresses = elixir.OneToMany(Address)
4128 @property
4129 def addresses(self):
4130- return Address.query.filter_by(address_book=self).all()
4131- collaborators = elixir.OneToMany('reahl.doc.examples.tutorial.access.access.Collaborator', lazy='dynamic')
4132+ return Session.query(Address).filter_by(address_book=self).all()
4133
4134 @property
4135 def display_name(self):
4136 return 'Address book of %s' % self.owner.email
4137
4138 def allow(self, account, can_add_addresses=False, can_edit_addresses=False):
4139- Collaborator.query.filter_by(address_book=self, account=account).delete()
4140+ Session.query(Collaborator).filter_by(address_book=self, account=account).delete()
4141 Collaborator(address_book=self, account=account,
4142 can_add_addresses=can_add_addresses,
4143 can_edit_addresses=can_edit_addresses)
4144@@ -147,14 +154,17 @@
4145 return None
4146
4147
4148-class Collaborator(elixir.Entity):
4149- elixir.using_options(session=Session, metadata=metadata)
4150-
4151- account = elixir.ManyToOne(EmailAndPasswordSystemAccount)
4152- can_add_addresses = elixir.Field(elixir.Boolean, default=False)
4153- can_edit_addresses = elixir.Field(elixir.Boolean, default=False)
4154-
4155- address_book = elixir.ManyToOne(AddressBook)
4156+class Collaborator(Base):
4157+ __tablename__ = 'access_collaborator'
4158+ id = Column(Integer, primary_key=True)
4159+
4160+ address_book_id = Column(Integer, ForeignKey(AddressBook.id))
4161+
4162+ account_id = Column(Integer, ForeignKey(EmailAndPasswordSystemAccount.id), nullable=False)
4163+ account = relationship(EmailAndPasswordSystemAccount)
4164+
4165+ can_add_addresses = Column(Boolean, default=False)
4166+ can_edit_addresses = Column(Boolean, default=False)
4167
4168
4169 class AddressAppPage(TwoColumnPage):
4170@@ -220,7 +230,7 @@
4171
4172 class AddressBookPanel(Panel):
4173 def __init__(self, view, address_book, address_book_ui):
4174- self.address_book = address_book
4175+ self.address_book = address_book
4176 super(AddressBookPanel, self).__init__(view)
4177
4178 self.add_child(H(view, 1, text='Addresses in %s' % address_book.display_name))
4179
4180=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access/access_dev/accesstests.py'
4181--- reahl-doc/reahl/doc/examples/tutorial/access/access_dev/accesstests.py 2014-07-06 10:25:15 +0000
4182+++ reahl-doc/reahl/doc/examples/tutorial/access/access_dev/accesstests.py 2014-09-04 15:41:33 +0000
4183@@ -1,6 +1,5 @@
4184
4185-from __future__ import unicode_literals
4186-from __future__ import print_function
4187+from __future__ import print_function, unicode_literals, absolute_import, division
4188 from reahl.tofu import test, set_up, scenario
4189
4190 from reahl.sqlalchemysupport import Session
4191@@ -11,7 +10,7 @@
4192 from reahl.doc.examples.tutorial.access.access import Address
4193 from reahl.doc.examples.tutorial.access.access import AddressBook
4194 from reahl.doc.examples.tutorial.access.access import AddressBookUI
4195-from reahl.systemaccountmodel import EmailAndPasswordSystemAccount
4196+from reahl.domain.systemaccountmodel import EmailAndPasswordSystemAccount
4197
4198
4199 class AccessFixture(WebFixture):
4200@@ -22,13 +21,16 @@
4201
4202 def new_account(self, email='johndoe@some.org'):
4203 account = EmailAndPasswordSystemAccount(email=email)
4204+ Session.add(account)
4205 account.set_new_password(account.email, self.password)
4206 account.activate()
4207 return account
4208
4209 def new_address_book(self, owner=None):
4210 owner = owner or self.account
4211- return AddressBook(owner=owner)
4212+ address_book = AddressBook(owner=owner)
4213+ Session.add(address_book)
4214+ return address_book
4215
4216 def new_other_account(self):
4217 return self.new_account(email='other@some.org')
4218@@ -80,8 +82,6 @@
4219 Session.commit()
4220
4221
4222-
4223-
4224 @test(AccessFixture)
4225 def separate_address_books(fixture):
4226 """An Address is created in a particular AddressBook, which is owned by a SystemAccount."""
4227
4228=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access/etc/web.config.py'
4229--- reahl-doc/reahl/doc/examples/tutorial/access/etc/web.config.py 2014-07-06 10:25:15 +0000
4230+++ reahl-doc/reahl/doc/examples/tutorial/access/etc/web.config.py 2014-09-04 15:41:33 +0000
4231@@ -1,6 +1,5 @@
4232
4233-from __future__ import unicode_literals
4234-from __future__ import print_function
4235+from __future__ import print_function, unicode_literals, absolute_import, division
4236 from reahl.doc.examples.tutorial.access.access import AddressBookUI
4237
4238 web.site_root = AddressBookUI
4239
4240=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access1/access1.py'
4241--- reahl-doc/reahl/doc/examples/tutorial/access1/access1.py 2014-07-06 10:25:15 +0000
4242+++ reahl-doc/reahl/doc/examples/tutorial/access1/access1.py 2014-09-04 15:41:33 +0000
4243@@ -1,38 +1,43 @@
4244
4245-from __future__ import unicode_literals
4246-from __future__ import print_function
4247-import elixir
4248-
4249-from reahl.sqlalchemysupport import Session, metadata
4250-from reahl.systemaccountmodel import EmailAndPasswordSystemAccount
4251-
4252-
4253-class Address(elixir.Entity):
4254- elixir.using_options(session=Session, metadata=metadata)
4255- elixir.using_mapper_options(save_on_init=False)
4256-
4257- address_book = elixir.ManyToOne('reahl.doc.examples.tutorial.access1.access1.AddressBook')
4258- email_address = elixir.Field(elixir.UnicodeText)
4259- name = elixir.Field(elixir.UnicodeText)
4260+from __future__ import print_function, unicode_literals, absolute_import, division
4261+
4262+from sqlalchemy import Column, ForeignKey, Integer, UnicodeText, Boolean
4263+from sqlalchemy.orm import relationship, backref
4264+
4265+from reahl.sqlalchemysupport import Session, Base
4266+from reahl.domain.systemaccountmodel import EmailAndPasswordSystemAccount
4267+
4268+
4269+class Address(Base):
4270+ __tablename__ = 'access1_address'
4271+
4272+ id = Column(Integer, primary_key=True)
4273+ address_book_id = Column(Integer, ForeignKey('access1_address_book.id'))
4274+ address_book = relationship('reahl.doc.examples.tutorial.access1.access1.AddressBook')
4275+ email_address = Column(UnicodeText)
4276+ name = Column(UnicodeText)
4277
4278 def save(self):
4279 Session.add(self)
4280
4281-
4282-
4283-
4284-class AddressBook(elixir.Entity):
4285- elixir.using_options(session=Session, metadata=metadata)
4286-
4287- owner = elixir.ManyToOne(EmailAndPasswordSystemAccount, required=True)
4288+
4289+class AddressBook(Base):
4290+ __tablename__ = 'access1_address_book'
4291+
4292+ id = Column(Integer, primary_key=True)
4293+
4294+ owner_id = Column(Integer, ForeignKey(EmailAndPasswordSystemAccount.id), nullable=False)
4295+ owner = relationship(EmailAndPasswordSystemAccount)
4296+ collaborators = relationship('reahl.doc.examples.tutorial.access1.access1.Collaborator', lazy='dynamic',
4297+ backref='address_book')
4298
4299 @classmethod
4300 def owned_by(cls, account):
4301- return cls.query.filter_by(owner=account)
4302+ return Session.query(cls).filter_by(owner=account)
4303
4304 @classmethod
4305 def address_books_visible_to(cls, account):
4306- visible_books = cls.query.join(Collaborator).filter(Collaborator.account == account).all()
4307+ visible_books = Session.query(cls).join(Collaborator).filter(Collaborator.account == account).all()
4308 visible_books.extend(cls.owned_by(account))
4309 return visible_books
4310
4311@@ -40,12 +45,10 @@
4312 # addresses = elixir.OneToMany(Address)
4313 @property
4314 def addresses(self):
4315- return Address.query.filter_by(address_book=self).all()
4316-
4317- collaborators = elixir.OneToMany('reahl.doc.examples.tutorial.access1.access1.Collaborator', lazy='dynamic')
4318+ return Session.query(Address).filter_by(address_book=self).all()
4319
4320 def allow(self, account, can_add_addresses=False, can_edit_addresses=False):
4321- Collaborator.query.filter_by(address_book=self, account=account).delete()
4322+ Session.query(Collaborator).filter_by(address_book=self, account=account).delete()
4323 Collaborator(address_book=self, account=account,
4324 can_add_addresses=can_add_addresses,
4325 can_edit_addresses=can_edit_addresses)
4326@@ -80,13 +83,18 @@
4327 return None
4328
4329
4330-class Collaborator(elixir.Entity):
4331- elixir.using_options(session=Session, metadata=metadata)
4332-
4333- account = elixir.ManyToOne(EmailAndPasswordSystemAccount)
4334- can_add_addresses = elixir.Field(elixir.Boolean, default=False)
4335- can_edit_addresses = elixir.Field(elixir.Boolean, default=False)
4336-
4337- address_book = elixir.ManyToOne(AddressBook)
4338+class Collaborator(Base):
4339+ __tablename__ = 'access1_collaborator'
4340+ id = Column(Integer, primary_key=True)
4341+
4342+ address_book_id = Column(Integer, ForeignKey(AddressBook.id))
4343+
4344+ account_id = Column(Integer, ForeignKey(EmailAndPasswordSystemAccount.id), nullable=False)
4345+ account = relationship(EmailAndPasswordSystemAccount)
4346+
4347+ can_add_addresses = Column(Boolean, default=False)
4348+ can_edit_addresses = Column(Boolean, default=False)
4349+
4350+
4351
4352
4353
4354=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access1/access1_dev/accesstests1.py'
4355--- reahl-doc/reahl/doc/examples/tutorial/access1/access1_dev/accesstests1.py 2014-07-06 10:25:15 +0000
4356+++ reahl-doc/reahl/doc/examples/tutorial/access1/access1_dev/accesstests1.py 2014-09-04 15:41:33 +0000
4357@@ -3,11 +3,12 @@
4358 # nosetests -F reahl.webdev.fixtures:BrowserSetup -s --nologcapture reahl/doc_dev/tutorialtests/accesstests1.py
4359
4360
4361-from __future__ import unicode_literals
4362-from __future__ import print_function
4363+from __future__ import print_function, unicode_literals, absolute_import, division
4364 from reahl.tofu import test
4365 from reahl.web_dev.fixtures import WebFixture
4366-from reahl.systemaccountmodel import EmailAndPasswordSystemAccount
4367+from reahl.domain.systemaccountmodel import EmailAndPasswordSystemAccount
4368+
4369+from reahl.sqlalchemysupport import Session
4370
4371 from reahl.doc.examples.tutorial.access1.access1 import AddressBook, Address
4372
4373@@ -17,13 +18,16 @@
4374
4375 def new_account(self, email='johndoe@some.org'):
4376 account = EmailAndPasswordSystemAccount(email=email)
4377+ Session.add(account)
4378 account.set_new_password(account.email, self.password)
4379 account.activate()
4380 return account
4381
4382 def new_address_book(self, owner=None):
4383 owner = owner or self.account
4384- return AddressBook(owner=owner)
4385+ address_book = AddressBook(owner=owner)
4386+ Session.add(address_book)
4387+ return address_book
4388
4389 def new_other_account(self):
4390 return self.new_account(email='other@some.org')
4391
4392=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access2/.reahlproject'
4393--- reahl-doc/reahl/doc/examples/tutorial/access2/.reahlproject 2014-04-01 11:27:49 +0000
4394+++ reahl-doc/reahl/doc/examples/tutorial/access2/.reahlproject 2014-09-04 15:41:33 +0000
4395@@ -3,7 +3,7 @@
4396 <egg name="reahl-web"/>
4397 <egg name="reahl-component"/>
4398 <egg name="reahl-sqlalchemysupport"/>
4399- <egg name="reahl-web-elixirimpl"/>
4400+ <egg name="reahl-web-declarative"/>
4401 <egg name="reahl-domain"/>
4402 </deps>
4403
4404
4405=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access2/access2.py'
4406--- reahl-doc/reahl/doc/examples/tutorial/access2/access2.py 2014-07-06 10:25:15 +0000
4407+++ reahl-doc/reahl/doc/examples/tutorial/access2/access2.py 2014-09-04 15:41:33 +0000
4408@@ -1,28 +1,29 @@
4409
4410-from __future__ import unicode_literals
4411-from __future__ import print_function
4412-import elixir
4413-
4414-from reahl.sqlalchemysupport import Session, metadata
4415-from reahl.systemaccountmodel import AccountManagementInterface, EmailAndPasswordSystemAccount, UserSession
4416+from __future__ import print_function, unicode_literals, absolute_import, division
4417+
4418+from sqlalchemy import Column, ForeignKey, Integer, UnicodeText, Boolean
4419+from sqlalchemy.orm import relationship
4420+
4421+from reahl.sqlalchemysupport import Session, Base
4422+from reahl.domain.systemaccountmodel import AccountManagementInterface, EmailAndPasswordSystemAccount, UserSession
4423 from reahl.component.modelinterface import exposed, IntegerField, BooleanField, Field, EmailField, Event, Action, Choice, ChoiceField
4424 from reahl.web.fw import UserInterface, UrlBoundView, CannotCreate
4425 from reahl.web.ui import TwoColumnPage, Form, TextInput, LabelledBlockInput, Button, Panel, A, P, H, InputGroup, HMenu,\
4426 PasswordInput, ErrorFeedbackMessage, Slot, Widget, SelectInput, CheckboxInput
4427
4428
4429+class Address(Base):
4430+ __tablename__ = 'access2_address'
4431
4432-class Address(elixir.Entity):
4433- elixir.using_options(session=Session, metadata=metadata)
4434- elixir.using_mapper_options(save_on_init=False)
4435-
4436- address_book = elixir.ManyToOne('reahl.doc.examples.tutorial.access2.access2.AddressBook')
4437- email_address = elixir.Field(elixir.UnicodeText)
4438- name = elixir.Field(elixir.UnicodeText)
4439+ id = Column(Integer, primary_key=True)
4440+ address_book_id = Column(Integer, ForeignKey('access2_address_book.id'))
4441+ address_book = relationship('reahl.doc.examples.tutorial.access2.access2.AddressBook')
4442+ email_address = Column(UnicodeText)
4443+ name = Column(UnicodeText)
4444
4445 @classmethod
4446 def by_id(cls, address_id, exception_to_raise):
4447- addresses = Address.query.filter_by(id=address_id)
4448+ addresses = Session.query(cls).filter_by(id=address_id)
4449 if addresses.count() != 1:
4450 raise exception_to_raise
4451 return addresses.one()
4452@@ -42,31 +43,36 @@
4453 Session.add(self)
4454
4455
4456-class AddressBook(elixir.Entity):
4457- elixir.using_options(session=Session, metadata=metadata)
4458-
4459- owner = elixir.ManyToOne(EmailAndPasswordSystemAccount, required=True)
4460+class AddressBook(Base):
4461+ __tablename__ = 'access2_address_book'
4462+
4463+ id = Column(Integer, primary_key=True)
4464+
4465+ owner_id = Column(Integer, ForeignKey(EmailAndPasswordSystemAccount.id), nullable=False)
4466+ owner = relationship(EmailAndPasswordSystemAccount)
4467+ collaborators = relationship('reahl.doc.examples.tutorial.access2.access2.Collaborator', lazy='dynamic',
4468+ backref='address_book')
4469
4470 @classmethod
4471 def by_id(cls, address_book_id, exception_to_raise):
4472- address_books = AddressBook.query.filter_by(id=address_book_id)
4473+ address_books = Session.query(cls).filter_by(id=address_book_id)
4474 if address_books.count() != 1:
4475 raise exception_to_raise
4476 return address_books.one()
4477
4478 @classmethod
4479 def owned_by(cls, account):
4480- return cls.query.filter_by(owner=account)
4481+ return Session.query(cls).filter_by(owner=account)
4482
4483 @classmethod
4484 def address_books_visible_to(cls, account):
4485- visible_books = cls.query.join(Collaborator).filter(Collaborator.account == account).all()
4486+ visible_books = Session.query(cls).join(Collaborator).filter(Collaborator.account == account).all()
4487 visible_books.extend(cls.owned_by(account))
4488 return visible_books
4489
4490 @exposed
4491 def fields(self, fields):
4492- collaborators = [Choice(i.id, IntegerField(label=i.email)) for i in EmailAndPasswordSystemAccount.query.all()]
4493+ collaborators = [Choice(i.id, IntegerField(label=i.email)) for i in Session.query(EmailAndPasswordSystemAccount).all()]
4494 fields.chosen_collaborator = ChoiceField(collaborators, label='Choose collaborator')
4495 fields.may_edit_address = BooleanField(label='May edit existing addresses')
4496 fields.may_add_address = BooleanField(label='May add new addresses')
4497@@ -76,23 +82,21 @@
4498 events.add_collaborator = Event(label='Share', action=Action(self.add_collaborator))
4499
4500 def add_collaborator(self):
4501- chosen_account = EmailAndPasswordSystemAccount.query.filter_by(id=self.chosen_collaborator).one()
4502+ chosen_account = Session.query(EmailAndPasswordSystemAccount).filter_by(id=self.chosen_collaborator).one()
4503 self.allow(chosen_account, can_add_addresses=self.may_add_address, can_edit_addresses=self.may_edit_address)
4504
4505 # See https://groups.google.com/forum/?fromgroups=#!topic/sqlelixir/ZlR9Kvcor6Q
4506 # addresses = elixir.OneToMany(Address)
4507 @property
4508 def addresses(self):
4509- return Address.query.filter_by(address_book=self).all()
4510-
4511- collaborators = elixir.OneToMany('reahl.doc.examples.tutorial.access2.access2.Collaborator', lazy='dynamic')
4512+ return Session.query(Address).filter_by(address_book=self).all()
4513
4514 @property
4515 def display_name(self):
4516 return 'Address book of %s' % self.owner.email
4517
4518 def allow(self, account, can_add_addresses=False, can_edit_addresses=False):
4519- Collaborator.query.filter_by(address_book=self, account=account).delete()
4520+ Session.query(Collaborator).filter_by(address_book=self, account=account).delete()
4521 Collaborator(address_book=self, account=account,
4522 can_add_addresses=can_add_addresses,
4523 can_edit_addresses=can_edit_addresses)
4524@@ -127,14 +131,17 @@
4525 return None
4526
4527
4528-class Collaborator(elixir.Entity):
4529- elixir.using_options(session=Session, metadata=metadata)
4530-
4531- account = elixir.ManyToOne(EmailAndPasswordSystemAccount)
4532- can_add_addresses = elixir.Field(elixir.Boolean, default=False)
4533- can_edit_addresses = elixir.Field(elixir.Boolean, default=False)
4534-
4535- address_book = elixir.ManyToOne(AddressBook)
4536+class Collaborator(Base):
4537+ __tablename__ = 'access2_collaborator'
4538+ id = Column(Integer, primary_key=True)
4539+
4540+ address_book_id = Column(Integer, ForeignKey(AddressBook.id))
4541+
4542+ account_id = Column(Integer, ForeignKey(EmailAndPasswordSystemAccount.id), nullable=False)
4543+ account = relationship(EmailAndPasswordSystemAccount)
4544+
4545+ can_add_addresses = Column(Boolean, default=False)
4546+ can_edit_addresses = Column(Boolean, default=False)
4547
4548
4549 class AddressAppPage(TwoColumnPage):
4550@@ -200,7 +207,7 @@
4551
4552 class AddressBookPanel(Panel):
4553 def __init__(self, view, address_book, address_book_ui):
4554- self.address_book = address_book
4555+ self.address_book = address_book
4556 super(AddressBookPanel, self).__init__(view)
4557
4558 self.add_child(H(view, 1, text='Addresses in %s' % address_book.display_name))
4559
4560=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access2/access2_dev/accesstests2.py'
4561--- reahl-doc/reahl/doc/examples/tutorial/access2/access2_dev/accesstests2.py 2014-07-06 10:25:15 +0000
4562+++ reahl-doc/reahl/doc/examples/tutorial/access2/access2_dev/accesstests2.py 2014-09-04 15:41:33 +0000
4563@@ -7,13 +7,12 @@
4564
4565
4566
4567-from __future__ import unicode_literals
4568-from __future__ import print_function
4569+from __future__ import print_function, unicode_literals, absolute_import, division
4570 from reahl.tofu import test, set_up
4571 from reahl.web_dev.fixtures import WebFixture
4572 from reahl.webdev.tools import Browser, XPath
4573 from reahl.sqlalchemysupport import Session
4574-from reahl.systemaccountmodel import EmailAndPasswordSystemAccount
4575+from reahl.domain.systemaccountmodel import EmailAndPasswordSystemAccount
4576
4577 from reahl.doc.examples.tutorial.access2.access2 import AddressBookUI, AddressBook, Address
4578
4579@@ -26,13 +25,16 @@
4580
4581 def new_account(self, email='johndoe@some.org'):
4582 account = EmailAndPasswordSystemAccount(email=email)
4583+ Session.add(account)
4584 account.set_new_password(account.email, self.password)
4585 account.activate()
4586 return account
4587
4588 def new_address_book(self, owner=None):
4589 owner = owner or self.account
4590- return AddressBook(owner=owner)
4591+ address_book = AddressBook(owner=owner)
4592+ Session.add(address_book)
4593+ return address_book
4594
4595 def new_other_account(self):
4596 return self.new_account(email='other@some.org')
4597
4598=== modified file 'reahl-doc/reahl/doc/examples/tutorial/access2/etc/web.config.py'
4599--- reahl-doc/reahl/doc/examples/tutorial/access2/etc/web.config.py 2014-07-06 10:25:15 +0000
4600+++ reahl-doc/reahl/doc/examples/tutorial/access2/etc/web.config.py 2014-09-04 15:41:33 +0000
4601@@ -1,6 +1,5 @@
4602
4603-from __future__ import unicode_literals
4604-from __future__ import print_function
4605+from __future__ import print_function, unicode_literals, absolute_import, division
4606 from access2 import AddressBookUI
4607
4608 web.site_root=AddressBookUI
4609
4610=== modified file 'reahl-doc/reahl/doc/examples/tutorial/addressbook1/.reahlproject'
4611--- reahl-doc/reahl/doc/examples/tutorial/addressbook1/.reahlproject 2014-06-29 16:29:48 +0000
4612+++ reahl-doc/reahl/doc/examples/tutorial/addressbook1/.reahlproject 2014-09-04 15:41:33 +0000
4613@@ -3,7 +3,7 @@
4614 <egg name="reahl-web"/>
4615 <egg name="reahl-component"/>
4616 <egg name="reahl-sqlalchemysupport"/>
4617- <egg name="reahl-web-elixirimpl"/>
4618+ <egg name="reahl-web-declarative"/>
4619 </deps>
4620
4621 <deps purpose="test">
4622
4623=== modified file 'reahl-doc/reahl/doc/examples/tutorial/addressbook1/addressbook1.py'
4624--- reahl-doc/reahl/doc/examples/tutorial/addressbook1/addressbook1.py 2014-07-06 10:25:15 +0000
4625+++ reahl-doc/reahl/doc/examples/tutorial/addressbook1/addressbook1.py 2014-09-04 15:41:33 +0000
4626@@ -1,8 +1,8 @@
4627
4628-from __future__ import unicode_literals
4629-from __future__ import print_function
4630+from __future__ import print_function, unicode_literals, absolute_import, division
4631 from reahl.web.fw import UserInterface, Widget
4632 from reahl.web.ui import TwoColumnPage, Panel, P, H
4633+from reahl.sqlalchemysupport import Session
4634
4635
4636 class AddressBookUI(UserInterface):
4637@@ -22,7 +22,7 @@
4638
4639 self.add_child(H(view, 1, text='Addresses'))
4640
4641- for address in Address.query.all():
4642+ for address in Session.query(Address).all():
4643 self.add_child(AddressBox(view, address))
4644
4645
4646@@ -33,15 +33,15 @@
4647
4648
4649 # The model from before:
4650-import elixir
4651-from reahl.sqlalchemysupport import Session, metadata
4652-
4653-class Address(elixir.Entity):
4654- elixir.using_options(session=Session, metadata=metadata)
4655- elixir.using_mapper_options(save_on_init=False)
4656-
4657- email_address = elixir.Field(elixir.UnicodeText)
4658- name = elixir.Field(elixir.UnicodeText)
4659+from sqlalchemy import Column, Integer, UnicodeText
4660+from reahl.sqlalchemysupport import Session, Base
4661+
4662+class Address(Base):
4663+ __tablename__ = 'addressbook1_address'
4664+
4665+ id = Column(Integer, primary_key=True)
4666+ email_address = Column(UnicodeText)
4667+ name = Column(UnicodeText)
4668
4669 def save(self):
4670 Session.add(self)
4671
4672=== modified file 'reahl-doc/reahl/doc/examples/tutorial/addressbook1/etc/web.config.py'
4673--- reahl-doc/reahl/doc/examples/tutorial/addressbook1/etc/web.config.py 2014-07-06 10:25:15 +0000
4674+++ reahl-doc/reahl/doc/examples/tutorial/addressbook1/etc/web.config.py 2014-09-04 15:41:33 +0000
4675@@ -1,6 +1,5 @@
4676
4677-from __future__ import unicode_literals
4678-from __future__ import print_function
4679+from __future__ import print_function, unicode_literals, absolute_import, division
4680 from reahl.doc.examples.tutorial.addressbook1.addressbook1 import AddressBookUI
4681
4682 web.site_root = AddressBookUI
4683
4684=== modified file 'reahl-doc/reahl/doc/examples/tutorial/addressbook2/.reahlproject'
4685--- reahl-doc/reahl/doc/examples/tutorial/addressbook2/.reahlproject 2014-04-01 11:27:49 +0000
4686+++ reahl-doc/reahl/doc/examples/tutorial/addressbook2/.reahlproject 2014-09-04 15:41:33 +0000
4687@@ -3,7 +3,7 @@
4688 <egg name="reahl-web"/>
4689 <egg name="reahl-component"/>
4690 <egg name="reahl-sqlalchemysupport"/>
4691- <egg name="reahl-web-elixirimpl"/>
4692+ <egg name="reahl-web-declarative"/>
4693 </deps>
4694
4695 <deps purpose="test">
4696
4697=== modified file 'reahl-doc/reahl/doc/examples/tutorial/addressbook2/addressbook2.py'
4698--- reahl-doc/reahl/doc/examples/tutorial/addressbook2/addressbook2.py 2014-07-06 10:25:15 +0000
4699+++ reahl-doc/reahl/doc/examples/tutorial/addressbook2/addressbook2.py 2014-09-04 15:41:33 +0000
4700@@ -1,10 +1,9 @@
4701
4702
4703-from __future__ import unicode_literals
4704-from __future__ import print_function
4705-import elixir
4706+from __future__ import print_function, unicode_literals, absolute_import, division
4707
4708-from reahl.sqlalchemysupport import Session, metadata
4709+from sqlalchemy import Column, Integer, UnicodeText
4710+from reahl.sqlalchemysupport import Session, Base
4711
4712 from reahl.web.fw import UserInterface, Widget
4713 from reahl.web.ui import TwoColumnPage, Form, TextInput, LabelledBlockInput, Button, Panel, P, H, InputGroup
4714@@ -28,7 +27,7 @@
4715
4716 self.add_child(H(view, 1, text='Addresses'))
4717
4718- for address in Address.query.all():
4719+ for address in Session.query(Address).all():
4720 self.add_child(AddressBox(view, address))
4721
4722 self.add_child(AddAddressForm(view))
4723@@ -54,12 +53,12 @@
4724 self.add_child(P(view, text='%s: %s' % (address.name, address.email_address)))
4725
4726
4727-class Address(elixir.Entity):
4728- elixir.using_options(session=Session, metadata=metadata)
4729- elixir.using_mapper_options(save_on_init=False)
4730-
4731- email_address = elixir.Field(elixir.UnicodeText)
4732- name = elixir.Field(elixir.UnicodeText)
4733+class Address(Base):
4734+ __tablename__ = 'addressbook2_address'
4735+
4736+ id = Column(Integer, primary_key=True)
4737+ email_address = Column(UnicodeText)
4738+ name = Column(UnicodeText)
4739
4740 @exposed
4741 def fields(self, fields):
4742
4743=== modified file 'reahl-doc/reahl/doc/examples/tutorial/addressbook2/etc/web.config.py'
4744--- reahl-doc/reahl/doc/examples/tutorial/addressbook2/etc/web.config.py 2014-07-06 10:25:15 +0000
4745+++ reahl-doc/reahl/doc/examples/tutorial/addressbook2/etc/web.config.py 2014-09-04 15:41:33 +0000
4746@@ -1,7 +1,6 @@
4747
4748
4749-from __future__ import unicode_literals
4750-from __future__ import print_function
4751+from __future__ import print_function, unicode_literals, absolute_import, division
4752 from reahl.doc.examples.tutorial.addressbook2.addressbook2 import AddressBookUI
4753
4754 web.site_root = AddressBookUI
4755
4756=== modified file 'reahl-doc/reahl/doc/examples/tutorial/ajax/.reahlproject'
4757--- reahl-doc/reahl/doc/examples/tutorial/ajax/.reahlproject 2014-04-01 11:27:49 +0000
4758+++ reahl-doc/reahl/doc/examples/tutorial/ajax/.reahlproject 2014-09-04 15:41:33 +0000
4759@@ -3,7 +3,7 @@
4760 <egg name="reahl-web"/>
4761 <egg name="reahl-component"/>
4762 <egg name="reahl-sqlalchemysupport"/>
4763- <egg name="reahl-web-elixirimpl"/>
4764+ <egg name="reahl-web-declarative"/>
4765 </deps>
4766
4767 <deps purpose="test">
4768
4769=== modified file 'reahl-doc/reahl/doc/examples/tutorial/ajax/ajax.py'
4770--- reahl-doc/reahl/doc/examples/tutorial/ajax/ajax.py 2014-07-06 10:25:15 +0000
4771+++ reahl-doc/reahl/doc/examples/tutorial/ajax/ajax.py 2014-09-04 15:41:33 +0000
4772@@ -1,8 +1,7 @@
4773
4774
4775
4776-from __future__ import unicode_literals
4777-from __future__ import print_function
4778+from __future__ import print_function, unicode_literals, absolute_import, division
4779 from reahl.web.fw import UserInterface, Bookmark
4780 from reahl.web.ui import TwoColumnPage, P, H, Panel, HMenu
4781 from reahl.component.modelinterface import exposed, IntegerField
4782
4783=== modified file 'reahl-doc/reahl/doc/examples/tutorial/ajax/ajax_dev/ajaxtests.py'
4784--- reahl-doc/reahl/doc/examples/tutorial/ajax/ajax_dev/ajaxtests.py 2014-07-06 10:25:15 +0000
4785+++ reahl-doc/reahl/doc/examples/tutorial/ajax/ajax_dev/ajaxtests.py 2014-09-04 15:41:33 +0000
4786@@ -5,8 +5,7 @@
4787
4788
4789
4790-from __future__ import unicode_literals
4791-from __future__ import print_function
4792+from __future__ import print_function, unicode_literals, absolute_import, division
4793 from reahl.tofu import test
4794 from reahl.web_dev.fixtures import WebFixture
4795 from reahl.webdev.tools import XPath
4796
4797=== modified file 'reahl-doc/reahl/doc/examples/tutorial/ajax/etc/web.config.py'
4798--- reahl-doc/reahl/doc/examples/tutorial/ajax/etc/web.config.py 2014-07-06 10:25:15 +0000
4799+++ reahl-doc/reahl/doc/examples/tutorial/ajax/etc/web.config.py 2014-09-04 15:41:33 +0000
4800@@ -1,7 +1,6 @@
4801
4802
4803-from __future__ import unicode_literals
4804-from __future__ import print_function
4805+from __future__ import print_function, unicode_literals, absolute_import, division
4806 from reahl.doc.examples.tutorial.ajax.ajax import WidgetRefreshUI
4807
4808 web.site_root = WidgetRefreshUI
4809
4810=== modified file 'reahl-doc/reahl/doc/examples/tutorial/componentconfig/.reahlproject'
4811--- reahl-doc/reahl/doc/examples/tutorial/componentconfig/.reahlproject 2014-04-01 11:27:49 +0000
4812+++ reahl-doc/reahl/doc/examples/tutorial/componentconfig/.reahlproject 2014-09-04 15:41:33 +0000
4813@@ -3,7 +3,7 @@
4814 <egg name="reahl-web"/>
4815 <egg name="reahl-component"/>
4816 <egg name="reahl-sqlalchemysupport"/>
4817- <egg name="reahl-web-elixirimpl"/>
4818+ <egg name="reahl-web-declarative"/>
4819 </deps>
4820
4821 <deps purpose="test">
4822
4823=== modified file 'reahl-doc/reahl/doc/examples/tutorial/componentconfig/componentconfig.py'
4824--- reahl-doc/reahl/doc/examples/tutorial/componentconfig/componentconfig.py 2014-07-06 10:25:15 +0000
4825+++ reahl-doc/reahl/doc/examples/tutorial/componentconfig/componentconfig.py 2014-09-04 15:41:33 +0000
4826@@ -1,10 +1,10 @@
4827
4828
4829-from __future__ import unicode_literals
4830-from __future__ import print_function
4831-import elixir
4832-
4833-from reahl.sqlalchemysupport import Session, metadata
4834+from __future__ import print_function, unicode_literals, absolute_import, division
4835+
4836+from sqlalchemy import Column, Integer, UnicodeText
4837+
4838+from reahl.sqlalchemysupport import Session, Base
4839
4840 from reahl.web.fw import UserInterface, Widget
4841 from reahl.web.ui import TwoColumnPage, Form, TextInput, LabelledBlockInput, Button, Panel, P, H, InputGroup
4842@@ -35,7 +35,7 @@
4843 if config.componentconfig.showheader:
4844 self.add_child(H(view, 1, text='Addresses'))
4845
4846- for address in Address.query.all():
4847+ for address in Session.query(Address).all():
4848 self.add_child(AddressBox(view, address))
4849
4850 self.add_child(AddAddressForm(view))
4851@@ -61,12 +61,12 @@
4852 self.add_child(P(view, text='%s: %s' % (address.name, address.email_address)))
4853
4854
4855-class Address(elixir.Entity):
4856- elixir.using_options(session=Session, metadata=metadata, tablename='tutorial_componentconfig_address')
4857- elixir.using_mapper_options(save_on_init=False)
4858+class Address(Base):
4859+ __tablename__ = 'tutorial_componentconfig_address'
4860
4861- email_address = elixir.Field(elixir.UnicodeText)
4862- name = elixir.Field(elixir.UnicodeText)
4863+ id = Column(Integer, primary_key=True)
4864+ email_address = Column(UnicodeText)
4865+ name = Column(UnicodeText)
4866
4867 @exposed
4868 def fields(self, fields):
4869
4870=== modified file 'reahl-doc/reahl/doc/examples/tutorial/componentconfig/componentconfig_dev/componentconfigtests.py'
4871--- reahl-doc/reahl/doc/examples/tutorial/componentconfig/componentconfig_dev/componentconfigtests.py 2014-08-12 12:12:15 +0000
4872+++ reahl-doc/reahl/doc/examples/tutorial/componentconfig/componentconfig_dev/componentconfigtests.py 2014-09-04 15:41:33 +0000
4873@@ -1,6 +1,5 @@
4874
4875-from __future__ import unicode_literals
4876-from __future__ import print_function
4877+from __future__ import print_function, unicode_literals, absolute_import, division
4878
4879
4880 from reahl.tofu import test
4881
4882=== modified file 'reahl-doc/reahl/doc/examples/tutorial/componentconfig/etc/componentconfig.config.py'
4883--- reahl-doc/reahl/doc/examples/tutorial/componentconfig/etc/componentconfig.config.py 2014-07-06 10:25:15 +0000
4884+++ reahl-doc/reahl/doc/examples/tutorial/componentconfig/etc/componentconfig.config.py 2014-09-04 15:41:33 +0000
4885@@ -1,3 +1,2 @@
4886-from __future__ import unicode_literals
4887-from __future__ import print_function
4888+from __future__ import print_function, unicode_literals, absolute_import, division
4889 componentconfig.showheader = True
4890
4891=== modified file 'reahl-doc/reahl/doc/examples/tutorial/componentconfig/etc/web.config.py'
4892--- reahl-doc/reahl/doc/examples/tutorial/componentconfig/etc/web.config.py 2014-07-06 10:25:15 +0000
4893+++ reahl-doc/reahl/doc/examples/tutorial/componentconfig/etc/web.config.py 2014-09-04 15:41:33 +0000
4894@@ -1,7 +1,6 @@
4895
4896
4897-from __future__ import unicode_literals
4898-from __future__ import print_function
4899+from __future__ import print_function, unicode_literals, absolute_import, division
4900 from reahl.doc.examples.tutorial.componentconfig.componentconfig import AddressBookUI
4901
4902 web.site_root = AddressBookUI
4903
4904=== modified file 'reahl-doc/reahl/doc/examples/tutorial/datatable/.reahlproject'
4905--- reahl-doc/reahl/doc/examples/tutorial/datatable/.reahlproject 2014-08-07 11:28:56 +0000
4906+++ reahl-doc/reahl/doc/examples/tutorial/datatable/.reahlproject 2014-09-04 15:41:33 +0000
4907@@ -3,7 +3,7 @@
4908 <egg name="reahl-web"/>
4909 <egg name="reahl-component"/>
4910 <egg name="reahl-sqlalchemysupport"/>
4911- <egg name="reahl-web-elixirimpl"/>
4912+ <egg name="reahl-web-declarative"/>
4913 </deps>
4914
4915 <deps purpose="test">
4916
4917=== modified file 'reahl-doc/reahl/doc/examples/tutorial/datatable/datatable.py'
4918--- reahl-doc/reahl/doc/examples/tutorial/datatable/datatable.py 2014-08-07 11:28:56 +0000
4919+++ reahl-doc/reahl/doc/examples/tutorial/datatable/datatable.py 2014-09-04 15:41:33 +0000
4920@@ -1,15 +1,15 @@
4921
4922
4923-from __future__ import unicode_literals
4924-from __future__ import print_function
4925-import elixir
4926+from __future__ import print_function, unicode_literals, absolute_import, division
4927+
4928+from sqlalchemy import Column, Integer, UnicodeText
4929 from sqlalchemy.orm.exc import NoResultFound
4930
4931-from reahl.sqlalchemysupport import Session, metadata
4932+from reahl.sqlalchemysupport import Session, Base
4933
4934 from reahl.web.fw import CannotCreate, UrlBoundView, UserInterface
4935-from reahl.web.ui import Button, Form, H, HMenu, InputGroup, LabelledBlockInput, A, CheckboxInput
4936 from reahl.web.ui import Panel, P, TextInput, TwoColumnPage, StaticColumn, DynamicColumn
4937+from reahl.web.ui import Button, Form, H, HMenu, InputGroup, LabelledBlockInput, A
4938 from reahl.web.table import DataTable
4939 from reahl.component.modelinterface import exposed, EmailField, Field, Event, IntegerField, Action, BooleanField
4940
4941@@ -24,7 +24,7 @@
4942 class EditView(UrlBoundView):
4943 def assemble(self, address_id=None):
4944 try:
4945- address = Address.query.filter_by(id=address_id).one()
4946+ address = Session.query(Address).filter_by(id=address_id).one()
4947 except NoResultFound:
4948 raise CannotCreate()
4949
4950@@ -90,7 +90,7 @@
4951 self.add_child(data_table)
4952
4953 def initialise_rows(self):
4954- return [Row(address) for address in Address.query.all()]
4955+ return [Row(address) for address in Session.query(Address).all()]
4956
4957
4958 class EditAddressForm(Form):
4959@@ -127,13 +127,13 @@
4960 par.add_child(Button(self, address.events.edit.with_arguments(address_id=address.id)))
4961
4962
4963-class Address(elixir.Entity):
4964- elixir.using_options(session=Session, metadata=metadata, tablename='tutorial_datatable_address')
4965- elixir.using_mapper_options(save_on_init=False)
4966-
4967- email_address = elixir.Field(elixir.UnicodeText)
4968- name = elixir.Field(elixir.UnicodeText)
4969- zip_code = elixir.Field(elixir.Integer)
4970+class Address(Base):
4971+ __tablename__ = 'datatable_address'
4972+
4973+ id = Column(Integer, primary_key=True)
4974+ email_address = Column(UnicodeText)
4975+ name = Column(UnicodeText)
4976+ zip_code = Column(Integer)
4977
4978 @exposed
4979 def fields(self, fields):
4980@@ -148,5 +148,3 @@
4981
4982 def save(self):
4983 Session.add(self)
4984-
4985-
4986
4987=== modified file 'reahl-doc/reahl/doc/examples/tutorial/datatable/datatable_dev/datatabletests.py'
4988--- reahl-doc/reahl/doc/examples/tutorial/datatable/datatable_dev/datatabletests.py 2014-08-12 12:12:48 +0000
4989+++ reahl-doc/reahl/doc/examples/tutorial/datatable/datatable_dev/datatabletests.py 2014-09-04 15:41:33 +0000
4990@@ -1,5 +1,4 @@
4991-from __future__ import unicode_literals
4992-from __future__ import print_function
4993+from __future__ import print_function, unicode_literals, absolute_import, division
4994 from reahl.tofu import test
4995
4996 from reahl.web_dev.fixtures import WebFixture
4997@@ -15,7 +14,7 @@
4998 return Browser(self.new_wsgi_app(site_root=AddressBookUI))
4999
5000 def new_addresses(self):
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches