Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #28 from eugene-wee/master
Browse files Browse the repository at this point in the history
Remove null=True from MailerMessage model's string-based fields
  • Loading branch information
dstegelman committed Jun 27, 2013
2 parents c7964ac + 8c7f913 commit a625749
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
import 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 'MailerMessage.html_content'
db.alter_column(u'mailqueue_mailermessage', 'html_content', self.gf('django.db.models.fields.TextField')(default=''))

# Changing field 'MailerMessage.app'
db.alter_column(u'mailqueue_mailermessage', 'app', self.gf('django.db.models.fields.CharField')(default='', max_length=250))

# Changing field 'MailerMessage.bcc_address'
db.alter_column(u'mailqueue_mailermessage', 'bcc_address', self.gf('django.db.models.fields.EmailField')(default='', max_length=250))

# Changing field 'MailerMessage.content'
db.alter_column(u'mailqueue_mailermessage', 'content', self.gf('django.db.models.fields.TextField')(default=''))

# Changing field 'MailerMessage.subject'
db.alter_column(u'mailqueue_mailermessage', 'subject', self.gf('django.db.models.fields.CharField')(default='', max_length=250))

def backwards(self, orm):

# Changing field 'MailerMessage.html_content'
db.alter_column(u'mailqueue_mailermessage', 'html_content', self.gf('django.db.models.fields.TextField')(null=True))

# Changing field 'MailerMessage.app'
db.alter_column(u'mailqueue_mailermessage', 'app', self.gf('django.db.models.fields.CharField')(max_length=250, null=True))

# Changing field 'MailerMessage.bcc_address'
db.alter_column(u'mailqueue_mailermessage', 'bcc_address', self.gf('django.db.models.fields.EmailField')(max_length=250, null=True))

# Changing field 'MailerMessage.content'
db.alter_column(u'mailqueue_mailermessage', 'content', self.gf('django.db.models.fields.TextField')(null=True))

# Changing field 'MailerMessage.subject'
db.alter_column(u'mailqueue_mailermessage', 'subject', self.gf('django.db.models.fields.CharField')(max_length=250, null=True))

models = {
u'mailqueue.attachment': {
'Meta': {'object_name': 'Attachment'},
'email': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['mailqueue.MailerMessage']", 'null': 'True', 'blank': 'True'}),
'file_attachment': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'mailqueue.mailermessage': {
'Meta': {'object_name': 'MailerMessage'},
'app': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'}),
'bcc_address': ('django.db.models.fields.EmailField', [], {'max_length': '250', 'blank': 'True'}),
'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'from_address': ('django.db.models.fields.EmailField', [], {'max_length': '250'}),
'html_content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_attempt': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'}),
'to_address': ('django.db.models.fields.EmailField', [], {'max_length': '250'})
}
}

complete_apps = ['mailqueue']
10 changes: 5 additions & 5 deletions mailqueue/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def send_queued(self, limit=None):


class MailerMessage(models.Model):
subject = models.CharField(max_length=250, blank=True, null=True)
subject = models.CharField(max_length=250, blank=True)
to_address = models.EmailField(max_length=250)
bcc_address = models.EmailField(max_length=250, blank=True, null=True)
bcc_address = models.EmailField(max_length=250, blank=True)
from_address = models.EmailField(max_length=250)
content = models.TextField(blank=True, null=True)
html_content = models.TextField(blank=True, null=True)
app = models.CharField(max_length=250, blank=True, null=True)
content = models.TextField(blank=True)
html_content = models.TextField(blank=True)
app = models.CharField(max_length=250, blank=True)
sent = models.BooleanField(default=False, editable=False)
last_attempt = models.DateTimeField(auto_now=False, auto_now_add=False, blank=True, null=True, editable=False)

Expand Down

0 comments on commit a625749

Please sign in to comment.