From cfc7c3f52544af8a71d3fa3988a06fee200d2c24 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 19 Feb 2014 09:29:17 +0200 Subject: better --- .../0005_auto__add_field_issue_created_at.py | 98 ++++ ..._issue_updated_at__add_field_task_updated_at.py | 108 ++++ ...ld_issue_created_by__chg_field_task_created_.py | 128 +++++ ...__add_field_asset_contact__add_field_article.py | 128 +++++ .../migrations/0009_auto__add_field_issue_state.py | 113 ++++ ...unique_taggeditem_content_type_object_id_tag.py | 136 +++++ apps/it/models.py | 102 +++- apps/it/static/images/arrow-down-512.png | Bin 0 -> 106895 bytes apps/it/static/js/sb-admin.js | 2 +- apps/it/templates/default.html | 573 ++++++++++----------- apps/it/templates/edit_issue.html | 10 +- apps/it/templates/edit_task.html | 2 +- apps/it/templates/list_issues.html | 30 +- apps/it/templates/list_stuff.html | 29 ++ apps/it/templates/view_issue.html | 72 ++- apps/it/templatetags/__init__.py | 0 apps/it/templatetags/it_tags.py | 13 + apps/it/views.py | 105 +++- 18 files changed, 1299 insertions(+), 350 deletions(-) create mode 100644 apps/it/migrations/0005_auto__add_field_issue_created_at.py create mode 100644 apps/it/migrations/0006_auto__add_field_issue_updated_at__add_field_task_updated_at.py create mode 100644 apps/it/migrations/0007_auto__add_article__add_field_issue_created_by__chg_field_task_created_.py create mode 100644 apps/it/migrations/0008_auto__add_field_asset_kind__add_field_asset_contact__add_field_article.py create mode 100644 apps/it/migrations/0009_auto__add_field_issue_state.py create mode 100644 apps/it/migrations/0010_auto__add_taggeditem__add_unique_taggeditem_content_type_object_id_tag.py create mode 100755 apps/it/static/images/arrow-down-512.png create mode 100644 apps/it/templates/list_stuff.html create mode 100644 apps/it/templatetags/__init__.py create mode 100644 apps/it/templatetags/it_tags.py (limited to 'apps/it') diff --git a/apps/it/migrations/0005_auto__add_field_issue_created_at.py b/apps/it/migrations/0005_auto__add_field_issue_created_at.py new file mode 100644 index 0000000..aaf6045 --- /dev/null +++ b/apps/it/migrations/0005_auto__add_field_issue_created_at.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Issue.created_at' + db.add_column(u'it_issue', 'created_at', + self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2014, 2, 17, 0, 0), blank=True), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Issue.created_at' + db.delete_column(u'it_issue', 'created_at') + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'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'}), + u'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'}) + }, + u'it.asset': { + 'Meta': {'object_name': 'Asset'}, + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.IPAddressField', [], {'default': "''", 'max_length': '15'}), + 'issues': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['it.Issue']", 'null': 'True', 'symmetrical': 'False'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "'New Asset'", 'max_length': '256'}) + }, + u'it.attachment': { + 'Meta': {'object_name': 'Attachment'}, + 'attachment': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}) + }, + u'it.issue': { + 'Meta': {'ordering': "['priority', 'created_at']", 'object_name': 'Issue'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'priority': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'metoo'", 'null': 'True', 'symmetrical': 'False', 'to': u"orm['auth.User']"}) + }, + u'it.task': { + 'Meta': {'object_name': 'Task'}, + 'assigned_to': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tasks'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'completed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'due_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['it.Issue']", 'null': 'True'}), + 'step': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) + } + } + + complete_apps = ['it'] \ No newline at end of file diff --git a/apps/it/migrations/0006_auto__add_field_issue_updated_at__add_field_task_updated_at.py b/apps/it/migrations/0006_auto__add_field_issue_updated_at__add_field_task_updated_at.py new file mode 100644 index 0000000..50954eb --- /dev/null +++ b/apps/it/migrations/0006_auto__add_field_issue_updated_at__add_field_task_updated_at.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Issue.updated_at' + db.add_column(u'it_issue', 'updated_at', + self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2014, 2, 17, 0, 0), blank=True), + keep_default=False) + + # Adding field 'Task.updated_at' + db.add_column(u'it_task', 'updated_at', + self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2014, 2, 17, 0, 0), blank=True), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Issue.updated_at' + db.delete_column(u'it_issue', 'updated_at') + + # Deleting field 'Task.updated_at' + db.delete_column(u'it_task', 'updated_at') + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'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'}), + u'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'}) + }, + u'it.asset': { + 'Meta': {'object_name': 'Asset'}, + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.IPAddressField', [], {'default': "''", 'max_length': '15'}), + 'issues': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['it.Issue']", 'null': 'True', 'symmetrical': 'False'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "'New Asset'", 'max_length': '256'}) + }, + u'it.attachment': { + 'Meta': {'object_name': 'Attachment'}, + 'attachment': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}) + }, + u'it.issue': { + 'Meta': {'ordering': "['-priority', 'created_at']", 'object_name': 'Issue'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'priority': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'metoo'", 'null': 'True', 'to': u"orm['auth.User']"}) + }, + u'it.task': { + 'Meta': {'object_name': 'Task'}, + 'assigned_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'tasks'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'completed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'due_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['it.Issue']", 'null': 'True'}), + 'step': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['it'] \ No newline at end of file diff --git a/apps/it/migrations/0007_auto__add_article__add_field_issue_created_by__chg_field_task_created_.py b/apps/it/migrations/0007_auto__add_article__add_field_issue_created_by__chg_field_task_created_.py new file mode 100644 index 0000000..bfe9e67 --- /dev/null +++ b/apps/it/migrations/0007_auto__add_article__add_field_issue_created_by__chg_field_task_created_.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding model 'Article' + db.create_table(u'it_article', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('note', self.gf('django.db.models.fields.TextField')()), + ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), + ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()), + ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])), + )) + db.send_create_signal(u'it', ['Article']) + + # Adding field 'Issue.created_by' + db.add_column(u'it_issue', 'created_by', + self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['auth.User']), + keep_default=False) + + + # Changing field 'Task.created_by' + db.alter_column(u'it_task', 'created_by_id', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['auth.User'])) + + def backwards(self, orm): + # Deleting model 'Article' + db.delete_table(u'it_article') + + # Deleting field 'Issue.created_by' + db.delete_column(u'it_issue', 'created_by_id') + + + # Changing field 'Task.created_by' + db.alter_column(u'it_task', 'created_by_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)) + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'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'}), + u'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'}) + }, + u'it.article': { + 'Meta': {'object_name': 'Article'}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'note': ('django.db.models.fields.TextField', [], {}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}) + }, + u'it.asset': { + 'Meta': {'object_name': 'Asset'}, + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.IPAddressField', [], {'default': "''", 'max_length': '15'}), + 'issues': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['it.Issue']", 'null': 'True', 'symmetrical': 'False'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "'New Asset'", 'max_length': '256'}) + }, + u'it.attachment': { + 'Meta': {'object_name': 'Attachment'}, + 'attachment': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}) + }, + u'it.issue': { + 'Meta': {'ordering': "['-priority', 'created_at']", 'object_name': 'Issue'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'priority': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'metoo'", 'null': 'True', 'to': u"orm['auth.User']"}) + }, + u'it.task': { + 'Meta': {'ordering': "['-created_at']", 'object_name': 'Task'}, + 'assigned_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'tasks'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'completed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'due_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['it.Issue']", 'null': 'True'}), + 'step': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['it'] \ No newline at end of file diff --git a/apps/it/migrations/0008_auto__add_field_asset_kind__add_field_asset_contact__add_field_article.py b/apps/it/migrations/0008_auto__add_field_asset_kind__add_field_asset_contact__add_field_article.py new file mode 100644 index 0000000..86677c8 --- /dev/null +++ b/apps/it/migrations/0008_auto__add_field_asset_kind__add_field_asset_contact__add_field_article.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Asset.kind' + db.add_column(u'it_asset', 'kind', + self.gf('django.db.models.fields.CharField')(default='SERVER', max_length=128), + keep_default=False) + + # Adding field 'Asset.contact' + db.add_column(u'it_asset', 'contact', + self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True), + keep_default=False) + + # Adding field 'Article.title' + db.add_column(u'it_article', 'title', + self.gf('django.db.models.fields.CharField')(default='New Article', max_length=256), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Asset.kind' + db.delete_column(u'it_asset', 'kind') + + # Deleting field 'Asset.contact' + db.delete_column(u'it_asset', 'contact_id') + + # Deleting field 'Article.title' + db.delete_column(u'it_article', 'title') + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'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'}), + u'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'}) + }, + u'it.article': { + 'Meta': {'object_name': 'Article'}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'note': ('django.db.models.fields.TextField', [], {}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'title': ('django.db.models.fields.CharField', [], {'default': "'New Article'", 'max_length': '256'}) + }, + u'it.asset': { + 'Meta': {'object_name': 'Asset'}, + 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.IPAddressField', [], {'default': "''", 'max_length': '15'}), + 'issues': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['it.Issue']", 'null': 'True', 'symmetrical': 'False'}), + 'kind': ('django.db.models.fields.CharField', [], {'default': "'SERVER'", 'max_length': '128'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "'New Asset'", 'max_length': '256'}) + }, + u'it.attachment': { + 'Meta': {'object_name': 'Attachment'}, + 'attachment': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}) + }, + u'it.issue': { + 'Meta': {'ordering': "['-priority', 'created_at']", 'object_name': 'Issue'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'priority': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'metoo'", 'null': 'True', 'to': u"orm['auth.User']"}) + }, + u'it.task': { + 'Meta': {'ordering': "['-created_at']", 'object_name': 'Task'}, + 'assigned_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'tasks'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'completed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'due_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['it.Issue']", 'null': 'True'}), + 'step': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['it'] \ No newline at end of file diff --git a/apps/it/migrations/0009_auto__add_field_issue_state.py b/apps/it/migrations/0009_auto__add_field_issue_state.py new file mode 100644 index 0000000..93c3755 --- /dev/null +++ b/apps/it/migrations/0009_auto__add_field_issue_state.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Issue.state' + db.add_column(u'it_issue', 'state', + self.gf('django.db.models.fields.CharField')(default='NEW', max_length=32), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Issue.state' + db.delete_column(u'it_issue', 'state') + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'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'}), + u'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'}) + }, + u'it.article': { + 'Meta': {'object_name': 'Article'}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'note': ('django.db.models.fields.TextField', [], {}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'title': ('django.db.models.fields.CharField', [], {'default': "'New Article'", 'max_length': '256'}) + }, + u'it.asset': { + 'Meta': {'object_name': 'Asset'}, + 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.IPAddressField', [], {'default': "''", 'max_length': '15'}), + 'issues': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['it.Issue']", 'null': 'True', 'symmetrical': 'False'}), + 'kind': ('django.db.models.fields.CharField', [], {'default': "'SERVER'", 'max_length': '128'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "'New Asset'", 'max_length': '256'}) + }, + u'it.attachment': { + 'Meta': {'object_name': 'Attachment'}, + 'attachment': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}) + }, + u'it.issue': { + 'Meta': {'ordering': "['-priority', 'created_at']", 'object_name': 'Issue'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'priority': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'NEW'", 'max_length': '32'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'metoo'", 'null': 'True', 'to': u"orm['auth.User']"}) + }, + u'it.task': { + 'Meta': {'ordering': "['-created_at']", 'object_name': 'Task'}, + 'assigned_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'tasks'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'completed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'due_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['it.Issue']", 'null': 'True'}), + 'step': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['it'] \ No newline at end of file diff --git a/apps/it/migrations/0010_auto__add_taggeditem__add_unique_taggeditem_content_type_object_id_tag.py b/apps/it/migrations/0010_auto__add_taggeditem__add_unique_taggeditem_content_type_object_id_tag.py new file mode 100644 index 0000000..6312a3c --- /dev/null +++ b/apps/it/migrations/0010_auto__add_taggeditem__add_unique_taggeditem_content_type_object_id_tag.py @@ -0,0 +1,136 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding model 'TaggedItem' + db.create_table(u'it_taggeditem', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), + ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()), + ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])), + ('tag', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)), + ('color', self.gf('django.db.models.fields.CharField')(default='', max_length=8)), + )) + db.send_create_signal(u'it', ['TaggedItem']) + + # Adding unique constraint on 'TaggedItem', fields ['content_type', 'object_id', 'tag'] + db.create_unique(u'it_taggeditem', ['content_type_id', 'object_id', 'tag']) + + + def backwards(self, orm): + # Removing unique constraint on 'TaggedItem', fields ['content_type', 'object_id', 'tag'] + db.delete_unique(u'it_taggeditem', ['content_type_id', 'object_id', 'tag']) + + # Deleting model 'TaggedItem' + db.delete_table(u'it_taggeditem') + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + u'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'}), + u'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'}) + }, + u'it.article': { + 'Meta': {'object_name': 'Article'}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'note': ('django.db.models.fields.TextField', [], {}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'title': ('django.db.models.fields.CharField', [], {'default': "'New Article'", 'max_length': '256'}) + }, + u'it.asset': { + 'Meta': {'object_name': 'Asset'}, + 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.IPAddressField', [], {'default': "''", 'max_length': '15'}), + 'issues': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['it.Issue']", 'null': 'True', 'symmetrical': 'False'}), + 'kind': ('django.db.models.fields.CharField', [], {'default': "'SERVER'", 'max_length': '128'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "'New Asset'", 'max_length': '256'}) + }, + u'it.attachment': { + 'Meta': {'object_name': 'Attachment'}, + 'attachment': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}) + }, + u'it.issue': { + 'Meta': {'ordering': "['-priority', 'created_at']", 'object_name': 'Issue'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'priority': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'NEW'", 'max_length': '32'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'metoo'", 'null': 'True', 'to': u"orm['auth.User']"}) + }, + u'it.taggeditem': { + 'Meta': {'unique_together': "(('content_type', 'object_id', 'tag'),)", 'object_name': 'TaggedItem'}, + 'color': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '8'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), + 'tag': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + u'it.task': { + 'Meta': {'ordering': "['-created_at']", 'object_name': 'Task'}, + 'assigned_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'tasks'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'completed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'due_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'issue': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['it.Issue']", 'null': 'True'}), + 'step': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['it'] \ No newline at end of file diff --git a/apps/it/models.py b/apps/it/models.py index d7922e4..0ebc5d0 100644 --- a/apps/it/models.py +++ b/apps/it/models.py @@ -1,24 +1,53 @@ from django.db import models + from django.contrib.contenttypes import generic +from django.utils.translation import ugettext as _ +from django.template.defaultfilters import slugify from django.contrib.auth.models import User, Group from django.contrib.contenttypes.models import ContentType -class Attachment(models.Model): - attachment = models.FileField(upload_to='attachments') - created_by = models.ForeignKey(User) - object_id = models.PositiveIntegerField() - content_type = models.ForeignKey(ContentType) +class AbstractGenericItem(models.Model): + created_by = models.ForeignKey(User, editable=False) + object_id = models.PositiveIntegerField(editable=False) + content_type = models.ForeignKey(ContentType, editable=False) content_object = generic.GenericForeignKey("content_type", "object_id") - @classmethod - def get_content_type(cls, model): - return ContentType.objects.get(app_label='it', model=model) + class Meta: + abstract = True + + +class TaggedItem(AbstractGenericItem): + "A generic tagged item" + tag = models.CharField(max_length=128) + slug = models.SlugField() + color = models.CharField(max_length=8, default="") + + def save(self, *args, **kwargs): + self.slug = slugify(self.tag) + super(TaggedItem, self).save(*args, **kwargs) + + def __unicode__(self): + return self.tag + + class Meta: + unique_together = ("content_type", "object_id", "tag",) + + +class Attachment(AbstractGenericItem): + attachment = models.FileField(upload_to='attachments') + + def __unicode__(self): + import os + return os.path.basename(self.attachment.name) + + +class Article(AbstractGenericItem): + note = models.TextField() + tags = generic.GenericRelation(TaggedItem) + title = models.CharField(max_length=256, default='New Article') + - @classmethod - def get_files(cls, model): - ct = ContentType.objects.get_for_model() - return cls.objects.filter(content_type=ct, object_id=model.pk) class Issue(models.Model): description = models.TextField() @@ -26,9 +55,20 @@ class Issue(models.Model): users = models.ManyToManyField( User, null=True, - blank=True, + editable=False, related_name='metoo' ) + STATES = ( + ('NEW', _('New')), + ('OPEN', _('Open')), + ('CLOSED', _('Closed')), + ) + state = models.CharField(max_length=32, choices=STATES, default=STATES[0][0]) + files = generic.GenericRelation(Attachment) + tags = generic.GenericRelation(TaggedItem) + created_by = models.ForeignKey(User, editable=False) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) def __unicode__(self): return self.description @@ -36,20 +76,29 @@ class Issue(models.Model): def get_absolute_url(self): return '/issues/%d/' % self.pk + class Meta: + ordering = ['-priority', 'created_at'] class Task(models.Model): description = models.TextField() - issue = models.ForeignKey(Issue, null=True) - step = models.PositiveIntegerField(default=0) - created_by = models.ForeignKey(User, null=True) - assigned_to = models.ForeignKey(User, null=True, related_name='tasks') + issue = models.ForeignKey(Issue, null=True, editable=False) + step = models.PositiveIntegerField(default=0, editable=False) + created_by = models.ForeignKey(User, editable=False) + assigned_to = models.ForeignKey(User, + null=True, + blank=True, + related_name='tasks') created_at = models.DateTimeField(auto_now_add=True) - due_date = models.DateField(null=True, blank=True) - completed_at = models.DateTimeField(null=True, blank=True) + due_date = models.DateField(null=True, blank=True, editable=False) + updated_at = models.DateTimeField(auto_now=True) + completed_at = models.DateTimeField(null=True, blank=True, editable=False) + files = generic.GenericRelation(Attachment) def __unicode__(self): return self.description + class Meta: + ordering = ['-created_at'] class Asset(models.Model): name = models.CharField(max_length=256, default='New Asset') @@ -57,6 +106,21 @@ class Asset(models.Model): location = models.CharField(max_length=256) ip_address = models.IPAddressField(default='') issues = models.ManyToManyField(Issue, null=True) + files = generic.GenericRelation(Attachment) + KINDS = ( + ('SERVER', _('Server')), + ('WORKSTATION', _('Workstation')), + ('NETWORK', _('Networking')), + ('SOFTWARE', _('Software')), + ('PRINTER', _('Printer')), + ('SERVICE', _('Service')), + ) + kind = models.CharField(choices=KINDS, max_length=128, default=KINDS[0][0]) + tags = generic.GenericRelation(TaggedItem) + contact = models.ForeignKey(User, null=True, blank=True) def __unicode__(self): return self.name + + def get_absolute_url(self): + return '/stuff/%d/' % self.pk diff --git a/apps/it/static/images/arrow-down-512.png b/apps/it/static/images/arrow-down-512.png new file mode 100755 index 0000000..7af1770 Binary files /dev/null and b/apps/it/static/images/arrow-down-512.png differ diff --git a/apps/it/static/js/sb-admin.js b/apps/it/static/js/sb-admin.js index ae676aa..70f2a3f 100755 --- a/apps/it/static/js/sb-admin.js +++ b/apps/it/static/js/sb-admin.js @@ -8,7 +8,7 @@ $(function() { //collapses the sidebar on window resize. $(function() { $(window).bind("load resize", function() { - console.log($(this).width()) + //console.log($(this).width()) if ($(this).width() < 768) { $('div.sidebar-collapse').addClass('collapse') } else { diff --git a/apps/it/templates/default.html b/apps/it/templates/default.html index 18498ef..49b818b 100755 --- a/apps/it/templates/default.html +++ b/apps/it/templates/default.html @@ -1,320 +1,301 @@ +{% load bootstrap3 %} - + + - - - - IT - - - - + IT - + + + - - + + + + + -
+
- + - + -
-
-
- New Issue - {% block main %} -

Blank

- {% endblock main %} -
- -
- +
+
+
+ {% block main %} +

Blank

+ {% endblock main %}
- - + +
+ +
- + + +
+ - - - - - + + + + + - + - - + + - - - + + + diff --git a/apps/it/templates/edit_issue.html b/apps/it/templates/edit_issue.html index e1be666..aaedee2 100644 --- a/apps/it/templates/edit_issue.html +++ b/apps/it/templates/edit_issue.html @@ -3,9 +3,9 @@ {% load i18n %} {% block main %} -
- {% csrf_token %} - {% bootstrap_form form %} - -
+
+ {% csrf_token %} + {% bootstrap_form form %} + +
{% endblock main %} diff --git a/apps/it/templates/edit_task.html b/apps/it/templates/edit_task.html index e1be666..30435e4 100644 --- a/apps/it/templates/edit_task.html +++ b/apps/it/templates/edit_task.html @@ -6,6 +6,6 @@
{% csrf_token %} {% bootstrap_form form %} - +
{% endblock main %} diff --git a/apps/it/templates/list_issues.html b/apps/it/templates/list_issues.html index c52058d..56d05b0 100644 --- a/apps/it/templates/list_issues.html +++ b/apps/it/templates/list_issues.html @@ -1,12 +1,26 @@ {% extends "default.html" %} +{% load bootstrap3 %} +{% load i18n %} {% block main %} - - {% for i in issues %} - - - - - {% endfor %} -
{{ i.description }}Me too!
+ + + {% for i in issues %} + + + + {% endfor %} +
{{ i.description }}
{% endblock main %} + +{% block inspector %} +
+ {% csrf_token %} + {% bootstrap_form form %} + +
+{% endblock inspector %} diff --git a/apps/it/templates/list_stuff.html b/apps/it/templates/list_stuff.html new file mode 100644 index 0000000..2ed2d6b --- /dev/null +++ b/apps/it/templates/list_stuff.html @@ -0,0 +1,29 @@ +{% extends "default.html" %} +{% load bootstrap3 %} +{% load i18n %} + +{% block main %} + + + + + + {% for i in object_list %} + + + {% endfor %} + +
{{ i.name }}{{ i.description }}
+{% endblock main %} + +{% block inspector %} +
+ {% csrf_token %} + {% bootstrap_form form %} + +
+{% endblock inspector %} diff --git a/apps/it/templates/view_issue.html b/apps/it/templates/view_issue.html index fe36f34..cf33b22 100644 --- a/apps/it/templates/view_issue.html +++ b/apps/it/templates/view_issue.html @@ -1,18 +1,66 @@ {% extends "default.html" %} {% load bootstrap3 %} +{% load humanize %} {% load i18n %} +{% load it_tags %} {% block main %} -

{{ issue.description }}

- {% for i in issue.task_set.all %} -

{{ i.description }}

- {% endfor %} - {% for f in files %} - {{ f.attachment.name }} - {% endfor %} -
-
- Edit - Add Task - Me too! +{{ issue.description|markdown }} +{{ issue.created_by}} @ {{ issue.created_at }} +
+{% bootstrap_icon "pencil" %} Edit +{% bootstrap_icon "star" %} Me too! +{% for i in issue.task_set.all %} +
+
+ {{ i.created_by }} {{ i.created_at|naturaltime }} +
+
+ {{ i.description|markdown }} +
+
+ + +
+
+
+{% endfor %} +
{% endblock main %} + +{% block inspector %} +

Users

+{% for f in issue.users.all %} + {{ f }} + {% bootstrap_icon "trash" %} +{% endfor %} +
+

Files

+{% for f in issue.files.all %} + {{ f }} + {% bootstrap_icon "trash" %} +{% endfor %} +
+
+ {% csrf_token %} +
+
+
+ {% csrf_token %} + {% bootstrap_form form %} + +
+{% endblock inspector %} diff --git a/apps/it/templatetags/__init__.py b/apps/it/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/it/templatetags/it_tags.py b/apps/it/templatetags/it_tags.py new file mode 100644 index 0000000..62b5db3 --- /dev/null +++ b/apps/it/templatetags/it_tags.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- + +from django import template +from django.utils import safestring, timezone +from django.utils.translation import ugettext as _ + +register = template.Library() + +@register.filter +def markdown(text): + import markdown + result = markdown.markdown(text) + return safestring.mark_safe(result) diff --git a/apps/it/views.py b/apps/it/views.py index fa13ed0..47afe63 100644 --- a/apps/it/views.py +++ b/apps/it/views.py @@ -1,11 +1,20 @@ from django import forms +from django.contrib import messages from django.http import HttpResponse from django.shortcuts import render, redirect -from django.views.decorators.csrf import csrf_exempt -from apps.it.models import Issue, Task, Attachment +from apps.it.models import Issue, Task, Attachment, User, Asset +class AssetForm(forms.ModelForm): + class Meta: + model = Asset + +class SimpleAssetForm(forms.ModelForm): + class Meta: + model = Asset + fields = ['name', 'description', 'kind'] + class AttachmentForm(forms.ModelForm): class Meta: model = Attachment @@ -14,28 +23,52 @@ class IssueForm(forms.ModelForm): class Meta: model = Issue + +class SimpleIssueForm(forms.ModelForm): + class Meta: + model = Issue + fields = ['description', 'priority'] + class TaskForm(forms.ModelForm): class Meta: model = Task def home(request): + state = request.GET.get('state') issues = Issue.objects.all() + issue_count = issues.count() + + if state: + issues = issues.filter(state=state) + + form = SimpleIssueForm() + states = Issue.STATES + issue = Issue(created_by_id=1) + + if request.method == 'POST': + form = SimpleIssueForm(request.POST, instance=issue) + if form.is_valid(): + issue = form.save() + messages.success(request, 'Issue saved') + return redirect(issue) return render(request, "list_issues.html", locals()) def search(request): query = request.GET['q'] - results = Issue.objects.filter(description__icontains=query) - return render(request, "default.html", locals()) + form = IssueForm() + issues = Issue.objects.filter(description__icontains=query) + return render(request, "list_issues.html", locals()) def view_issue(request, pk): issue = Issue.objects.get(pk=pk) - files = Attachment.objects.filter(content_object=issue) + task = Task(issue=issue, created_by_id=1) + form = TaskForm(instance=task) return render(request, "view_issue.html", locals()) def edit_issue(request, pk=None): if pk is None: - issue = Issue() + issue = Issue(created_by_id=1) else: issue = Issue.objects.get(pk=pk) @@ -45,6 +78,7 @@ def edit_issue(request, pk=None): form = IssueForm(request.POST, instance=issue) if form.is_valid(): issue = form.save() + messages.success(request, 'Issue saved') return redirect(issue) return render(request, "edit_issue.html", locals()) @@ -52,6 +86,7 @@ def edit_issue(request, pk=None): def edit_task(request, issue, pk=None): if pk is None: task = Task() + task.created_by_id = 1 task.issue = Issue.objects.get(pk=issue) else: task = Task.objects.get(pk=pk) @@ -70,16 +105,70 @@ def edit_task(request, issue, pk=None): def metoo(request, issue, user): issue = Issue.objects.get(pk=issue) + user = User.objects.get(pk=user) + + if user in issue.users.all(): + issue.users.remove(user) + else: + issue.users.add(user) + + messages.success(request, 'Issue updated') + return redirect(issue) -@csrf_exempt def add_files(request, pk): issue = Issue.objects.get(pk=pk) att = Attachment(content_object=issue, created_by_id=1) form = AttachmentForm(request.POST, request.FILES, instance=att) - if form.is_valid: + if form.is_valid(): form.save() else: print form.errors return HttpResponse('Cheerio!') + +def delete_issue(request, pk): + pass + +def delete_task(request, pk): + task = Task.objects.get(pk=pk) + task.delete() + messages.info(request, 'Task deleted') + return redirect(task.issue) + +def list_assets(request): + pass + +def list_stuff(request): + if request.method == 'POST': + form = SimpleAssetForm(request.POST) + if form.is_valid(): + asset = form.save() + return redirect(asset) + + categories = Asset.KINDS + object_list = Asset.objects.all() + kind = request.GET.get('kind') + + if kind: + object_list = object_list.filter(kind=kind) + + form = SimpleAssetForm(initial={'kind': kind}) + return render(request, "list_stuff.html", locals()) + +def view_asset(request, pk): + return render(request, "view_asset.html", locals()) + + +def delete_file(request, pk): + file = Attachment.objects.get(pk=pk) + file.delete() + messages.success(request, 'File deleted') + return redirect(file.content_object) + +def remove_user(request, issue, user): + issue = Issue.objects.get(pk=issue) + user = User.objects.get(pk=user) + issue.users.remove(user) + messages.success(request, 'User removed from issue') + return redirect(issue) -- cgit v1.2.3