Exemplo n.º 1
0
    def run(self, email):
        app.configure(SQLALCHEMY_ECHO=True)
        from blogpy.models import User

        email = email.decode("utf-8")
        user = User.query.filter_by(email=email).first()
        if not user:
            user = User(u"", email, u"write")
        else:
            user.access = u"write"
        db.session.add(user)
        db.session.commit()
Exemplo n.º 2
0
# Copyright (C) 2011 Bohdan Kanskyj
#
# blogpy - blog engine written in Python using Flask
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.

import sys
from os.path import dirname, abspath

sys.path.append(abspath(dirname(__file__)))

from blogpy import app as application

application.configure()
Exemplo n.º 3
0
 def run(*args, **kwargs):
     app.configure(SQLALCHEMY_ECHO=True)
     Shell.run(*args, **kwargs)
Exemplo n.º 4
0
 def handle(*args, **kwargs):
     app.configure(DEBUG=True)
     Server.handle(*args, **kwargs)
Exemplo n.º 5
0
 def run(self):
     if prompt_bool("Are you sure you want to lose all your data"):
         app.configure(SQLALCHEMY_ECHO=True)
         db.drop_all()
Exemplo n.º 6
0
 def run(self):
     app.configure(SQLALCHEMY_ECHO=True)
     db.create_all()