from django.db import models


class Domaine(models.Model):
    """
    Modèle des domaines
    """

    class Cols():
        """ Constantes pour les noms de colonnes """

        PK      = 'd_code'

    d_code = models.CharField('code', primary_key=True, max_length=100)

    def as_dict(self):
        return {
            'id': self.d_code,
            'code': self.d_code,
            'libelle': self.d_code,
        }
