Coverage for crateweb/core/constants.py: 100%
26 statements
« prev ^ index » next coverage.py v7.8.0, created at 2026-01-06 10:22 -0600
« prev ^ index » next coverage.py v7.8.0, created at 2026-01-06 10:22 -0600
1"""
2crate_anon/crateweb/core/constants.py
4===============================================================================
6 Copyright (C) 2015, University of Cambridge, Department of Psychiatry.
7 Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
9 This file is part of CRATE.
11 CRATE is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 CRATE is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with CRATE. If not, see <https://www.gnu.org/licenses/>.
24===============================================================================
26**Core constants, like field lengths.**
28"""
30DJANGO_DEFAULT_CONNECTION = "default" # key to django.db.connections
31RESEARCH_DB_CONNECTION_NAME = "research"
33LEN_ADDRESS = 100
34LEN_FIELD_DESCRIPTION = 100
35LEN_NAME = 100
36LEN_PHONE = 20
37LEN_TITLE = 20
38MAX_HASH_LENGTH = 128
39SCRUBBER_PNG_FILENAME = "scrubber.png"
42class SettingsKeys:
43 """
44 Keys for the Django ``settings.py`` file -- particularly those that are
45 optional, for which we use :func:`getattr`.
46 """
48 ARCHIVE_ATTACHMENT_DIR = "ARCHIVE_ATTACHMENT_DIR"
49 ARCHIVE_CONTEXT = "ARCHIVE_CONTEXT"
50 ARCHIVE_ROOT_TEMPLATE = "ARCHIVE_ROOT_TEMPLATE"
51 ARCHIVE_STATIC_DIR = "ARCHIVE_STATIC_DIR"
52 ARCHIVE_TEMPLATE_CACHE_DIR = "ARCHIVE_TEMPLATE_CACHE_DIR"
53 ARCHIVE_TEMPLATE_DIR = "ARCHIVE_TEMPLATE_DIR"
54 CACHE_CONTROL_MAX_AGE_ARCHIVE_ATTACHMENTS = (
55 "CACHE_CONTROL_MAX_AGE_ARCHIVE_ATTACHMENTS"
56 )
57 CACHE_CONTROL_MAX_AGE_ARCHIVE_STATIC = (
58 "CACHE_CONTROL_MAX_AGE_ARCHIVE_STATIC"
59 )
60 CACHE_CONTROL_MAX_AGE_ARCHIVE_TEMPLATES = (
61 "CACHE_CONTROL_MAX_AGE_ARCHIVE_TEMPLATES"
62 )
63 DISABLE_DJANGO_PYODBC_AZURE_CURSOR_FETCHONE_NEXTSET = (
64 "DISABLE_DJANGO_PYODBC_AZURE_CURSOR_FETCHONE_NEXTSET"
65 )
66 NLP_SOURCEDB_MAP = "NLP_SOURCEDB_MAP"
67 VISZONE_CONTEXT = "VISZONE_CONTEXT"
68 VISZONE_ROOT_TEMPLATE = "VISZONE_ROOT_TEMPLATE"
69 VISZONE_STATIC_DIR = "VISZONE_STATIC_DIR"
70 VISZONE_TEMPLATE_CACHE_DIR = "VISZONE_TEMPLATE_CACHE_DIR"
71 VISZONE_TEMPLATE_DIR = "VISZONE_TEMPLATE_DIR"