12345678910111213141516171819202122232425262728293031323334 |
- # -*- coding: utf-8 -*-
- from __future__ import unicode_literals
- from django.db import models
- from django.utils.translation import ugettext_lazy as _
- from coin.configuration.models import Configuration
- class SimpleDSL(Configuration):
- """Very simple DSL model, mostly to demonstrate the use of the generic
- functionality of COIN. There is no real configuration backend, and no
- authentication data. But this still allows to track the phone number
- and IP addresses of subscribers, which may be useful for "white label"
- DSL reselling.
- """
- class Meta:
- verbose_name = _('DSL line')
- verbose_name_plural = _('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 = "dsl"
- phone_number = models.CharField(max_length=20,
- verbose_name=_('phone number'),
- help_text=_("Phone number associated to the DSL line"))
-
- def __unicode__(self):
- return self.phone_number
- def subnet_event(self):
- # Do something with self.ip_subnet.all() here.
- pass
|