diff --git a/topologie/migrations/0013_port_related.py b/topologie/migrations/0013_port_related.py new file mode 100644 index 00000000..afce7dce --- /dev/null +++ b/topologie/migrations/0013_port_related.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0012_port_machine_interface'), + ] + + operations = [ + migrations.AddField( + model_name='port', + name='related', + field=models.OneToOneField(null=True, to='topologie.Port', blank=True, related_name='related_port'), + ), + ] diff --git a/topologie/migrations/0014_auto_20160706_1238.py b/topologie/migrations/0014_auto_20160706_1238.py new file mode 100644 index 00000000..3be29e79 --- /dev/null +++ b/topologie/migrations/0014_auto_20160706_1238.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0013_port_related'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='port', + unique_together=set([('switch', 'port')]), + ), + migrations.RemoveField( + model_name='port', + name='_content_type', + ), + migrations.RemoveField( + model_name='port', + name='_object_id', + ), + ] diff --git a/topologie/migrations/0015_auto_20160706_1452.py b/topologie/migrations/0015_auto_20160706_1452.py new file mode 100644 index 00000000..29f9ca99 --- /dev/null +++ b/topologie/migrations/0015_auto_20160706_1452.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0014_auto_20160706_1238'), + ] + + operations = [ + migrations.RemoveField( + model_name='port', + name='related', + ), + migrations.AddField( + model_name='port', + name='related', + field=models.ManyToManyField(related_name='_port_related_+', to='topologie.Port', blank=True), + ), + ] diff --git a/topologie/migrations/0016_auto_20160706_1531.py b/topologie/migrations/0016_auto_20160706_1531.py new file mode 100644 index 00000000..649eab2d --- /dev/null +++ b/topologie/migrations/0016_auto_20160706_1531.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0015_auto_20160706_1452'), + ] + + operations = [ + migrations.RemoveField( + model_name='port', + name='related', + ), + migrations.AddField( + model_name='port', + name='related', + field=models.OneToOneField(blank=True, to='topologie.Port', related_name='related_port', null=True), + ), + ] diff --git a/users/models.py b/users/models.py index 8e5af681..c12def82 100644 --- a/users/models.py +++ b/users/models.py @@ -131,6 +131,17 @@ class SchoolForm(ModelForm): model = School fields = ['name'] + def __init__(self, *args, **kwargs): + super(SchoolForm, self).__init__(*args, **kwargs) + self.fields['name'].label = 'Établissement à ajouter' + +class DelSchoolForm(ModelForm): + schools = forms.ModelMultipleChoiceField(queryset=School.objects.all(), label="Etablissements actuels", widget=forms.CheckboxSelectMultiple) + + class Meta: + exclude = ['name'] + model = School + class RightForm(ModelForm): def __init__(self, *args, **kwargs): super(RightForm, self).__init__(*args, **kwargs) diff --git a/users/templates/users/sidebar.html b/users/templates/users/sidebar.html index 1cc97e47..d4d34a19 100644 --- a/users/templates/users/sidebar.html +++ b/users/templates/users/sidebar.html @@ -5,5 +5,7 @@
Liste des accès à titre gracieux
+ + {% endblock %} diff --git a/users/urls.py b/users/urls.py index a7d8b89a..616f3a88 100644 --- a/users/urls.py +++ b/users/urls.py @@ -13,6 +13,8 @@ urlpatterns = [ url(r'^edit_whitelist/(?P