File: models.py

package info (click to toggle)
python-django-constance 4.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 800 kB
  • sloc: python: 2,089; makefile: 25; javascript: 23; sh: 6
file content (18 lines) | stat: -rw-r--r-- 524 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from django.db import models
from django.utils.translation import gettext_lazy as _


class Constance(models.Model):
    key = models.CharField(max_length=255, unique=True)
    value = models.TextField(null=True, blank=True, editable=False)

    class Meta:
        verbose_name = _("constance")
        verbose_name_plural = _("constances")
        permissions = [
            ("change_config", "Can change config"),
            ("view_config", "Can view config"),
        ]

    def __str__(self):
        return self.key