|
@@ -0,0 +1,37 @@
|
|
|
|
+# -*- coding: utf-8 -*-
|
|
|
|
+from __future__ import unicode_literals
|
|
|
|
+
|
|
|
|
+from django.db import models
|
|
|
|
+from django.core.validators import RegexValidator
|
|
|
|
+
|
|
|
|
+from coin.configuration.models import Configuration
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class FDNWhiteLabel(Configuration):
|
|
|
|
+ class Meta:
|
|
|
|
+ verbose_name = 'marque blanche FDN'
|
|
|
|
+ # If Django's default pluralisation is not satisfactory
|
|
|
|
+ # verbose_name_plural = 'very many DSL lines'
|
|
|
|
+
|
|
|
|
+ # URL namespace associated to this configuration type, to build URLs
|
|
|
|
+ # in various view. Should also be defined in urls.py. Here, we don't
|
|
|
|
+ # define any view, so there's no need for an URL namespace.
|
|
|
|
+ url_namespace = "fdn"
|
|
|
|
+ phone_number = models.CharField(max_length=20,
|
|
|
|
+ verbose_name='phone number',
|
|
|
|
+ help_text="Phone number associated to the DSL line")
|
|
|
|
+ address = models.TextField(
|
|
|
|
+ verbose_name='adresse postale', blank=True, null=True)
|
|
|
|
+ postal_code = models.CharField(max_length=5, blank=True, null=True,
|
|
|
|
+ validators=[RegexValidator(regex=r'^\d{5}$',
|
|
|
|
+ message='Code postal non valide.')],
|
|
|
|
+ verbose_name='code postal')
|
|
|
|
+ city = models.CharField(max_length=200, blank=True, null=True,
|
|
|
|
+ verbose_name='commune')
|
|
|
|
+
|
|
|
|
+ def __unicode__(self):
|
|
|
|
+ return self.phone_number
|
|
|
|
+
|
|
|
|
+ def subnet_event(self):
|
|
|
|
+ # Do something with self.ip_subnet.all() here.
|
|
|
|
+ pass
|