From eeef20d88d2dda3f52907c84ee1ad2fa8e2e6c24 Mon Sep 17 00:00:00 2001 From: amercader Date: Fri, 12 Jul 2024 11:13:25 +0200 Subject: [PATCH] Remove init_db command --- ckanext/pages/cli.py | 24 ------------------------ ckanext/pages/db.py | 8 -------- ckanext/pages/plugin.py | 4 ---- 3 files changed, 36 deletions(-) delete mode 100644 ckanext/pages/cli.py diff --git a/ckanext/pages/cli.py b/ckanext/pages/cli.py deleted file mode 100644 index 5c837aa8..00000000 --- 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 9aa1925b..29242b5d 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 45763e8c..6bffab0e 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))