|
@@ -23,7 +23,6 @@ warnings.simplefilter("always", FlaskBBPluginDeprecationWarning)
|
|
|
|
|
|
|
|
|
|
class FlaskBBPlugin(Plugin):
|
|
class FlaskBBPlugin(Plugin):
|
|
-
|
|
|
|
#: This is the :class:`SettingsGroup` key - if your the plugin needs to
|
|
#: This is the :class:`SettingsGroup` key - if your the plugin needs to
|
|
#: install additional things you must set it, else it won't install
|
|
#: install additional things you must set it, else it won't install
|
|
#: anything.
|
|
#: anything.
|
|
@@ -70,39 +69,3 @@ class FlaskBBPlugin(Plugin):
|
|
:param blueprint: The blueprint which should be registered.
|
|
:param blueprint: The blueprint which should be registered.
|
|
"""
|
|
"""
|
|
current_app.register_blueprint(blueprint, **kwargs)
|
|
current_app.register_blueprint(blueprint, **kwargs)
|
|
-
|
|
|
|
- def create_table(self, model, db):
|
|
|
|
- """Creates the relation for the model
|
|
|
|
-
|
|
|
|
- :param model: The Model which should be created
|
|
|
|
- :param db: The database instance.
|
|
|
|
- """
|
|
|
|
- if not model.__table__.exists(bind=db.engine):
|
|
|
|
- model.__table__.create(bind=db.engine)
|
|
|
|
-
|
|
|
|
- def drop_table(self, model, db):
|
|
|
|
- """Drops the relation for the bounded model.
|
|
|
|
-
|
|
|
|
- :param model: The model on which the table is bound.
|
|
|
|
- :param db: The database instance.
|
|
|
|
- """
|
|
|
|
- model.__table__.drop(bind=db.engine)
|
|
|
|
-
|
|
|
|
- def create_all_tables(self, models, db):
|
|
|
|
- """A interface for creating all models specified in ``models``.
|
|
|
|
-
|
|
|
|
- :param models: A list with models
|
|
|
|
- :param db: The database instance
|
|
|
|
- """
|
|
|
|
- for model in models:
|
|
|
|
- self.create_table(model, db)
|
|
|
|
-
|
|
|
|
- def drop_all_tables(self, models, db):
|
|
|
|
- """A interface for dropping all models specified in the
|
|
|
|
- variable ``models``.
|
|
|
|
-
|
|
|
|
- :param models: A list with models
|
|
|
|
- :param db: The database instance.
|
|
|
|
- """
|
|
|
|
- for model in models:
|
|
|
|
- self.drop_table(model, db)
|
|
|