source: OpenWorkouts-current/ow/models/__init__.py @ 5ec3a0b

currentfeature/docs
Last change on this file since 5ec3a0b was 5ec3a0b, checked in by borja <borja@…>, 5 years ago

Imported sources from the old python2-only repository:

  • Modified the code so it is python 3.6 compatible
  • Fixed deprecation warnings, pyramid 1.10.x supported now
  • Fixed deprecation warnings about some libraries, like pyramid-simpleform
  • Added pytest-pycodestyle and pytest-flakes for automatic checks on the source code files when running tests.
  • Added default pytest.ini setup to enforce some default parameters when running tests.
  • Cleaned up the code a bit, catched up with tests coverage.
  • Property mode set to 100644
File size: 377 bytes
Line 
1import transaction
2
3from ow.models.root import OpenWorkouts
4from ow.catalog import get_catalog
5
6
7def appmaker(zodb_root):
8    if 'app_root' not in zodb_root:
9        app_root = OpenWorkouts()
10        zodb_root['app_root'] = app_root
11        transaction.commit()
12        # initialize the catalog for the first time
13        get_catalog(app_root)
14    return zodb_root['app_root']
Note: See TracBrowser for help on using the repository browser.