Commit 7383114c authored by Adrián Ribao's avatar Adrián Ribao
Browse files

basic functionality

parent 542844d9
......@@ -3,9 +3,11 @@
from django.contrib import admin
#from mptt.admin import MPTTModelAdmin
from django.utils.translation import ugettext_lazy as _
from cartero.models import Contact, EmailTemplate, Campaign
from cartero.models import Contact, EmailTemplate, Campaign, ExcludedEmail,\
ShortURL, LinkClick, OpenEmail
from django.conf.urls.defaults import patterns, include, url
from cartero.views import CreateTemplateView, UpdateTemplateView
from cartero.utils.sending import CampaignDeliver
#StackedInline o TabularInline
#class ModelInline(admin.TabularInline):
......@@ -70,6 +72,7 @@ class CampaignAdmin(admin.ModelAdmin):
'site',
'ready',
'sent',
'rate_limit',
]
list_filter = [
'ready',
......@@ -83,15 +86,97 @@ class CampaignAdmin(admin.ModelAdmin):
#inlines = [
#]
#prepopulated_fields = {"slug": ("name", )}
actions = ['send_test']
actions = [
'send_test',
'send',
'cancel_send',
]
filter_horizontal = [
'contacts',
]
fields = (
'site',
'name',
'subject',
'start',
('reply_to', 'from_email'),
'contacts',
'email_template',
'ready',
'sent',
('rate_limit_amount', 'rate_limit_interval'),
)
def send_test(self, request, queryset):
from cartero.utils.sending import CampaignDeliver
for campaign in queryset:
cd = CampaignDeliver(campaign)
cd.send()
cd.send_test()
send_test.short_description = _(u'Send test')
def send(self, request, queryset):
queryset.update(ready=True)
send.short_description = _(u'Mark campaign as ready to send')
def cancel_send(self, request, queryset):
queryset.update(ready=False)
cancel_send.short_description = _(u'Cancel the campaign')
admin.site.register(Campaign, CampaignAdmin)
#admin.site.register(simplemodel, admin.ModelAdmin)
class ExcludedEmailAdmin(admin.ModelAdmin):
date_hierarchy = 'created'
list_display = [
'email',
'reason',
]
list_filter = [
'reason',
]
search_fields = [
'email',
]
admin.site.register(ExcludedEmail, ExcludedEmailAdmin)
class ShortURLAdmin(admin.ModelAdmin):
date_hierarchy = 'created'
list_display = [
'url',
'code',
]
list_filter = [
]
search_fields = [
'url',
'code',
]
admin.site.register(ShortURL, ShortURLAdmin)
class LinkClickAdmin(admin.ModelAdmin):
date_hierarchy = 'created'
list_display = [
'url',
'ip_address',
'campaign',
]
list_filter = [
'campaign',
]
search_fields = [
'ip_address',
]
admin.site.register(LinkClick, LinkClickAdmin)
class OpenEmailAdmin(admin.ModelAdmin):
date_hierarchy = 'created'
list_display = [
'ip_address',
'contact',
'campaign',
]
list_filter = [
'campaign',
]
search_fields = [
'ip_address',
]
admin.site.register(OpenEmail, OpenEmailAdmin)
# -*- 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):
# Adding field 'Campaign.rate_limit_amount'
db.add_column('cartero_campaign', 'rate_limit_amount',
self.gf('django.db.models.fields.PositiveSmallIntegerField')(default=60),
keep_default=False)
# Adding field 'Campaign.rate_limit_interval'
db.add_column('cartero_campaign', 'rate_limit_interval',
self.gf('django.db.models.fields.CharField')(default='h', max_length=1),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Campaign.rate_limit_amount'
db.delete_column('cartero_campaign', 'rate_limit_amount')
# Deleting field 'Campaign.rate_limit_interval'
db.delete_column('cartero_campaign', 'rate_limit_interval')
models = {
'cartero.campaign': {
'Meta': {'object_name': 'Campaign'},
'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cartero.Contact']", 'symmetrical': 'False', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email_template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cartero.EmailTemplate']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'rate_limit_amount': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '60'}),
'rate_limit_interval': ('django.db.models.fields.CharField', [], {'default': "'h'", 'max_length': '1'}),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'reply_to': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 1, 30, 0, 0)'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '150'})
},
'cartero.contact': {
'Meta': {'object_name': 'Contact'},
'bounced': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '200'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
'cartero.emailtemplate': {
'Meta': {'object_name': 'EmailTemplate'},
'context': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'html': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'plain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'template': ('django.db.models.fields.FilePathField', [], {'path': "'/home/antares/paginas_web/adcxml/cartero/templates/cartero/'", 'max_length': '255', 'match': "'\\\\.html$'"})
},
'sites.site': {
'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}
}
complete_apps = ['cartero']
\ No newline at end of file
# -*- 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):
# Adding field 'Campaign.from_email'
db.add_column('cartero_campaign', 'from_email',
self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Campaign.from_email'
db.delete_column('cartero_campaign', 'from_email')
models = {
'cartero.campaign': {
'Meta': {'object_name': 'Campaign'},
'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cartero.Contact']", 'symmetrical': 'False', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email_template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cartero.EmailTemplate']"}),
'from_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'rate_limit_amount': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '60'}),
'rate_limit_interval': ('django.db.models.fields.CharField', [], {'default': "'h'", 'max_length': '1'}),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'reply_to': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 1, 30, 0, 0)'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '150'})
},
'cartero.contact': {
'Meta': {'object_name': 'Contact'},
'bounced': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '200'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
'cartero.emailtemplate': {
'Meta': {'object_name': 'EmailTemplate'},
'context': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'html': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'plain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'template': ('django.db.models.fields.FilePathField', [], {'path': "'/home/antares/paginas_web/adcxml/cartero/templates/cartero/'", 'max_length': '255', 'match': "'\\\\.html$'"})
},
'sites.site': {
'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}
}
complete_apps = ['cartero']
\ No newline at end of file
# -*- 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):
# Adding model 'ExcludedEmail'
db.create_table('cartero_excludedemail', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('email', self.gf('django.db.models.fields.EmailField')(max_length=200)),
('reason', self.gf('django.db.models.fields.CharField')(max_length=2)),
('comments', self.gf('django.db.models.fields.TextField')(blank=True)),
))
db.send_create_signal('cartero', ['ExcludedEmail'])
def backwards(self, orm):
# Deleting model 'ExcludedEmail'
db.delete_table('cartero_excludedemail')
models = {
'cartero.campaign': {
'Meta': {'object_name': 'Campaign'},
'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cartero.Contact']", 'symmetrical': 'False', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email_template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cartero.EmailTemplate']"}),
'from_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'rate_limit_amount': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '60'}),
'rate_limit_interval': ('django.db.models.fields.CharField', [], {'default': "'h'", 'max_length': '1'}),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'reply_to': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 1, 31, 0, 0)'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '150'})
},
'cartero.contact': {
'Meta': {'object_name': 'Contact'},
'bounced': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '200'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
'cartero.emailtemplate': {
'Meta': {'object_name': 'EmailTemplate'},
'context': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'html': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'plain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'template': ('django.db.models.fields.FilePathField', [], {'path': "'/home/antares/paginas_web/adcxml/cartero/templates/cartero/'", 'max_length': '255', 'match': "'\\\\.html$'"})
},
'cartero.excludedemail': {
'Meta': {'object_name': 'ExcludedEmail'},
'comments': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '200'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'reason': ('django.db.models.fields.CharField', [], {'max_length': '2'})
},
'sites.site': {
'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}
}
complete_apps = ['cartero']
\ No newline at end of file
# -*- 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):
# Adding unique constraint on 'ExcludedEmail', fields ['email']
db.create_unique('cartero_excludedemail', ['email'])
def backwards(self, orm):
# Removing unique constraint on 'ExcludedEmail', fields ['email']
db.delete_unique('cartero_excludedemail', ['email'])
models = {
'cartero.campaign': {
'Meta': {'object_name': 'Campaign'},
'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cartero.Contact']", 'symmetrical': 'False', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email_template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cartero.EmailTemplate']"}),
'from_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'rate_limit_amount': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '60'}),
'rate_limit_interval': ('django.db.models.fields.CharField', [], {'default': "'h'", 'max_length': '1'}),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'reply_to': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 1, 31, 0, 0)'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '150'})
},
'cartero.contact': {
'Meta': {'object_name': 'Contact'},
'bounced': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '200'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
'cartero.emailtemplate': {
'Meta': {'object_name': 'EmailTemplate'},
'context': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'html': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'plain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'template': ('django.db.models.fields.FilePathField', [], {'path': "'/home/antares/paginas_web/adcxml/cartero/templates/cartero/'", 'max_length': '255', 'match': "'\\\\.html$'"})
},
'cartero.excludedemail': {
'Meta': {'object_name': 'ExcludedEmail'},
'comments': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '200'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'reason': ('django.db.models.fields.CharField', [], {'max_length': '2'})
},
'sites.site': {
'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}
}
complete_apps = ['cartero']
\ No newline at end of file
# -*- 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):
# Adding model 'LinkClick'
db.create_table('cartero_linkclick', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('url', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['cartero.ShortURL'])),
('ip_address', self.gf('django.db.models.fields.IPAddressField')(max_length=15, null=True, db_index=True)),
('campaign', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['cartero.Campaign'])),
))
db.send_create_signal('cartero', ['LinkClick'])
# Adding model 'ShortURL'
db.create_table('cartero_shorturl', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('url', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)),
('short_url', self.gf('django.db.models.fields.CharField')(max_length=75, db_index=True)),
))
db.send_create_signal('cartero', ['ShortURL'])
def backwards(self, orm):
# Deleting model 'LinkClick'
db.delete_table('cartero_linkclick')
# Deleting model 'ShortURL'
db.delete_table('cartero_shorturl')
models = {
'cartero.campaign': {
'Meta': {'object_name': 'Campaign'},
'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cartero.Contact']", 'symmetrical': 'False', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email_template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cartero.EmailTemplate']"}),
'from_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'rate_limit_amount': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '60'}),
'rate_limit_interval': ('django.db.models.fields.CharField', [], {'default': "'h'", 'max_length': '1'}),
'ready': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'reply_to': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 2, 1, 0, 0)'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '150'})
},
'cartero.contact': {
'Meta': {'object_name': 'Contact'},
'bounced': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '200'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'testing': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
'cartero.emailtemplate': {
'Meta': {'object_name': 'EmailTemplate'},
'context': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'html': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'plain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
'template': ('django.db.models.fields.FilePathField', [], {'path': "'/home/antares/paginas_web/adcxml/cartero/templates/cartero/'", 'max_length': '255', 'match': "'\\\\.html$'"})
},
'cartero.excludedemail': {
'Meta': {'object_name': 'ExcludedEmail'},
'comments': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '200'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'reason': ('django.db.models.fields.CharField', [], {'max_length': '2'})
},
'cartero.linkclick': {
'Meta': {'object_name': 'LinkClick'},
'campaign': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cartero.Campaign']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ip_address': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True', 'db_index': 'True'}),