Commit a0a062be authored by okhin's avatar okhin

Making migrations

parent e20da055
from django.db import models
from django.utils.translation import ugettext_lazy as _
from picampaign.campaign.models import Campaign
class Importer(models.Model):
"""Importer model. Used to populate campaign with contacts"""
id = models.AutoField(primary_key=True)
......@@ -9,7 +11,7 @@ class Importer(models.Model):
data_format = models.CharField(max_length=4, choices=[('JSON', 'json'), ('CSV', 'csv')])
file = models.FileField(upload_to='imports/', blank=True, null=True)
url = models.URLField(blank=True, null=True)
campaign = models.ForeignKey('Campaign', on_delete=models.SET_NULL)
campaign = models.ForeignKey(Campaign, on_delete=models.SET_NULL, null=True)
def __str__(self):
return _(u'%{name}: %{format} %{type} importer' % {'format': self.data_format,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment