From a6ef8cbb007943e9ac81e06a2df8dfd5e3d4537c Mon Sep 17 00:00:00 2001 From: zalun Date: Wed, 10 Feb 2010 15:04:13 +0000 Subject: [PATCH] south migration fix --- flightdeck/amo/migrations/0001_initial.py | 20 --- flightdeck/amo/migrations/__init__.py | 0 flightdeck/jetpack/migrations/0001_initial.py | 125 ------------------ flightdeck/jetpack/migrations/__init__.py | 0 flightdeck/jetpack/models.py | 5 + flightdeck/jetpack/templates/edit.html | 7 +- flightdeck/jetpack/views.py | 4 +- flightdeck/person/migrations/0001_initial.py | 69 ---------- flightdeck/person/migrations/__init__.py | 0 9 files changed, 11 insertions(+), 219 deletions(-) delete mode 100644 flightdeck/amo/migrations/0001_initial.py delete mode 100644 flightdeck/amo/migrations/__init__.py delete mode 100644 flightdeck/jetpack/migrations/0001_initial.py delete mode 100644 flightdeck/jetpack/migrations/__init__.py delete mode 100644 flightdeck/person/migrations/0001_initial.py delete mode 100644 flightdeck/person/migrations/__init__.py diff --git a/flightdeck/amo/migrations/0001_initial.py b/flightdeck/amo/migrations/0001_initial.py deleted file mode 100644 index b7c7feeb..00000000 --- a/flightdeck/amo/migrations/0001_initial.py +++ /dev/null @@ -1,20 +0,0 @@ - -from south.db import db -from django.db import models -from amo.models import * - -class Migration: - - def forwards(self, orm): - "Write your forwards migration here" - - - def backwards(self, orm): - "Write your backwards migration here" - - - models = { - - } - - complete_apps = ['amo'] diff --git a/flightdeck/amo/migrations/__init__.py b/flightdeck/amo/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/flightdeck/jetpack/migrations/0001_initial.py b/flightdeck/jetpack/migrations/0001_initial.py deleted file mode 100644 index aca99da4..00000000 --- a/flightdeck/jetpack/migrations/0001_initial.py +++ /dev/null @@ -1,125 +0,0 @@ - -from south.db import db -from django.db import models -from jetpack.models import * - -class Migration: - - def forwards(self, orm): - - # Adding model 'Jetpack' - db.create_table('jetpack_jetpack', ( - ('id', orm['jetpack.Jetpack:id']), - ('slug', orm['jetpack.Jetpack:slug']), - ('name', orm['jetpack.Jetpack:name']), - ('decription', orm['jetpack.Jetpack:decription']), - ('author', orm['jetpack.Jetpack:author']), - ('public_permission', orm['jetpack.Jetpack:public_permission']), - ('group_permission', orm['jetpack.Jetpack:group_permission']), - )) - db.send_create_signal('jetpack', ['Jetpack']) - - # Adding model 'Version' - db.create_table('jetpack_version', ( - ('id', orm['jetpack.Version:id']), - ('jetpack', orm['jetpack.Version:jetpack']), - ('name', orm['jetpack.Version:name']), - ('decription', orm['jetpack.Version:decription']), - ('code', orm['jetpack.Version:code']), - ('status', orm['jetpack.Version:status']), - ('published', orm['jetpack.Version:published']), - ('is_base', orm['jetpack.Version:is_base']), - )) - db.send_create_signal('jetpack', ['Version']) - - # Adding ManyToManyField 'Jetpack.managers' - db.create_table('jetpack_jetpack_managers', ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('jetpack', models.ForeignKey(orm.Jetpack, null=False)), - ('user', models.ForeignKey(orm['auth.User'], null=False)) - )) - - # Adding ManyToManyField 'Jetpack.developers' - db.create_table('jetpack_jetpack_developers', ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('jetpack', models.ForeignKey(orm.Jetpack, null=False)), - ('user', models.ForeignKey(orm['auth.User'], null=False)) - )) - - - - def backwards(self, orm): - - # Deleting model 'Jetpack' - db.delete_table('jetpack_jetpack') - - # Deleting model 'Version' - db.delete_table('jetpack_version') - - # Dropping ManyToManyField 'Jetpack.managers' - db.delete_table('jetpack_jetpack_managers') - - # Dropping ManyToManyField 'Jetpack.developers' - db.delete_table('jetpack_jetpack_developers') - - - - models = { - 'auth.group': { - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'unique_together': "(('content_type', 'codename'),)"}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'unique_together': "(('app_label', 'model'),)", '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'}) - }, - 'jetpack.jetpack': { - 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'authored_jetpacks'", 'to': "orm['auth.User']"}), - 'decription': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'developers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']"}), - 'group_permission': ('django.db.models.fields.IntegerField', [], {'default': '2', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'managers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']"}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'public_permission': ('django.db.models.fields.IntegerField', [], {'default': '2', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '20'}) - }, - 'jetpack.version': { - 'code': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'decription': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_base': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'jetpack': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'versions'", 'to': "orm['jetpack.Jetpack']"}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'published': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'a'", 'max_length': '1', 'blank': 'True'}) - } - } - - complete_apps = ['jetpack'] diff --git a/flightdeck/jetpack/migrations/__init__.py b/flightdeck/jetpack/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/flightdeck/jetpack/models.py b/flightdeck/jetpack/models.py index e1ff20e0..7cda45d5 100644 --- a/flightdeck/jetpack/models.py +++ b/flightdeck/jetpack/models.py @@ -21,6 +21,10 @@ class Jetpack(models.Model): public_permission = models.IntegerField(choices=PERMISSIONS_CHOICES, default=2, blank=True) group_permission = models.IntegerField(choices=PERMISSIONS_CHOICES, default=2, blank=True) + + def __unicode__(self): + return self.name + @models.permalink def get_absolute_url(self): return ('jetpack_edit_base',[self.slug]) @@ -59,6 +63,7 @@ STATUS_CHOICES = ( class Version(models.Model): jetpack = models.ForeignKey(Jetpack, related_name="versions") + commited_by = models.ForeignKey(User, related_name="commits") name = models.CharField(max_length=255, blank=True) decription = models.TextField(blank=True, null=True) code = models.TextField(blank=True, null=True) diff --git a/flightdeck/jetpack/templates/edit.html b/flightdeck/jetpack/templates/edit.html index 7568afe1..f61900ff 100644 --- a/flightdeck/jetpack/templates/edit.html +++ b/flightdeck/jetpack/templates/edit.html @@ -6,10 +6,11 @@ {# some menus default for editing #} -

{{ version }}

+

{{ jetpack }} by {{ jetpack.author.username }}

- {% if jetpack_page %}version {{ version.name }} - {% else %}jetpack base + Version commited by: {{ version.commited_by.username }}, + {% if jetpack_page %}switch to: version {{ version.name }} + {% else %}switch to: jetpack base {% endif %}

{{ version.code }}
diff --git a/flightdeck/jetpack/views.py b/flightdeck/jetpack/views.py index 5649e827..1a5d299a 100644 --- a/flightdeck/jetpack/views.py +++ b/flightdeck/jetpack/views.py @@ -1,6 +1,6 @@ from django.shortcuts import render_to_response, get_object_or_404 -from django.http import Http404, HttpResponseRedirect, HttpResponse -from django.template import Template,RequestContext +#from django.http import Http404, HttpResponseRedirect, HttpResponse +from django.template import RequestContext#,Template from jetpack.models import Jetpack, Version from jetpack.default_settings import settings diff --git a/flightdeck/person/migrations/0001_initial.py b/flightdeck/person/migrations/0001_initial.py deleted file mode 100644 index 41611229..00000000 --- a/flightdeck/person/migrations/0001_initial.py +++ /dev/null @@ -1,69 +0,0 @@ - -from south.db import db -from django.db import models -from person.models import * - -class Migration: - - def forwards(self, orm): - - # Adding model 'Profile' - db.create_table('person_profile', ( - ('id', orm['person.Profile:id']), - ('amo_session', orm['person.Profile:amo_session']), - ('user', orm['person.Profile:user']), - )) - db.send_create_signal('person', ['Profile']) - - - - def backwards(self, orm): - - # Deleting model 'Profile' - db.delete_table('person_profile') - - - - models = { - 'auth.group': { - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'unique_together': "(('content_type', 'codename'),)"}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'unique_together': "(('app_label', 'model'),)", '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'}) - }, - 'person.profile': { - 'amo_session': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - } - } - - complete_apps = ['person'] diff --git a/flightdeck/person/migrations/__init__.py b/flightdeck/person/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000