source: OpenWorkouts-current/ow/models/__init__.py

current
Last change on this file was fcf0ef3, checked in by Borja Lopez <borja@…>, 5 years ago

(#77) Bulk workouts upload:

  • Added a new Folder-like object under the root object to store compressed files
  • Added a new Blob-like object to store those compressed files into the database
  • Added the needed view/template code to handle adding/uploading compressed files that may contain workout tracking files + a page to see them per-user
  • Property mode set to 100644
File size: 460 bytes
Line 
1import transaction
2
3from ow.models.root import OpenWorkouts
4from ow.models.bulk import BulkFiles
5from ow.catalog import get_catalog
6
7
8def appmaker(zodb_root):
9    if 'app_root' not in zodb_root:
10        app_root = OpenWorkouts()
11        app_root['_bulk_files'] = BulkFiles()
12        zodb_root['app_root'] = app_root
13        transaction.commit()
14        # initialize the catalog for the first time
15        get_catalog(app_root)
16    return zodb_root['app_root']
Note: See TracBrowser for help on using the repository browser.