From 91f8f7c578aab9359c1728de9383f5e59b5e8349 Mon Sep 17 00:00:00 2001 From: Sarah Bird <sarah@bonvaya.com> Date: Mon, 14 Jan 2013 12:47:24 +0000 Subject: [PATCH] Initial commit to add django-actionitems to econsensus including migration --- deploy/pip_packages.txt | 3 +- .../0033_auto__add_field_actionitem_origin.py | 138 ++++++++++++++++++ django/econsensus/settings.py | 3 + 3 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 django/econsensus/publicweb/migrations/0033_auto__add_field_actionitem_origin.py diff --git a/deploy/pip_packages.txt b/deploy/pip_packages.txt index fd2462cc..045426dc 100644 --- a/deploy/pip_packages.txt +++ b/deploy/pip_packages.txt @@ -14,4 +14,5 @@ django-keyedcache django-registration git+git://github.com/aptivate/django-organizations.git git+git://github.com/aptivate/django-notification.git@emails-with-headers -django-guardian \ No newline at end of file +django-guardian +git+git://github.com/birdsarah/django-actionitems.git diff --git a/django/econsensus/publicweb/migrations/0033_auto__add_field_actionitem_origin.py b/django/econsensus/publicweb/migrations/0033_auto__add_field_actionitem_origin.py new file mode 100644 index 00000000..0d2df608 --- /dev/null +++ b/django/econsensus/publicweb/migrations/0033_auto__add_field_actionitem_origin.py @@ -0,0 +1,138 @@ +# -*- 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 = ( + ("acionitems", "0001_initial.py"), + ) + + def forwards(self, orm): + # Adding field 'ActionItem.origin' + db.add_column('actionitems_actionitem', 'origin', + self.gf('django.db.models.fields.related.ForeignKey')(to=orm['publicweb.Decision'], null=True, blank=True), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'ActionItem.origin' + db.delete_column('actionitems_actionitem', 'origin_id') + + + models = { + 'actionitems.actionitem': { + 'Meta': {'object_name': 'ActionItem'}, + 'completed_on': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'created_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 1, 14, 0, 0)'}), + 'deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'done': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manager': ('django.db.models.fields.CharField', [], {'default': "'internal'", 'max_length': '10'}), + 'origin': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['publicweb.Decision']", 'null': 'True', 'blank': 'True'}), + 'responsible': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'updated_on': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) + }, + 'auth.group': { + 'Meta': {'object_name': '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']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + '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': { + 'Meta': {'object_name': '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']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + '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']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + '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'}) + }, + 'notification.noticetype': { + 'Meta': {'object_name': 'NoticeType'}, + 'default': ('django.db.models.fields.IntegerField', [], {}), + 'description': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'display': ('django.db.models.fields.CharField', [], {'max_length': '50'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '40'}) + }, + 'notification.observeditem': { + 'Meta': {'ordering': "['-added']", 'object_name': 'ObservedItem'}, + 'added': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'notice_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['notification.NoticeType']"}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'signal': ('django.db.models.fields.TextField', [], {}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'organizations.organization': { + 'Meta': {'ordering': "['name']", 'object_name': 'Organization'}, + 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'slug': ('django_extensions.db.fields.AutoSlugField', [], {'allow_duplicates': 'False', 'max_length': '100', 'separator': "u'-'", 'unique': 'True', 'populate_from': "'name'", 'overwrite': 'False'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'through': "orm['organizations.OrganizationUser']", 'symmetrical': 'False'}) + }, + 'organizations.organizationuser': { + 'Meta': {'ordering': "['organization', 'user']", 'unique_together': "(('user', 'organization'),)", 'object_name': 'OrganizationUser'}, + 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'organization': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'organization_users'", 'to': "orm['organizations.Organization']"}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'organization_users'", 'to': "orm['auth.User']"}) + }, + 'publicweb.decision': { + 'Meta': {'object_name': 'Decision'}, + 'archived_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'author': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'publicweb_decision_authored'", 'null': 'True', 'to': "orm['auth.User']"}), + 'budget': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'creation': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), + 'deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'decided_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'editor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'publicweb_decision_edited'", 'null': 'True', 'to': "orm['auth.User']"}), + 'effective_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'excerpt': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'expiry_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}), + 'last_status': ('django.db.models.fields.CharField', [], {'default': "'new'", 'max_length': '10'}), + 'meeting_people': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'organization': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['organizations.Organization']"}), + 'people': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'review_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'status': ('django.db.models.fields.CharField', [], {'default': "'proposal'", 'max_length': '10'}), + 'tags': ('tagging.fields.TagField', [], {'null': 'True'}) + } + } + + complete_apps = ['actionitems'] diff --git a/django/econsensus/settings.py b/django/econsensus/settings.py index 5c033b92..533c2e97 100644 --- a/django/econsensus/settings.py +++ b/django/econsensus/settings.py @@ -144,8 +144,11 @@ INSTALLED_APPS = ( 'tinymce', 'south', 'tagging', + 'actionitems', ) +ACTIONITEMS_ORIGIN_MODEL = 'publicweb.Decision' + AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'guardian.backends.ObjectPermissionBackend' -- GitLab