Debian Codegraph @

ansible_collections/community/general/plugins/doc_fragments/_django.py

raw
1 # Copyright (c) 2024, Alexei Znamensky <[email protected]>
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 # Note that this doc fragment is **PRIVATE** to the collection. It can have breaking changes at any time.
6 # Do not use this from other collections or standalone plugins/modules!
7
8 from __future__ import annotations
9
10
11 class ModuleDocFragment:
12 DOCUMENTATION = r"""
13 options:
14 venv:
15 description:
16 - Use the Python interpreter from this virtual environment.
17 - Pass the path to the root of the virtualenv, not the C(bin/) directory nor the C(python) executable.
18 type: path
19 settings:
20 description:
21 - Specifies the settings module to use.
22 - The value is passed as is to the C(--settings) argument in C(django-admin).
23 type: str
24 required: true
25 pythonpath:
26 description:
27 - Adds the given filesystem path to the Python import search path.
28 - The value is passed as is to the C(--pythonpath) argument in C(django-admin).
29 type: path
30 traceback:
31 description:
32 - Provides a full stack trace in the output when a C(CommandError) is raised.
33 type: bool
34 verbosity:
35 description:
36 - Specifies the amount of notification and debug information in the output of C(django-admin).
37 type: int
38 choices: [0, 1, 2, 3]
39 skip_checks:
40 description:
41 - Skips running system checks prior to running the command.
42 type: bool
43
44
45 notes:
46 - The C(django-admin) command is always executed using the C(C) locale, and the option C(--no-color) is always passed.
47 seealso:
48 - name: django-admin and manage.py in official Django documentation
49 description: >-
50 Refer to this documentation for the builtin commands and options of C(django-admin). Please make sure that you select
51 the right version of Django in the version selector on that page.
52 link: https://docs.djangoproject.com/en/5.0/ref/django-admin/
53 """
54
55 DATABASE = r"""
56 options:
57 database:
58 description:
59 - Specify the database to be used.
60 type: str
61 default: default
62 """
63
64 DATA = r"""
65 options:
66 excludes:
67 description:
68 - Applications or models to be excluded.
69 - Format must be either V(app_label) or V(app_label.ModelName).
70 type: list
71 elements: str
72 format:
73 description:
74 - Serialization format of the output data.
75 type: str
76 default: json
77 choices: [xml, json, jsonl, yaml]
78 notes:
79 - As it is now, the module is B(not idempotent). Ensuring idempotency for this case can be a bit tricky, because it would
80 amount to ensuring beforehand that all the data in the fixture file is already in the database, which is not a trivial feat.
81 Unfortunately, neither C(django loaddata) nor C(django dumpdata) have a C(--dry-run) option, so the only way to know whether
82 there is a change or not is to actually load or dump the data.
83 """