Commit eb210a1cb9b804c53963252e778031162788e0b9

Authored by Jailson Dias
1 parent e7bd3b32

Resolvendo problemas com a verificação de data atual dos resourses

pendencies/forms.py
@@ -68,20 +68,20 @@ class PendenciesForm(forms.ModelForm): @@ -68,20 +68,20 @@ class PendenciesForm(forms.ModelForm):
68 self.add_error('begin_date', _("This input should be filled with a date equal or after today's date.")) 68 self.add_error('begin_date', _("This input should be filled with a date equal or after today's date."))
69 69
70 if begin_date.date() < subject.init_date: 70 if begin_date.date() < subject.init_date:
71 - self.add_error('begin_date', _('This input should be filled with a date equal or after the subject begin date.')) 71 + self.add_error('begin_date', _('This input should be filled with a date equal or after the subject begin date.("%s")')%(subject.init_date))
72 72
73 if begin_date.date() > subject.end_date: 73 if begin_date.date() > subject.end_date:
74 - self.add_error('begin_date', _('This input should be filled with a date equal or after the subject end date.')) 74 + self.add_error('begin_date', _('This input should be filled with a date equal or before the subject end date.("%s")')%(subject.end_date))
75 75
76 if not end_date == ValueError and end_date: 76 if not end_date == ValueError and end_date:
77 if not self.instance.id and end_date.date() < datetime.datetime.today().date(): 77 if not self.instance.id and end_date.date() < datetime.datetime.today().date():
78 self.add_error('end_date', _("This input should be filled with a date equal or after today's date.")) 78 self.add_error('end_date', _("This input should be filled with a date equal or after today's date."))
79 79
80 if end_date.date() < subject.init_date: 80 if end_date.date() < subject.init_date:
81 - self.add_error('end_date', _('This input should be filled with a date equal or after the subject begin date.')) 81 + self.add_error('end_date', _('This input should be filled with a date equal or after the subject begin date.("%s")')%(subject.init_date))
82 82
83 if end_date.date() > subject.end_date: 83 if end_date.date() > subject.end_date:
84 - self.add_error('end_date', _('This input should be filled with a date equal or before the subject end date.')) 84 + self.add_error('end_date', _('This input should be filled with a date equal or before the subject end date.("%s")')%(subject.end_date))
85 85
86 return cleaned_data 86 return cleaned_data
87 87
@@ -162,30 +162,30 @@ class PendenciesLimitedForm(forms.ModelForm): @@ -162,30 +162,30 @@ class PendenciesLimitedForm(forms.ModelForm):
162 self.add_error('begin_date', _("This input should be filled with a date equal or after today's date.")) 162 self.add_error('begin_date', _("This input should be filled with a date equal or after today's date."))
163 163
164 if begin_date.date() < subject.init_date: 164 if begin_date.date() < subject.init_date:
165 - self.add_error('begin_date', _('This input should be filled with a date equal or after the subject begin date.')) 165 + self.add_error('begin_date', _('This input should be filled with a date equal or after the subject begin date.("%s")')%(subject.init_date))
166 166
167 if begin_date.date() > subject.end_date: 167 if begin_date.date() > subject.end_date:
168 - self.add_error('begin_date', _('This input should be filled with a date equal or after the subject end date.')) 168 + self.add_error('begin_date', _('This input should be filled with a date equal or before the subject end date.("%s")')%(subject.end_date))
169 169
170 if not end_date == ValueError and end_date: 170 if not end_date == ValueError and end_date:
171 if not self.instance.id and end_date.date() < datetime.datetime.today().date(): 171 if not self.instance.id and end_date.date() < datetime.datetime.today().date():
172 self.add_error('end_date', _("This input should be filled with a date equal or after today's date.")) 172 self.add_error('end_date', _("This input should be filled with a date equal or after today's date."))
173 173
174 if end_date.date() < subject.init_date: 174 if end_date.date() < subject.init_date:
175 - self.add_error('end_date', _('This input should be filled with a date equal or after the subject begin date.')) 175 + self.add_error('end_date', _('This input should be filled with a date equal or after the subject begin date.("%s")')%(subject.init_date))
176 176
177 if end_date.date() > subject.end_date: 177 if end_date.date() > subject.end_date:
178 - self.add_error('end_date', _('This input should be filled with a date equal or before the subject end date.')) 178 + self.add_error('end_date', _('This input should be filled with a date equal or before the subject end date.("%s")')%(subject.end_date))
179 179
180 if not limit_date == ValueError and limit_date: 180 if not limit_date == ValueError and limit_date:
181 if not self.instance.id and limit_date.date() < datetime.datetime.today().date(): 181 if not self.instance.id and limit_date.date() < datetime.datetime.today().date():
182 self.add_error('limit_date', _("This input should be filled with a date equal or after today's date.")) 182 self.add_error('limit_date', _("This input should be filled with a date equal or after today's date."))
183 183
184 if limit_date.date() < subject.init_date: 184 if limit_date.date() < subject.init_date:
185 - self.add_error('limit_date', _('This input should be filled with a date equal or after the subject begin date.')) 185 + self.add_error('limit_date', _('This input should be filled with a date equal or after the subject begin date.("%s")')%(subject.init_date))
186 186
187 if limit_date.date() > subject.end_date: 187 if limit_date.date() > subject.end_date:
188 - self.add_error('limit_date', _('This input should be filled with a date equal or before the subject end date.')) 188 + self.add_error('limit_date', _('This input should be filled with a date equal or before the subject end date.("%s")')%(subject.end_date))
189 189
190 if limit_submission_date: 190 if limit_submission_date:
191 limit_submission_date = datetime.datetime.strptime(limit_submission_date, get_format('DATETIME_CONVERT_FORMAT')) 191 limit_submission_date = datetime.datetime.strptime(limit_submission_date, get_format('DATETIME_CONVERT_FORMAT'))
@@ -193,14 +193,14 @@ class PendenciesLimitedForm(forms.ModelForm): @@ -193,14 +193,14 @@ class PendenciesLimitedForm(forms.ModelForm):
193 193
194 if not begin_date == ValueError and begin_date: 194 if not begin_date == ValueError and begin_date:
195 if begin_date.date() > limit_submission_date.date(): 195 if begin_date.date() > limit_submission_date.date():
196 - self.add_error('begin_date', _('This input should be filled with a date equal or before the goals submission limit date.')) 196 + self.add_error('begin_date', _('This input should be filled with a date equal or before the goals submission limit date.("%s")')%(subject.limit_submission_date.date()))
197 197
198 if not end_date == ValueError and end_date: 198 if not end_date == ValueError and end_date:
199 if end_date.date() > limit_submission_date.date(): 199 if end_date.date() > limit_submission_date.date():
200 - self.add_error('end_date', _('This input should be filled with a date equal or before the goals submission limit date.')) 200 + self.add_error('end_date', _('This input should be filled with a date equal or before the goals submission limit date.("%s")')%(subject.limit_submission_date.date()))
201 201
202 if not limit_date == ValueError and limit_date: 202 if not limit_date == ValueError and limit_date:
203 if limit_date.date() > limit_submission_date.date(): 203 if limit_date.date() > limit_submission_date.date():
204 - self.add_error('limit_date', _('This input should be filled with a date equal or before the goals submission limit date.')) 204 + self.add_error('limit_date', _('This input should be filled with a date equal or before the goals submission limit date.("%s")')%(subject.limit_submission_date.date()))
205 205
206 return cleaned_data 206 return cleaned_data
pendencies/locale/pt_BR/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid &quot;&quot; @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 msgstr "" 8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n" 9 "Project-Id-Version: PACKAGE VERSION\n"
10 "Report-Msgid-Bugs-To: \n" 10 "Report-Msgid-Bugs-To: \n"
11 -"POT-Creation-Date: 2017-04-06 22:17-0300\n" 11 +"POT-Creation-Date: 2017-04-08 18:18-0300\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n" 14 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,125 +18,109 @@ msgstr &quot;&quot; @@ -18,125 +18,109 @@ msgstr &quot;&quot;
18 "Content-Transfer-Encoding: 8bit\n" 18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
20 20
21 -#: pendencies/forms.py:49 pendencies/forms.py:52 pendencies/forms.py:55  
22 -#: pendencies/forms.py:128 pendencies/forms.py:131 pendencies/forms.py:134  
23 -#: pendencies/forms.py:137 21 +#: forms.py:49 forms.py:52 forms.py:55 forms.py:128 forms.py:131 forms.py:134
  22 +#: forms.py:137
24 msgid "This field is required." 23 msgid "This field is required."
25 msgstr "Esse campo é obrigatório." 24 msgstr "Esse campo é obrigatório."
26 25
27 -#: pendencies/forms.py:60 pendencies/forms.py:142 26 +#: forms.py:60 forms.py:142
28 msgid "This input should be filled with a date equal or before the End Date." 27 msgid "This input should be filled with a date equal or before the End Date."
29 msgstr "" 28 msgstr ""
30 "Esse campo deve ser preenchido com uma data igual ou anterior à Data Final." 29 "Esse campo deve ser preenchido com uma data igual ou anterior à Data Final."
31 30
32 -#: pendencies/forms.py:61 pendencies/forms.py:143 pendencies/forms.py:149 31 +#: forms.py:61 forms.py:143 forms.py:149
33 msgid "This input should be filled with a date equal or after the Begin Date." 32 msgid "This input should be filled with a date equal or after the Begin Date."
34 msgstr "" 33 msgstr ""
35 "Esse campo deve ser preenchido com uma data igual ou posterior à Data " 34 "Esse campo deve ser preenchido com uma data igual ou posterior à Data "
36 "Inicial." 35 "Inicial."
37 36
38 -#: pendencies/forms.py:68 pendencies/forms.py:78 pendencies/forms.py:162  
39 -#: pendencies/forms.py:172 pendencies/forms.py:182 37 +#: forms.py:68 forms.py:78 forms.py:162 forms.py:172 forms.py:182
40 msgid "This input should be filled with a date equal or after today's date." 38 msgid "This input should be filled with a date equal or after today's date."
41 msgstr "" 39 msgstr ""
42 "Esse campo deve ser preenchido com uma data igual ou posterior à data atual." 40 "Esse campo deve ser preenchido com uma data igual ou posterior à data atual."
43 41
44 -#: pendencies/forms.py:71 pendencies/forms.py:81 pendencies/forms.py:165  
45 -#: pendencies/forms.py:175 pendencies/forms.py:185 42 +#: forms.py:71 forms.py:81 forms.py:165 forms.py:175 forms.py:185
  43 +#, python-format
46 msgid "" 44 msgid ""
47 "This input should be filled with a date equal or after the subject begin " 45 "This input should be filled with a date equal or after the subject begin "
48 -"date." 46 +"date.(\"%s\")"
49 msgstr "" 47 msgstr ""
50 "Esse campo deve ser preenchido com uma data igual ou posterior à data " 48 "Esse campo deve ser preenchido com uma data igual ou posterior à data "
51 -"inicial do assunto." 49 +"inicial do assunto.(\"%s\")"
52 50
53 -#: pendencies/forms.py:74 pendencies/forms.py:168  
54 -msgid ""  
55 -"This input should be filled with a date equal or after the subject end date."  
56 -msgstr ""  
57 -"Esse campo deve ser preenchido com uma data igual ou posterior à data final "  
58 -"do assunto."  
59 -  
60 -#: pendencies/forms.py:84 pendencies/forms.py:178 pendencies/forms.py:188 51 +#: forms.py:74 forms.py:84 forms.py:168 forms.py:178 forms.py:188
  52 +#, python-format
61 msgid "" 53 msgid ""
62 "This input should be filled with a date equal or before the subject end date." 54 "This input should be filled with a date equal or before the subject end date."
  55 +"(\"%s\")"
63 msgstr "" 56 msgstr ""
64 "Esse campo deve ser preenchido com uma data igual ou anterior à data final " 57 "Esse campo deve ser preenchido com uma data igual ou anterior à data final "
65 -"do assunto" 58 +"do assunto.(\"%s\")"
66 59
67 -#: pendencies/forms.py:148 pendencies/forms.py:154  
68 -#, fuzzy  
69 -#| msgid ""  
70 -#| "This input should be filled with a date equal or before the End Date." 60 +#: forms.py:148 forms.py:154
71 msgid "This input should be filled with a date equal or before the Limit Date." 61 msgid "This input should be filled with a date equal or before the Limit Date."
72 msgstr "" 62 msgstr ""
73 "Esse campo deve ser preenchido com uma data igual ou anterior à Data Final." 63 "Esse campo deve ser preenchido com uma data igual ou anterior à Data Final."
74 64
75 -#: pendencies/forms.py:155  
76 -#, fuzzy  
77 -#| msgid ""  
78 -#| "This input should be filled with a date equal or after the Begin Date." 65 +#: forms.py:155
79 msgid "This input should be filled with a date equal or after the End Date." 66 msgid "This input should be filled with a date equal or after the End Date."
80 msgstr "" 67 msgstr ""
81 "Esse campo deve ser preenchido com uma data igual ou posterior à Data " 68 "Esse campo deve ser preenchido com uma data igual ou posterior à Data "
82 "Inicial." 69 "Inicial."
83 70
84 -#: pendencies/forms.py:196 pendencies/forms.py:200 pendencies/forms.py:204  
85 -#, fuzzy  
86 -#| msgid ""  
87 -#| "This input should be filled with a date equal or before the subject end "  
88 -#| "date." 71 +#: forms.py:196 forms.py:200 forms.py:204
  72 +#, python-format
89 msgid "" 73 msgid ""
90 "This input should be filled with a date equal or before the goals submission " 74 "This input should be filled with a date equal or before the goals submission "
91 -"limit date." 75 +"limit date.(\"%s\")"
92 msgstr "" 76 msgstr ""
93 "Esse campo deve ser preenchido com uma data igual ou anterior à data final " 77 "Esse campo deve ser preenchido com uma data igual ou anterior à data final "
94 -"do assunto" 78 +"do assunto.(\"%s\")"
95 79
96 -#: pendencies/models.py:8 80 +#: models.py:8
97 msgid "Action" 81 msgid "Action"
98 msgstr "Ação" 82 msgstr "Ação"
99 83
100 -#: pendencies/models.py:8 84 +#: models.py:8
101 msgid "Visualize" 85 msgid "Visualize"
102 msgstr "Visualizar" 86 msgstr "Visualizar"
103 87
104 -#: pendencies/models.py:8 88 +#: models.py:8
105 msgid "Create" 89 msgid "Create"
106 msgstr "Criar" 90 msgstr "Criar"
107 91
108 -#: pendencies/models.py:8 92 +#: models.py:8
109 msgid "Answer" 93 msgid "Answer"
110 msgstr "Responder" 94 msgstr "Responder"
111 95
112 -#: pendencies/models.py:8 96 +#: models.py:8
113 msgid "Access" 97 msgid "Access"
114 msgstr "Acessar" 98 msgstr "Acessar"
115 99
116 -#: pendencies/models.py:8 100 +#: models.py:8
117 msgid "Participate" 101 msgid "Participate"
118 -msgstr "" 102 +msgstr "Participar"
119 103
120 -#: pendencies/models.py:8 104 +#: models.py:8
121 msgid "Finish" 105 msgid "Finish"
122 -msgstr "" 106 +msgstr "Fim"
123 107
124 -#: pendencies/models.py:8 108 +#: models.py:8
125 msgid "Submit" 109 msgid "Submit"
126 -msgstr "" 110 +msgstr "Enviar"
127 111
128 -#: pendencies/models.py:9 112 +#: models.py:9
129 msgid "Begin Date" 113 msgid "Begin Date"
130 msgstr "Data Inicial" 114 msgstr "Data Inicial"
131 115
132 -#: pendencies/models.py:10 116 +#: models.py:10
133 msgid "End Date" 117 msgid "End Date"
134 msgstr "Data Final" 118 msgstr "Data Final"
135 119
136 -#: pendencies/models.py:11 120 +#: models.py:11
137 msgid "Limit Date" 121 msgid "Limit Date"
138 msgstr "Data Limite" 122 msgstr "Data Limite"
139 123
140 -#: pendencies/models.py:12 124 +#: models.py:12
141 msgid "Resource" 125 msgid "Resource"
142 msgstr "Recurso" 126 msgstr "Recurso"