Skip to content

Commit bf1cd88

Browse files
authored
Add xor field validation for models (#207)
* Collect translations for custom model validations * Show for now non field errors * Add autoclean and xor mixin to help with model field validations * Remove unsed script * Add basic tests * Freeze pytest requirements * Remove unused autosavemixin * Remove debugging flag * Add some pertinent comments * Run tests on gha * Test running actions from containers
1 parent 5baa762 commit bf1cd88

File tree

15 files changed

+539
-123
lines changed

15 files changed

+539
-123
lines changed

.github/workflows/tests.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
tests:
10+
runs-on: ubuntu-latest
11+
container: alexstefanescu/catpol-dependencies
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install -r requirements-dev.txt
19+
- name: Run tests
20+
env:
21+
DJANGO_SETTINGS_MODULE: project_template.settings.dev
22+
run: pytest project_template

locale/en/LC_MESSAGES/django.mo

88 Bytes
Binary file not shown.

locale/en/LC_MESSAGES/django.po

Lines changed: 153 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2019-01-26 15:15+0000\n"
11+
"POT-Creation-Date: 2020-02-12 20:37+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,56 +18,181 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
2020

21-
#: project_template/forms.py:8
22-
msgid "What is the name of the current politician?"
21+
#: project_template/forms.py:33
22+
msgid "Care este numele politicianului?"
2323
msgstr ""
2424

25-
#: project_template/forms.py:9
26-
msgid "What is the surname of the current politician?"
25+
#: project_template/forms.py:34
26+
msgid ""
27+
"Care este numele anterior al politicianului? (in cazul in care se aplica)"
28+
msgstr ""
29+
30+
#: project_template/forms.py:35
31+
msgid "Care sunt initialele politicianului? (in cazul in care se aplica)"
32+
msgstr ""
33+
34+
#: project_template/forms.py:36
35+
msgid "Care este prenumele politicianului?"
36+
msgstr ""
37+
38+
#: project_template/forms.py:38
39+
msgid "Care este pozitia politicianului?"
40+
msgstr ""
41+
42+
#: project_template/forms.py:39
43+
msgid "Care este data completării declarației de avere?"
44+
msgstr ""
45+
46+
#: project_template/forms.py:40
47+
msgid ""
48+
"Care este institutia in cadrul careia lucra politicianul la data completarii "
49+
"declaratiei de avere?"
50+
msgstr ""
51+
52+
#: project_template/forms.py:42
53+
msgid "Ce tip de declaratie este completata?"
54+
msgstr ""
55+
56+
#: project_template/forms.py:51 project_template/forms.py:73
57+
msgid "Care este numele proprietarului?"
58+
msgstr ""
59+
60+
#: project_template/forms.py:52 project_template/forms.py:74
61+
msgid "Care este prenumele proprietarului?"
62+
msgstr ""
63+
64+
#: project_template/forms.py:138
65+
msgid "Care este numele persoanei catre care s-a instrainat bunul?"
66+
msgstr ""
67+
68+
#: project_template/forms.py:139
69+
msgid "Care este prenumele persoanei catre care s-a instrainat bunul?"
70+
msgstr ""
71+
72+
#: project_template/forms.py:183 project_template/forms.py:294
73+
msgid "Care este numele beneficiarului?"
74+
msgstr ""
75+
76+
#: project_template/forms.py:184 project_template/forms.py:295
77+
msgid "Care este prenumele beneficiarului?"
78+
msgstr ""
79+
80+
#: project_template/forms.py:224
81+
msgid "Care este numele titularului?"
82+
msgstr ""
83+
84+
#: project_template/forms.py:225
85+
msgid "Care este prenumele titularului?"
86+
msgstr ""
87+
88+
#: project_template/forms.py:238 project_template/forms.py:308
89+
msgid "Care e numele persoanei?"
90+
msgstr ""
91+
92+
#: project_template/forms.py:239 project_template/forms.py:309
93+
msgid "Care e prenumele persoanei?"
94+
msgstr ""
95+
96+
#: project_template/forms.py:252 project_template/forms.py:266
97+
#: project_template/forms.py:280 project_template/forms.py:322
98+
#: project_template/forms.py:336
99+
msgid "Care e numele persoanei care a realizat venitul?"
100+
msgstr ""
101+
102+
#: project_template/forms.py:253 project_template/forms.py:267
103+
#: project_template/forms.py:281 project_template/forms.py:323
104+
#: project_template/forms.py:337
105+
msgid "Care e prenumele persoanei care a realizat venitul?"
106+
msgstr ""
107+
108+
#: project_template/models.py:45
109+
msgid "%(value)s is greater than 100%"
110+
msgstr ""
111+
112+
#: project_template/models.py:50
113+
msgid "%(value)s is lower than 0%"
114+
msgstr ""
115+
116+
#: project_template/models.py:58
117+
msgid "Name"
118+
msgstr ""
119+
120+
#: project_template/models.py:59
121+
msgid "Surname"
27122
msgstr ""
28123

29-
#: project_template/forms.py:10
30-
msgid "What is the position of the current politician?"
124+
#: project_template/models.py:60
125+
msgid "Initials"
31126
msgstr ""
32127

33-
#: project_template/forms.py:11
34-
msgid "Date"
128+
#: project_template/models.py:61
129+
msgid "Previous Name"
35130
msgstr ""
36131

37-
#: project_template/models.py:10
38-
msgid "The name"
132+
#: project_template/models.py:88
133+
msgid "Functie"
39134
msgstr ""
40135

41-
#: project_template/models.py:11
42-
msgid "The surname"
136+
#: project_template/models.py:89
137+
msgid "Data completare"
43138
msgstr ""
44139

45-
#: project_template/models.py:58 project_template/models.py:64
46-
#: project_template/models.py:70 project_template/models.py:76
47-
#: project_template/models.py:82 project_template/models.py:88
48-
#: project_template/models.py:94 project_template/models.py:100
49-
#: project_template/models.py:106 project_template/models.py:112
50-
#: project_template/models.py:118 project_template/models.py:124
51-
#: project_template/models.py:130 project_template/models.py:136
52-
#: project_template/models.py:142 project_template/models.py:148
53-
#: project_template/models.py:154 project_template/models.py:160
54-
#: project_template/models.py:166
140+
#: project_template/models.py:90
141+
msgid "Institutie"
142+
msgstr ""
143+
144+
#: project_template/models.py:91
145+
msgid "Tip declaratie"
146+
msgstr ""
147+
148+
#: project_template/models.py:109
149+
msgid "commune"
150+
msgstr "comuna"
151+
152+
#: project_template/models.py:110
153+
msgid "city"
154+
msgstr ""
155+
156+
#: project_template/models.py:138 project_template/models.py:180
157+
#: project_template/models.py:213 project_template/models.py:248
158+
#: project_template/models.py:268 project_template/models.py:322
159+
#: project_template/models.py:335 project_template/models.py:348
160+
#: project_template/models.py:361 project_template/models.py:374
161+
#: project_template/models.py:388
55162
msgid "The number of rows"
56163
msgstr ""
57164

58-
#: project_template/templates/base.html:7
59-
#: project_template/templates/home.html:14
165+
#: project_template/models.py:290
166+
msgid "person"
167+
msgstr ""
168+
169+
#: project_template/models.py:291
170+
msgid "lender"
171+
msgstr ""
172+
173+
#: project_template/templates/base.html:8
174+
#: project_template/templates/home.html:10
60175
msgid "HomePageTitle"
61176
msgstr "Document Digitization"
62177

63-
#: project_template/templates/base.html:34
178+
#: project_template/templates/base.html:31
64179
msgid "PoliticalCatalogue"
65180
msgstr "Political Catalogue"
66181

67-
#: project_template/templates/home.html:21
182+
#: project_template/templates/home.html:17
68183
msgid "GiveMeATask"
69184
msgstr "Give me a task!"
70185

71-
#: project_template/templates/task.html:42
186+
#: project_template/templates/task.html:48
72187
msgid "SendTheData"
73188
msgstr "Send the data"
189+
190+
#: project_template/utils.py:99
191+
#, python-brace-format
192+
msgid "Invalid field name {field}"
193+
msgstr ""
194+
195+
#: project_template/utils.py:106
196+
msgid "Use only one of the following fields: "
197+
msgstr ""
198+

locale/ro/LC_MESSAGES/django.mo

-233 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)