diff --git a/apps/marks/migrations/0004_auto__chg_field_mark_title__chg_field_mark_description.py b/apps/marks/migrations/0004_auto__chg_field_mark_title__chg_field_mark_description.py new file mode 100644 index 000000000..752fca636 --- /dev/null +++ b/apps/marks/migrations/0004_auto__chg_field_mark_title__chg_field_mark_description.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): + + # Changing field 'Mark.title' + db.alter_column(u'marks_mark', 'title', self.gf('django.db.models.fields.CharField')(max_length=155)) + + # Changing field 'Mark.description' + db.alter_column(u'marks_mark', 'description', self.gf('django.db.models.fields.CharField')(max_length=255)) + + def backwards(self, orm): + + # Changing field 'Mark.title' + db.alter_column(u'marks_mark', 'title', self.gf('django.db.models.fields.CharField')(max_length=50)) + + # Changing field 'Mark.description' + db.alter_column(u'marks_mark', 'description', self.gf('django.db.models.fields.CharField')(max_length=100)) + + 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'authentication.onlineuser': { + 'Meta': {'ordering': "['first_name', 'last_name']", 'object_name': 'OnlineUser'}, + 'address': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'allergies': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'compiled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'field_of_study': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'gender': ('django.db.models.fields.CharField', [], {'default': "'male'", 'max_length': '10'}), + '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'}), + 'infomail': ('django.db.models.fields.BooleanField', [], {'default': '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'}), + 'mark_rules': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'nickname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'ntnu_username': ('django.db.models.fields.CharField', [], {'max_length': '10', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'phone_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), + 'rfid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'started_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2014, 2, 1, 0, 0)'}), + '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'}), + 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'zip_code': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}) + }, + 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'marks.mark': { + 'Meta': {'object_name': 'Mark'}, + 'added_date': ('django.db.models.fields.DateField', [], {}), + 'category': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'expiration_date': ('django.db.models.fields.DateField', [], {}), + 'given_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'mark_given_by'", 'null': 'True', 'to': u"orm['authentication.OnlineUser']"}), + 'given_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['authentication.OnlineUser']", 'null': 'True', 'through': u"orm['marks.UserEntry']", 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_changed_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'marks_last_changed_by'", 'null': 'True', 'to': u"orm['authentication.OnlineUser']"}), + 'last_changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '155'}) + }, + u'marks.userentry': { + 'Meta': {'unique_together': "(('user', 'mark'),)", 'object_name': 'UserEntry'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mark': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['marks.Mark']"}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['authentication.OnlineUser']"}) + } + } + + complete_apps = ['marks'] \ No newline at end of file diff --git a/apps/marks/models.py b/apps/marks/models.py index 61a03e93f..cf4949d96 100644 --- a/apps/marks/models.py +++ b/apps/marks/models.py @@ -29,7 +29,7 @@ class Mark(models.Model): (5, _(u"Kontoret")), ) - title = models.CharField(_(u"tittel"), max_length=50) + title = models.CharField(_(u"tittel"), max_length=155) given_to = models.ManyToManyField(User, null=True, blank=True, through="UserEntry", verbose_name=_(u"gitt til")) added_date = models.DateField(_(u"utdelt dato")) expiration_date = models.DateField(_(u"utløpsdato"), editable=False) @@ -37,7 +37,7 @@ class Mark(models.Model): last_changed_date = models.DateTimeField(_(u"sist redigert"), auto_now=True, editable=False) last_changed_by = models.ForeignKey(User, related_name="marks_last_changed_by", verbose_name=_(u"sist redigert av"), editable=False, null=True, blank=False) - description = models.CharField(_(u"beskrivelse"), max_length=100, + description = models.CharField(_(u"beskrivelse"), max_length=255, help_text=_(u"Hvis dette feltet etterlates blankt vil det fylles med " "en standard grunn for typen prikk som er valgt."), blank=True)