diff --git a/ckanext/pages/cli.py b/ckanext/pages/cli.py deleted file mode 100644 index 5c837aa..0000000 --- a/ckanext/pages/cli.py +++ /dev/null @@ -1,24 +0,0 @@ -import click -import ckanext.pages.db as db - - -def get_commands(): - return [pages] - - -@click.group() -def pages(): - pass - - -@pages.command() -def initdb(): - """Adds simple pages to ckan - - Usage: - - pages initdb - - Creates the necessary tables in the database - """ - db.init_db() - click.secho(u"DB tables created", fg=u"green") diff --git a/ckanext/pages/db.py b/ckanext/pages/db.py index 9aa1925..29242b5 100644 --- a/ckanext/pages/db.py +++ b/ckanext/pages/db.py @@ -34,14 +34,6 @@ def make_uuid(): return text_type(uuid.uuid4()) -def init_db(): - if pages_table is None: - define_tables() - - if not pages_table.exists(): - pages_table.create() - - class Page(DomainObject, BaseModel): __tablename__ = "ckanext_pages" diff --git a/ckanext/pages/plugin.py b/ckanext/pages/plugin.py index 45763e8..6bffab0 100644 --- a/ckanext/pages/plugin.py +++ b/ckanext/pages/plugin.py @@ -97,14 +97,10 @@ class PagesPlugin(PagesPluginBase): p.implements(p.IAuthFunctions, inherit=True) p.implements(p.IConfigurable, inherit=True) p.implements(p.IBlueprint) - p.implements(p.IClick) def get_blueprint(self): return [blueprint.pages] - def get_commands(self): - return cli.get_commands() - def update_config(self, config): self.organization_pages = tk.asbool(config.get('ckanext.pages.organization', False)) self.group_pages = tk.asbool(config.get('ckanext.pages.group', False))