Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to launch tenant_command loaddata from views with fixtures #685

Open
guillaumensft opened this issue Jul 1, 2022 · 1 comment
Open

Comments

@guillaumensft
Copy link

python manage.py tenant_command loaddata --schema="superchef" core\fixtures\fixtures.json from the views

@guillaumensft
Copy link
Author

def loaddata(self, schema, file):
    if os.path.splitext(file)[1] == '.json' and file != 'initial_data.json':
        schema = f'--schema="{schema}"'
        os.system(f"python manage.py tenant_command loaddata {schema} {file}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant