MacroSignage 0.1.dev36__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. macrosignage-0.2.0/PKG-INFO +86 -0
  2. macrosignage-0.2.0/README.md +57 -0
  3. macrosignage-0.2.0/pyproject.toml +57 -0
  4. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/__init__.py +4 -8
  5. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/core/__init__.py +10 -3
  6. macrosignage-0.2.0/src/macrosignage/cli.py +21 -0
  7. macrosignage-0.2.0/src/macrosignage/extensions.py +41 -0
  8. MacroSignage-0.1.dev36/MANIFEST.in +0 -6
  9. MacroSignage-0.1.dev36/PKG-INFO +0 -18
  10. MacroSignage-0.1.dev36/README.md +0 -1
  11. MacroSignage-0.1.dev36/pyproject.toml +0 -13
  12. MacroSignage-0.1.dev36/requirements.txt +0 -29
  13. MacroSignage-0.1.dev36/setup.cfg +0 -46
  14. MacroSignage-0.1.dev36/src/MacroSignage.egg-info/PKG-INFO +0 -18
  15. MacroSignage-0.1.dev36/src/MacroSignage.egg-info/SOURCES.txt +0 -40
  16. MacroSignage-0.1.dev36/src/MacroSignage.egg-info/dependency_links.txt +0 -1
  17. MacroSignage-0.1.dev36/src/MacroSignage.egg-info/requires.txt +0 -8
  18. MacroSignage-0.1.dev36/src/MacroSignage.egg-info/top_level.txt +0 -1
  19. MacroSignage-0.1.dev36/src/macrosignage/extensions.py +0 -82
  20. MacroSignage-0.1.dev36/src/wsgi.py +0 -6
  21. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/.gitignore +0 -0
  22. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/LICENSE +0 -0
  23. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/__init__.py +0 -0
  24. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/core/forms.py +0 -0
  25. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/core/models.py +0 -0
  26. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/core/templates/core/display.html +0 -0
  27. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/core/templates/core/display_list.html +0 -0
  28. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/core/templates/core/display_slides.html +0 -0
  29. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/core/templates/core/index.html +0 -0
  30. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/blueprints/core/templates/core/slides.html +0 -0
  31. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/config.py +0 -0
  32. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/css/animate.css +0 -0
  33. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/css/animate.min.css +0 -0
  34. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/css/icons.css +0 -0
  35. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/css/icons.min.css +0 -0
  36. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/css/main.css +0 -0
  37. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/css/main.min.css +0 -0
  38. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/css/materialize.css +0 -0
  39. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/css/materialize.min.css +0 -0
  40. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/js/main.js +0 -0
  41. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/js/main.min.js +0 -0
  42. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/js/materialize.js +0 -0
  43. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/static/js/materialize.min.js +0 -0
  44. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/ui/templates/layouts/base.html +0 -0
  45. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/utils/__init__.py +0 -0
  46. {MacroSignage-0.1.dev36 → macrosignage-0.2.0}/src/macrosignage/utils/sql.py +0 -0
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: MacroSignage
3
+ Version: 0.2.0
4
+ Summary: Web-based Digital Signage System
5
+ Project-URL: Homepage, https://github.com/baezfb/MacroSignage
6
+ Project-URL: Bug Tracker, https://github.com/baezfb/MacroSignage/issues
7
+ Author-email: Javier Baez <baezdevs@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Web Environment
12
+ Classifier: Framework :: Flask
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.10
20
+ Requires-Dist: email-validator>=2.0
21
+ Requires-Dist: flask-login>=0.6
22
+ Requires-Dist: flask-sqlalchemy>=3.1
23
+ Requires-Dist: flask-wtf>=1.2
24
+ Requires-Dist: flask>=3.1
25
+ Requires-Dist: python-dotenv>=1.0
26
+ Requires-Dist: python-slugify>=8.0
27
+ Requires-Dist: python-usernames>=1.0
28
+ Description-Content-Type: text/markdown
29
+
30
+ # MacroSignage
31
+
32
+ A web-based digital signage system built with Flask. Create, manage, and display
33
+ dynamic signage content from any browser.
34
+
35
+ ## Features
36
+
37
+ - Web-based administration interface
38
+ - User authentication and management
39
+ - Template-driven signage displays
40
+ - File upload support for media content
41
+ - SQLite database (no external database required)
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install macrosignage
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ Run the built-in development server:
52
+
53
+ ```bash
54
+ macrosignage
55
+ ```
56
+
57
+ This starts the application at `http://127.0.0.1:5000`. Visit
58
+ `http://127.0.0.1:5000/init-db` on first run to initialize the database.
59
+
60
+ ### Options
61
+
62
+ ```bash
63
+ macrosignage --host=0.0.0.0 --port=8080 --debug
64
+ ```
65
+
66
+ ### Using Flask directly
67
+
68
+ ```bash
69
+ export FLASK_APP=macrosignage:macro_signage_app
70
+ flask run
71
+ ```
72
+
73
+ ## Development
74
+
75
+ Clone the repository and install with development dependencies:
76
+
77
+ ```bash
78
+ git clone https://github.com/baezfb/MacroSignage.git
79
+ cd MacroSignage
80
+ uv sync
81
+ uv run macrosignage --debug
82
+ ```
83
+
84
+ ## License
85
+
86
+ MIT License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,57 @@
1
+ # MacroSignage
2
+
3
+ A web-based digital signage system built with Flask. Create, manage, and display
4
+ dynamic signage content from any browser.
5
+
6
+ ## Features
7
+
8
+ - Web-based administration interface
9
+ - User authentication and management
10
+ - Template-driven signage displays
11
+ - File upload support for media content
12
+ - SQLite database (no external database required)
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pip install macrosignage
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ Run the built-in development server:
23
+
24
+ ```bash
25
+ macrosignage
26
+ ```
27
+
28
+ This starts the application at `http://127.0.0.1:5000`. Visit
29
+ `http://127.0.0.1:5000/init-db` on first run to initialize the database.
30
+
31
+ ### Options
32
+
33
+ ```bash
34
+ macrosignage --host=0.0.0.0 --port=8080 --debug
35
+ ```
36
+
37
+ ### Using Flask directly
38
+
39
+ ```bash
40
+ export FLASK_APP=macrosignage:macro_signage_app
41
+ flask run
42
+ ```
43
+
44
+ ## Development
45
+
46
+ Clone the repository and install with development dependencies:
47
+
48
+ ```bash
49
+ git clone https://github.com/baezfb/MacroSignage.git
50
+ cd MacroSignage
51
+ uv sync
52
+ uv run macrosignage --debug
53
+ ```
54
+
55
+ ## License
56
+
57
+ MIT License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,57 @@
1
+ [project]
2
+ name = "MacroSignage"
3
+ dynamic = ["version"]
4
+ description = "Web-based Digital Signage System"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.10"
8
+ authors = [
9
+ { name = "Javier Baez", email = "baezdevs@gmail.com" },
10
+ ]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Environment :: Web Environment",
14
+ "Framework :: Flask",
15
+ "Programming Language :: Python :: 3.10",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "Programming Language :: Python :: 3.13",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ ]
22
+ dependencies = [
23
+ "Flask>=3.1",
24
+ "Flask-Login>=0.6",
25
+ "Flask-WTF>=1.2",
26
+ "Flask-SQLAlchemy>=3.1",
27
+ "python-dotenv>=1.0",
28
+ "python-slugify>=8.0",
29
+ "python-usernames>=1.0",
30
+ "email-validator>=2.0",
31
+ ]
32
+
33
+ [project.scripts]
34
+ macrosignage = "macrosignage.cli:main"
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/baezfb/MacroSignage"
38
+ "Bug Tracker" = "https://github.com/baezfb/MacroSignage/issues"
39
+
40
+ [build-system]
41
+ requires = ["hatchling", "hatch-vcs"]
42
+ build-backend = "hatchling.build"
43
+
44
+ [tool.hatch.version]
45
+ source = "vcs"
46
+
47
+ [tool.hatch.build.targets.wheel]
48
+ packages = ["src/macrosignage"]
49
+
50
+ [tool.hatch.build.targets.sdist]
51
+ exclude = [
52
+ "/.claude/",
53
+ "/.gitignore",
54
+ "/.idea/",
55
+ "/uv.lock",
56
+ "/src/wsgi.py",
57
+ ]
@@ -48,14 +48,6 @@ def macro_signage_app(instance_path=None):
48
48
  # Load instance config overriding default config
49
49
  app.config.from_pyfile(application_instance_config_file, silent=True)
50
50
 
51
- @app.before_first_request
52
- def before_first_request():
53
- """
54
- Execute before first request.
55
- """
56
- from .extensions import db
57
- db.create_all()
58
-
59
51
  @app.route('/uploads/<path:filename>')
60
52
  def download_file(filename):
61
53
  """
@@ -81,4 +73,8 @@ def macro_signage_app(instance_path=None):
81
73
  for extension in extensions:
82
74
  extension.init_app(app)
83
75
 
76
+ with app.app_context():
77
+ from .extensions import db
78
+ db.create_all()
79
+
84
80
  return app
@@ -12,11 +12,18 @@ from .forms import SlideForm
12
12
  core = Blueprint('core', __name__, template_folder='templates')
13
13
 
14
14
 
15
- @core.before_app_first_request
16
- def before_app_first_request():
15
+ _initialized = False
16
+
17
+
18
+ @core.before_app_request
19
+ def ensure_default_displays():
17
20
  """
18
- Execute before first request.
21
+ Ensure default displays exist (runs once on the first request).
19
22
  """
23
+ global _initialized
24
+ if _initialized:
25
+ return
26
+ _initialized = True
20
27
  d = Display.query.filter_by(name='Default').first()
21
28
  if d is None:
22
29
  Display.insert_default_displays()
@@ -0,0 +1,21 @@
1
+ import sys
2
+
3
+
4
+ def main():
5
+ """Run the MacroSignage development server."""
6
+ from macrosignage import macro_signage_app
7
+
8
+ host = "127.0.0.1"
9
+ port = 5000
10
+ debug = False
11
+
12
+ for arg in sys.argv[1:]:
13
+ if arg.startswith("--host="):
14
+ host = arg.split("=", 1)[1]
15
+ elif arg.startswith("--port="):
16
+ port = int(arg.split("=", 1)[1])
17
+ elif arg == "--debug":
18
+ debug = True
19
+
20
+ app = macro_signage_app()
21
+ app.run(host=host, port=port, debug=debug)
@@ -0,0 +1,41 @@
1
+ from flask_sqlalchemy import SQLAlchemy
2
+ import sqlalchemy as sa
3
+ from sqlalchemy.orm import declared_attr, DeclarativeBase
4
+
5
+
6
+ class MSModel(DeclarativeBase):
7
+ """
8
+ MACRO SIGNAGE MODEL
9
+
10
+ This class is used to provide a common interface for all models.
11
+ """
12
+ __allow_unmapped__ = True
13
+
14
+ @declared_attr.directive
15
+ def __tablename__(cls):
16
+ return cls.__name__.lower()
17
+
18
+ @declared_attr
19
+ def id(cls):
20
+ for base in cls.__mro__[1:-1]:
21
+ if getattr(base, '__table__', None) is not None:
22
+ rtype = sa.ForeignKey(base.id, ondelete='CASCADE')
23
+ break
24
+ else:
25
+ rtype = sa.Integer()
26
+ return sa.Column(rtype, primary_key=True)
27
+
28
+ @declared_attr
29
+ def created_at(cls):
30
+ return sa.Column(sa.DateTime, default=sa.func.now())
31
+
32
+ @declared_attr
33
+ def updated_at(cls):
34
+ return sa.Column(sa.DateTime, default=sa.func.now(), onupdate=sa.func.now())
35
+
36
+
37
+ db = SQLAlchemy(model_class=MSModel)
38
+
39
+ extensions = [
40
+ db,
41
+ ]
@@ -1,6 +0,0 @@
1
- include *.txt
2
- recursive-include src *.html
3
- recursive-include src *.min.css
4
- recursive-include src *.min.js
5
- recursive-include src *.json
6
- recursive-include src *.woff2
@@ -1,18 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: MacroSignage
3
- Version: 0.1.dev36
4
- Summary: Web-based Digital Signage System
5
- Home-page: https://github.com/baezfb/MacroSignage
6
- Author: Javier Baez
7
- Author-email: baezdevs@gmail.com
8
- Project-URL: Bug Tracker, https://github.com/baezfb/MacroSignage/issues
9
- Classifier: Development Status :: 1 - Planning
10
- Classifier: Environment :: Web Environment
11
- Classifier: Framework :: Flask
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Operating System :: OS Independent
15
- Requires-Python: >=3.8
16
- License-File: LICENSE
17
-
18
- # MacroSignage
@@ -1 +0,0 @@
1
- # MacroSignage
@@ -1,13 +0,0 @@
1
- [build-system]
2
- requires = [
3
- "setuptools>=63",
4
- "setuptools_scm[toml]>=7.0.5",
5
- "wheel",
6
- ]
7
-
8
- build-backend = "setuptools.build_meta"
9
-
10
- [tool.setuptools_scm]
11
- version_scheme = "release-branch-semver"
12
- local_scheme = "no-local-version"
13
- write_to = "src/__version__.py"
@@ -1,29 +0,0 @@
1
- build==0.8.0
2
- click==8.1.3
3
- dnspython==2.2.1
4
- email-validator==1.2.1
5
- Flask==2.1.3
6
- Flask-Login==0.6.2
7
- Flask-SQLAlchemy==2.5.1
8
- Flask-WTF==1.0.1
9
- greenlet==1.1.2
10
- idna==3.3
11
- importlib-metadata==4.12.0
12
- itsdangerous==2.1.2
13
- Jinja2==3.1.2
14
- -e git+https://github.com/baezfb/MacroSignage.git@b5383ac4f955d82914005e27e87b42a8dff303a6#egg=MacroSignage
15
- MarkupSafe==2.1.1
16
- packaging==21.3
17
- pep517==0.12.0
18
- pyparsing==3.0.9
19
- python-dotenv==0.20.0
20
- python-slugify==6.1.2
21
- python-usernames==0.3.1
22
- setuptools-scm==7.0.5
23
- SQLAlchemy==1.4.39
24
- text-unidecode==1.3
25
- tomli==2.0.1
26
- typing_extensions==4.3.0
27
- Werkzeug==2.2.1
28
- WTForms==3.0.1
29
- zipp==3.8.1
@@ -1,46 +0,0 @@
1
- [metadata]
2
- name = MacroSignage
3
- dynamic = version
4
- author = Javier Baez
5
- author_email = baezdevs@gmail.com
6
- description = Web-based Digital Signage System
7
- long_description = file:README.md
8
- url = https://github.com/baezfb/MacroSignage
9
- project_urls =
10
- Bug Tracker = https://github.com/baezfb/MacroSignage/issues
11
- classifiers =
12
- Development Status :: 1 - Planning
13
- Environment :: Web Environment
14
- Framework :: Flask
15
- Programming Language :: Python :: 3.8
16
- License :: OSI Approved :: MIT License
17
- Operating System :: OS Independent
18
-
19
- [options]
20
- setup_requires = setuptools_scm
21
- package_dir =
22
- = src
23
- packages = find:
24
- python_requires = >=3.8
25
- install_requires =
26
- Flask>=2.1.3
27
- Flask-Login>=0.6.1
28
- Flask-WTF>=1.0.1
29
- Flask-SQLAlchemy>=2.5.1
30
- python-dotenv>=0.20.0
31
- python-slugify>=6.1.2
32
- python-usernames>=0.3.1
33
- email-validator>=1.2.1
34
- include_package_data = True
35
-
36
- [options.packages.find]
37
- where = src
38
- exclude = tests, tests.*, wsgi.py
39
-
40
- [tools.setuptools.dynamic]
41
- version = {attr = "macrosignage.__version__"}
42
-
43
- [egg_info]
44
- tag_build =
45
- tag_date = 0
46
-
@@ -1,18 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: MacroSignage
3
- Version: 0.1.dev36
4
- Summary: Web-based Digital Signage System
5
- Home-page: https://github.com/baezfb/MacroSignage
6
- Author: Javier Baez
7
- Author-email: baezdevs@gmail.com
8
- Project-URL: Bug Tracker, https://github.com/baezfb/MacroSignage/issues
9
- Classifier: Development Status :: 1 - Planning
10
- Classifier: Environment :: Web Environment
11
- Classifier: Framework :: Flask
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Operating System :: OS Independent
15
- Requires-Python: >=3.8
16
- License-File: LICENSE
17
-
18
- # MacroSignage
@@ -1,40 +0,0 @@
1
- .gitignore
2
- LICENSE
3
- MANIFEST.in
4
- README.md
5
- pyproject.toml
6
- requirements.txt
7
- setup.cfg
8
- src/wsgi.py
9
- src/MacroSignage.egg-info/PKG-INFO
10
- src/MacroSignage.egg-info/SOURCES.txt
11
- src/MacroSignage.egg-info/dependency_links.txt
12
- src/MacroSignage.egg-info/requires.txt
13
- src/MacroSignage.egg-info/top_level.txt
14
- src/macrosignage/__init__.py
15
- src/macrosignage/config.py
16
- src/macrosignage/extensions.py
17
- src/macrosignage/blueprints/__init__.py
18
- src/macrosignage/blueprints/core/__init__.py
19
- src/macrosignage/blueprints/core/forms.py
20
- src/macrosignage/blueprints/core/models.py
21
- src/macrosignage/blueprints/core/templates/core/display.html
22
- src/macrosignage/blueprints/core/templates/core/display_list.html
23
- src/macrosignage/blueprints/core/templates/core/display_slides.html
24
- src/macrosignage/blueprints/core/templates/core/index.html
25
- src/macrosignage/blueprints/core/templates/core/slides.html
26
- src/macrosignage/ui/static/css/animate.css
27
- src/macrosignage/ui/static/css/animate.min.css
28
- src/macrosignage/ui/static/css/icons.css
29
- src/macrosignage/ui/static/css/icons.min.css
30
- src/macrosignage/ui/static/css/main.css
31
- src/macrosignage/ui/static/css/main.min.css
32
- src/macrosignage/ui/static/css/materialize.css
33
- src/macrosignage/ui/static/css/materialize.min.css
34
- src/macrosignage/ui/static/js/main.js
35
- src/macrosignage/ui/static/js/main.min.js
36
- src/macrosignage/ui/static/js/materialize.js
37
- src/macrosignage/ui/static/js/materialize.min.js
38
- src/macrosignage/ui/templates/layouts/base.html
39
- src/macrosignage/utils/__init__.py
40
- src/macrosignage/utils/sql.py
@@ -1,8 +0,0 @@
1
- Flask>=2.1.3
2
- Flask-Login>=0.6.1
3
- Flask-WTF>=1.0.1
4
- Flask-SQLAlchemy>=2.5.1
5
- python-dotenv>=0.20.0
6
- python-slugify>=6.1.2
7
- python-usernames>=0.3.1
8
- email-validator>=1.2.1
@@ -1 +0,0 @@
1
- macrosignage
@@ -1,82 +0,0 @@
1
- from flask_sqlalchemy import Model, SQLAlchemy
2
- import sqlalchemy as sa
3
- from sqlalchemy.ext.declarative import declared_attr, has_inherited_table
4
-
5
-
6
- class MSModel(Model):
7
- """
8
- MACRO SIGNAGE MODEL
9
-
10
- This class is used to provide a common interface for all models.
11
-
12
- Args:
13
- Model: SQLAlchemy model class.
14
-
15
- Returns:
16
- None
17
- """
18
-
19
- @declared_attr
20
- def __tablename__(cls):
21
- """
22
- Get the table name for the current model.
23
-
24
- Args:
25
- cls: The current model class.
26
-
27
- Returns:
28
- Table name in lowercase.
29
- """
30
- return cls.__name__.lower()
31
-
32
- @declared_attr
33
- def id(cls):
34
- """
35
- Primary key.
36
-
37
- Args:
38
- cls: Class.
39
-
40
- Returns:
41
- Primary key.
42
- """
43
- for base in cls.__mro__[1:-1]:
44
- if getattr(base, '__table__', None) is not None:
45
- rtype = sa.ForeignKey(base.id, ondelete='CASCADE')
46
- break
47
- else:
48
- rtype = sa.Integer()
49
- return sa.Column(rtype, primary_key=True)
50
-
51
- @declared_attr
52
- def created_at(cls):
53
- """
54
- Adds created_at column to model.
55
-
56
- Args:
57
- cls: Class.
58
-
59
- Returns:
60
- Created column with default value of current timestamp.
61
- """
62
- return sa.Column(sa.DateTime, default=sa.func.now())
63
-
64
- @declared_attr
65
- def updated_at(cls):
66
- """
67
- Adds updated_at column to model.
68
-
69
- Args:
70
- cls: Class.
71
-
72
- Returns:
73
- Updated column with default value of current timestamp and onupdate value of current timestamp.
74
- """
75
- return sa.Column(sa.DateTime, default=sa.func.now(), onupdate=sa.func.now())
76
-
77
-
78
- db = SQLAlchemy(model_class=MSModel)
79
-
80
- extensions = [
81
- db,
82
- ]
@@ -1,6 +0,0 @@
1
- from macrosignage import macro_signage_app
2
-
3
- app = macro_signage_app()
4
-
5
- if __name__ == '__main__':
6
- app.run(debug=True)
File without changes