models.py 814 Bytes
Newer Older
Aymeric Barantal's avatar
Aymeric Barantal committed
1
2
from django.db import models
from django.contrib.auth.models import User
3
from campaign.campaign.models import Contact
Aymeric Barantal's avatar
Aymeric Barantal committed
4
5
6
7
8
9


class Organization(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=64)
    sip_key = models.CharField(max_length=255)
10
11
12
13
    users = models.ForeignKey(User, blank=True)

    def __unicode__(self):
        return self.name
14
15
16
17
18
19
20
21
22
23
24
25
26


class Group(models.Model):
    """Group model to qualify contacts"""
    id = models.AutoField(primary_key=True)
    organisation_id = models.ForeignKey(Organization)
    name = models.CharField(max_length=64)
    type = models.CharField(max_length=255, blank=True)
    media = models.CharField(max_length=255, blank=True)
    contacts = models.ManyToManyField(Contact)

    def __unicode__(self):
        return self.name