blow away survey app

...and alter the migration history
pull/1/head
eric 2016-05-11 10:01:03 -04:00
parent 28f35648ae
commit 897e038e5e
11 changed files with 11 additions and 144 deletions

View File

@ -5,19 +5,24 @@ from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
''' migrated from a module that has since been blown away
depends_on = (
("survey", "0001_initial"),
)
needed_by = (
("survey", "0002_auto__del_landing"),
)
'''
def forwards(self, orm):
'''
oldLanding=orm['survey.Landing']
Landing=orm['questionnaire.Landing']
for landing in oldLanding.objects.all():
Landing.objects.create(nonce=landing.nonce, label=landing.label, content_type=landing.content_type, object_id=landing.object_id)
Landing.objects.create(nonce=landing.nonce, label=landing.label, content_type=landing.content_type, object_id=landing.object_id)
'''
pass
def backwards(self, orm):
pass
@ -145,5 +150,6 @@ class Migration(DataMigration):
}
}
complete_apps = ['survey', 'questionnaire']
symmetrical = True
#complete_apps = ['survey', 'questionnaire']
complete_apps = ['questionnaire']
#symmetrical = True

View File

@ -175,7 +175,6 @@ INSTALLED_APPS = (
'transmeta',
'regluit.questionnaire',
'regluit.questionnaire.page',
'regluit.survey',
)
# A sample logging configuration. The only tangible logging

View File

View File

@ -1,8 +0,0 @@
from django.contrib import admin
from .models import Landing
# new in dj1.7
# @admin.register(Landing)
class LandingAdmin(admin.ModelAdmin):
pass

View File

@ -1,47 +0,0 @@
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
needed_by = (
("questionnaire", "0005_move_nonces"),
)
def forwards(self, orm):
# Adding model 'Landing'
db.create_table('survey_landing', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('nonce', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)),
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'], null=True)),
('object_id', self.gf('django.db.models.fields.PositiveIntegerField')(null=True)),
('label', self.gf('django.db.models.fields.CharField')(max_length=64, null=True)),
))
db.send_create_signal('survey', ['Landing'])
def backwards(self, orm):
# Deleting model 'Landing'
db.delete_table('survey_landing')
models = {
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'survey.landing': {
'Meta': {'object_name': 'Landing'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
'nonce': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'})
}
}
complete_apps = ['survey']

View File

@ -1,33 +0,0 @@
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
("questionnaire", "0005_move_nonces"),
)
def forwards(self, orm):
# Deleting model 'Landing'
db.delete_table('survey_landing')
def backwards(self, orm):
# Adding model 'Landing'
db.create_table('survey_landing', (
('nonce', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)),
('object_id', self.gf('django.db.models.fields.PositiveIntegerField')(null=True)),
('label', self.gf('django.db.models.fields.CharField')(max_length=64, null=True)),
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'], null=True)),
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
))
db.send_create_signal('survey', ['Landing'])
models = {
}
complete_apps = ['survey']

View File

@ -1,9 +0,0 @@
import hashlib
import uuid
from datetime import datetime
from django.conf import settings
from django.contrib.contenttypes.generic import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.signals import post_save

View File

@ -1,14 +0,0 @@
{% extends 'basedocumentation.html' %}
{% load url from future %}
{% block title %}Tell us Stuff!{% endblock %}
{% block doccontent %}
<h2>Tell us stuff!</h2>
<p>We are excited that this is Open Access book and really hope that it will be shared around, read by lots of people all over the world, and used in lots of exciting new ways. We would love to hear about you and how you are using it - please would you share your story with us using this link: (it will only take about 3 minutes - and you could just get a free book as well ….)</p>
<p>But comeback again, our survey for {{landing.label}} isn't ready yet.</p>
{% endblock %}

View File

@ -1,7 +0,0 @@
from django.conf.urls import patterns, url, include
from .views import SurveyView
urlpatterns = patterns('',
url(r'^landing/(?P<nonce>\w+)/$', SurveyView.as_view(), name="landing"),
)

View File

@ -1,20 +0,0 @@
import logging
from django.shortcuts import get_object_or_404
from django.views.generic.base import TemplateView
from .models import Landing
class SurveyView(TemplateView):
template_name = "survey/generic.html"
def get_context_data(self, **kwargs):
context = super(SurveyView, self).get_context_data(**kwargs)
nonce = self.kwargs['nonce']
landing = get_object_or_404(Landing, nonce=nonce)
context["landing"] = landing
return context