summaryrefslogtreecommitdiff
path: root/lib/python2.7/site-packages/south/v2.py
diff options
context:
space:
mode:
authorttt2017-05-13 00:29:47 +0530
committerttt2017-05-13 00:29:47 +0530
commitabf599be33b383a6a5baf9493093b2126a622ac8 (patch)
tree4c5ab6e0d935d5e65fabcf0258e4a00dd20a5afa /lib/python2.7/site-packages/south/v2.py
downloadSBHS-2018-Rpi-abf599be33b383a6a5baf9493093b2126a622ac8.tar.gz
SBHS-2018-Rpi-abf599be33b383a6a5baf9493093b2126a622ac8.tar.bz2
SBHS-2018-Rpi-abf599be33b383a6a5baf9493093b2126a622ac8.zip
added all server files
Diffstat (limited to 'lib/python2.7/site-packages/south/v2.py')
-rw-r--r--lib/python2.7/site-packages/south/v2.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/python2.7/site-packages/south/v2.py b/lib/python2.7/site-packages/south/v2.py
new file mode 100644
index 0000000..22afed2
--- /dev/null
+++ b/lib/python2.7/site-packages/south/v2.py
@@ -0,0 +1,25 @@
+"""
+API versioning file; we can tell what kind of migrations things are
+by what class they inherit from (if none, it's a v1).
+"""
+
+from south.utils import ask_for_it_by_name
+
+class BaseMigration(object):
+
+ def gf(self, field_name):
+ "Gets a field by absolute reference."
+ field = ask_for_it_by_name(field_name)
+ field.model = FakeModel
+ return field
+
+class SchemaMigration(BaseMigration):
+ pass
+
+class DataMigration(BaseMigration):
+ # Data migrations shouldn't be dry-run
+ no_dry_run = True
+
+class FakeModel(object):
+ "Fake model so error messages on fields don't explode"
+ pass