phone: add missing fields in phonecall model

This commit is contained in:
Frédéric Péters 2015-11-03 12:03:41 +01:00
parent 7250357cbb
commit d6b0e5e9d0
2 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('phone', '0002_auto_20151028_1635'),
]
operations = [
migrations.AddField(
model_name='phonecall',
name='contact_id',
field=models.CharField(max_length=50, null=True),
preserve_default=True,
),
migrations.AddField(
model_name='phonecall',
name='status',
field=models.CharField(max_length=50, verbose_name='Status', blank=True),
preserve_default=True,
),
]

View File

@ -14,24 +14,33 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib.contenttypes import generic
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from welco.qualif.models import Association
class PhoneCall(models.Model):
class Meta:
verbose_name = _('Phone Call')
creation_timestamp = models.DateTimeField(auto_now_add=True)
last_update_timestamp = models.DateTimeField(auto_now=True)
caller = models.CharField(_('Caller'), max_length=20)
callee = models.CharField(_('Callee'), max_length=20)
start = models.DateTimeField(_('Start'), auto_now_add=True)
stop = models.DateTimeField(_('Stop'), null=True, blank=True)
data = models.TextField(_('Data'), blank=True)
# common to all source types:
status = models.CharField(_('Status'), blank=True, max_length=50)
contact_id = models.CharField(max_length=50, null=True)
associations = generic.GenericRelation(Association,
content_type_field='source_type', object_id_field='source_pk')
creation_timestamp = models.DateTimeField(auto_now_add=True)
last_update_timestamp = models.DateTimeField(auto_now=True)
@classmethod
def get_qualification_form_class(cls):
return None