SHARE
TWEET

Untitled

a guest Jul 24th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. python manage.py inspectdb --database=blah > you_app/models.py
  2.      
  3. def trigger_after_extract(request):
  4.     # inspectdb
  5.     print(request.GET.get('project'))
  6.     name = request.GET.get('project')
  7.  
  8.     # conn = name.connect(connect='postgres', user='postgres', password='g7mN5da1e2')
  9.     # connection.ensure_connection();
  10.  
  11.     test = connect_to_db(name)
  12.  
  13.     command = 'python manage.py inspectdb --database ' + name + ' > api_manager/schemas/' + name + '.py'
  14.     os.system(command)
  15.  
  16.     # append to __init__.py in project.schemas
  17.     # with open(--path--, 'a+') as file:
  18.     #     file.write(--thing-- + "n")
  19.     # pass
  20.     return JsonResponse({'json': test, 'oldJson': 'RESULT'})
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top