Skip to content

Commit 96cbab0

Browse files
committed
Fix example migration and tests
Update gitignore
1 parent 681b5aa commit 96cbab0

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pip-delete-this-directory.txt
3333

3434
# Tox
3535
.tox/
36+
.cache/
37+
.python-version
3638

3739
# VirtualEnv
3840
.venv/

example/migrations/0002_auto_20160513_0857.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
# -*- coding: utf-8 -*-
22
# Generated by Django 1.9.6 on 2016-05-13 08:57
33
from __future__ import unicode_literals
4+
from distutils.version import LooseVersion
45

56
from django.db import migrations, models
67
import django.db.models.deletion
8+
import django
79

810

911
class Migration(migrations.Migration):
1012

11-
dependencies = [
12-
('contenttypes', '0002_remove_content_type_name'),
13-
('example', '0001_initial'),
14-
]
13+
# TODO: Must be removed as soon as Django 1.7 support is dropped
14+
if django.get_version() < LooseVersion('1.8'):
15+
dependencies = [
16+
('contenttypes', '0001_initial'),
17+
('example', '0001_initial'),
18+
]
19+
else:
20+
dependencies = [
21+
('contenttypes', '0002_remove_content_type_name'),
22+
('example', '0001_initial'),
23+
]
1524

1625
operations = [
1726
migrations.CreateModel(

0 commit comments

Comments
 (0)