Merge lp:~linaro-infrastructure/linaro-ci-dashboard/integrate-django-south into lp:linaro-ci-dashboard

Proposed by Stevan Radaković
Status: Merged
Approved by: Данило Шеган
Approved revision: 8
Merged at revision: 9
Proposed branch: lp:~linaro-infrastructure/linaro-ci-dashboard/integrate-django-south
Merge into: lp:linaro-ci-dashboard
Diff against target: 93 lines (+49/-1)
4 files modified
README (+12/-0)
dashboard/frontend/migrations/0001_initial.py (+33/-0)
dashboard/frontend/models.py (+3/-1)
dashboard/settings.py (+1/-0)
To merge this branch: bzr merge lp:~linaro-infrastructure/linaro-ci-dashboard/integrate-django-south
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Deepti B. Kalakeri Pending
Review via email: mp+114377@code.launchpad.net

Description of the change

Implement first step Django South integration.
Add a model Job with one column to do the initial south migration.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2012-07-10 11:58:33 +0000
3+++ README 2012-07-11 10:23:23 +0000
4@@ -10,6 +10,7 @@
5
6 python-django
7 python-django-openid-auth
8+ python-django-south
9 python-setuptools
10 python-dev
11 build-essential
12@@ -22,6 +23,17 @@
13 $ python dashboard/manage.py runserver
14
15
16+Database migration with South
17+-----------------------------
18+
19+We now provide database migrations with django south. All of the migrations
20+files are stored in each app directories (i.e. frontend/migrations).
21+Whenever any of the models are changed, it is strongly advised to run
22+South' schemamigration command for the particular application:
23+
24+ $ python dashboard/manage.py schemamigration frontend --auto
25+
26+
27 Tests
28 -----
29
30
31=== added directory 'dashboard/frontend/migrations'
32=== added file 'dashboard/frontend/migrations/0001_initial.py'
33--- dashboard/frontend/migrations/0001_initial.py 1970-01-01 00:00:00 +0000
34+++ dashboard/frontend/migrations/0001_initial.py 2012-07-11 10:23:23 +0000
35@@ -0,0 +1,33 @@
36+# encoding: utf-8
37+import datetime
38+from south.db import db
39+from south.v2 import SchemaMigration
40+from django.db import models
41+
42+class Migration(SchemaMigration):
43+
44+ def forwards(self, orm):
45+
46+ # Adding model 'JenkinsJob'
47+ db.create_table('frontend_jenkinsjob', (
48+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
49+ ('name', self.gf('django.db.models.fields.CharField')(max_length=200)),
50+ ))
51+ db.send_create_signal('frontend', ['JenkinsJob'])
52+
53+
54+ def backwards(self, orm):
55+
56+ # Deleting model 'JenkinsJob'
57+ db.delete_table('frontend_jenkinsjob')
58+
59+
60+ models = {
61+ 'frontend.jenkinsjob': {
62+ 'Meta': {'object_name': 'JenkinsJob'},
63+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
64+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'})
65+ }
66+ }
67+
68+ complete_apps = ['frontend']
69
70=== added file 'dashboard/frontend/migrations/__init__.py'
71=== modified file 'dashboard/frontend/models.py'
72--- dashboard/frontend/models.py 2012-07-06 12:30:37 +0000
73+++ dashboard/frontend/models.py 2012-07-11 10:23:23 +0000
74@@ -18,4 +18,6 @@
75
76 from django.db import models
77
78-# Create your models here.
79+class JenkinsJob(models.Model):
80+ name = models.CharField(max_length=200)
81+
82
83=== modified file 'dashboard/settings.py'
84--- dashboard/settings.py 2012-07-10 12:24:59 +0000
85+++ dashboard/settings.py 2012-07-11 10:23:23 +0000
86@@ -133,6 +133,7 @@
87 'django.contrib.staticfiles',
88 'django_openid_auth',
89 'frontend',
90+ 'south',
91 # Uncomment the next line to enable the admin:
92 # 'django.contrib.admin',
93 # Uncomment the next line to enable admin documentation:

Subscribers

People subscribed via source and target branches

to all changes: