Esempio n. 1
0
    def action_db_migrate(action=('a', 'start'), debug=False):
        """Migrate database.
        This command is responsible for data base migrations.
        Actions:
        init - initiates migration module use only once.
        migrate - creates schema migration.
        upgrade - upgrades database using schema migrations.

        Options:
        - '--debug' use debug configuration
        """
        from flask.ext.migrate import upgrade, init, migrate, stamp, downgrade
        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            if action == 'init':
                init()
            elif action == 'migrate':
                migrate()
            elif action == 'upgrade':
                upgrade()
            elif action == 'stamp':
                stamp()
            elif action == 'downgrade':
                downgrade()
            else:
                print('Unknown action')
Esempio n. 2
0
    def action_db_migrate(action=('a', 'start'), debug=False):
        """Migrate database.
        This command is responsible for data base migrations.
        Actions:
        init - initiates migration module use only once.
        migrate - creates schema migration.
        upgrade - upgrades database using schema migrations.

        Options:
        - '--debug' use debug configuration
        """
        from flask.ext.migrate import upgrade, init, migrate, stamp, downgrade
        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            if action == 'init':
                init()
            elif action == 'migrate':
                migrate()
            elif action == 'upgrade':
                upgrade()
            elif action == 'stamp':
                stamp()
            elif action == 'downgrade':
                downgrade()
            else:
                print('Unknown action')
Esempio n. 3
0
    def action_send_rate_reminder(debug=False):
        """
        This command is responsible for sending every one who ate an
        e-mail that they did not rated the meal on current day at 14:00
        Options:
        - '--debug' use debug configuration
        """
        from .utils import send_rate_reminder

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            send_rate_reminder()
Esempio n. 4
0
    def action_unblock_ordering(debug=False):
        """
        This command is responsible for blocking or unblocking the ability
        to create new orders. Use on 00:01 every day.
        Options:
        - '--debug' use debug configuration
        """
        from .utils import change_ordering_status

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            change_ordering_status(True)
Esempio n. 5
0
    def action_add_koziolek(debug=False):
        """
        This command is responsible for adding meal of a day from pod koziolek.
        use in the morning from Monday to Friday.
        Options:
        - '--debug' use debug configuration
        """
        from .utils import add_daily_koziolek

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            add_daily_koziolek()
Esempio n. 6
0
    def action_add_tomas(debug=False):
        """
        This command is responsible for adding week menu from Tomas.
        use only on MONDAYS !
        Options:
        - '--debug' use debug configuration
        """
        from .utils import get_week_from_tomas

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            get_week_from_tomas()
Esempio n. 7
0
    def action_send_daily_reminder(debug=False):
        """
        This command is responsible for sending every one an reminding
        e-mail that they did not ordered on current day at 10:45
        Options:
        - '--debug' use debug configuration
        """
        from .utils import send_daily_reminder

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            send_daily_reminder()
Esempio n. 8
0
    def action_send_rate_reminder(debug=False):
        """
        This command is responsible for sending every one who ate an
        e-mail that they did not rated the meal on current day at 14:00
        Options:
        - '--debug' use debug configuration
        """
        from .utils import send_rate_reminder

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            send_rate_reminder()
Esempio n. 9
0
    def action_unblock_ordering(debug=False):
        """
        This command is responsible for blocking or unblocking the ability
        to create new orders. Use on 00:01 every day.
        Options:
        - '--debug' use debug configuration
        """
        from .utils import change_ordering_status

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            change_ordering_status(True)
Esempio n. 10
0
    def action_add_koziolek(debug=False):
        """
        This command is responsible for adding meal of a day from pod koziolek.
        use in the morning from Monday to Friday.
        Options:
        - '--debug' use debug configuration
        """
        from .utils import add_daily_koziolek

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            add_daily_koziolek()
Esempio n. 11
0
    def action_add_tomas(debug=False):
        """
        This command is responsible for adding week menu from Tomas.
        use only on MONDAYS !
        Options:
        - '--debug' use debug configuration
        """
        from .utils import get_week_from_tomas

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            get_week_from_tomas()
Esempio n. 12
0
    def action_send_daily_reminder(debug=False):
        """
        This command is responsible for sending every one an reminding
        e-mail that they did not ordered on current day at 10:45
        Options:
        - '--debug' use debug configuration
        """
        from .utils import send_daily_reminder

        if debug:
            app = make_debug(with_debug_layer=False)
        else:
            app = make_app()

        with app.app_context():
            send_daily_reminder()