Add migration for adding a2_service, fix import path for ForeignKey

This commit is contained in:
Benjamin Dauvergne 2015-06-22 16:48:49 +02:00
parent a81f23a5d4
commit 34302b62de
2 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('authentic2', '0007_auto_20150523_0028'),
('authentic2_pratic', '0005_auto_20150616_1649'),
]
operations = [
migrations.AddField(
model_name='service',
name='a2_service',
field=models.ForeignKey(related_name='pratic_service', verbose_name='related authentic2 service', blank=True, to='authentic2.Service', null=True),
preserve_default=True,
),
migrations.AddField(
model_name='serviceinstance',
name='a2_service',
field=models.ForeignKey(related_name='pratic_service_instances', verbose_name='related authentic2 service', blank=True, to='authentic2.Service', null=True),
preserve_default=True,
),
]

View File

@ -287,9 +287,10 @@ class Service(Model):
cas_service_url = URLField(
verbose_name=_('CAS service URL'),
blank=True)
a2_service = models.ForeignKey(
a2_service = ForeignKey(
to='authentic2.Service',
verbose_name=_('related authentic2 service'),
related_name='pratic_service',
blank=True,
null=True)
@ -344,9 +345,10 @@ class ServiceInstance(Model):
verbose_name=_('Authentication by certificate only'),
default=False,
blank=True)
a2_service = models.ForeignKey(
a2_service = ForeignKey(
to='authentic2.Service',
verbose_name=_('related authentic2 service'),
related_name='pratic_service_instances',
blank=True,
null=True)