Skip to content

Commit

Permalink
Add management command run_ontology_script
Browse files Browse the repository at this point in the history
  • Loading branch information
katharinawuensche committed Nov 22, 2023
1 parent c0cd027 commit b1d1a00
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**/__pycache__
*.db
*.lock
.env
apis_ontology/settings/local_settings.py
Empty file.
20 changes: 20 additions & 0 deletions apis_ontology/management/commands/run_ontology_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# from apis_core.apis_entities.models import *
# from apis_core.apis_relations.models import *
# from apis_core.apis_vocabularies.models import *
from django.core.management.base import BaseCommand
import importlib

# import random


class Command(BaseCommand):
def handle(self, *args, **options):

script = importlib.import_module(
f"apis_ontology.ontology_specific_scripts.{options['ontology_script']}"
)
script.run()

def add_arguments(self, parser):

parser.add_argument("ontology_script")
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ python = "^3.11"
apis-core = { git = "https://github.com/acdh-oeaw/apis-core-rdf.git", tag = "v0.7.0" }
apis-acdhch-default-settings = { git = "https://github.com/acdh-oeaw/apis-acdhch-default-settings", tag = "v0.1.9" }
psycopg2 = "^2.9.6"
lxml = "^4.9.3"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit b1d1a00

Please sign in to comment.