I am writing a django model migration that will delete all existing objects (models) in the database.Can I warn the user before the actual migration? I want to remind the user to back up data before performing the migration.
Is it possible to take a raw_input()from the user and then continue if he really wants to?
raw_input()
How do I cancel a transition at runtime?
You can do whatever you want in RunPython, which includes a user input request and creating an exception to cancel the migration.
RunPython
, . , RunPython, , . , , .
Source: https://habr.com/ru/post/1605716/More articles:How to convert JSO to JSON? - jsonIs there a general way to find styles that apply to a view? - androidShowing common and specific validation errors at the same time with Ecto - elixirЗапустите R script с помощью программы JAVA - javaRun Rscript from Spring MVC with Wildfly 9 - spring-mvcHighlighting template arguments during partial ordering when parameters are a function parameter package - c ++How to mock SpringSecurityService in unit test - unit-testingHow to mock SpringSecurityService in unit tests using grails - spring-securityIs a state monad with two types of state variables (in and out) still a monad? - monadsC ++ compiler does not detect error in class template - c ++All Articles