From 25fc0c6cad6293480433cb048a675f519c1407b8 Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Sat, 14 Mar 2020 00:48:15 +0100 Subject: [PATCH] =?UTF-8?q?Standard=20fertig=20AUSSER=20sonderfeld,=20rest?= =?UTF-8?q?=20l=C3=A4uft.=20Darstellung=20m=C3=BCssen=20wir=20echt=20nochm?= =?UTF-8?q?al=20besprechen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- news/__pycache__/views.cpython-38.pyc | Bin 3673 -> 3693 bytes news/views.py | 2 +- standards/__pycache__/models.cpython-38.pyc | Bin 2006 -> 2031 bytes standards/__pycache__/views.cpython-38.pyc | Bin 9809 -> 9855 bytes standards/models.py | 13 ++++++-- .../templates/standards/standards_add.html | 21 +++++++++++-- .../templates/standards/standards_single.html | 28 +++++++++++++----- standards/views.py | 16 +++++----- 8 files changed, 59 insertions(+), 21 deletions(-) diff --git a/news/__pycache__/views.cpython-38.pyc b/news/__pycache__/views.cpython-38.pyc index 0b197b2cf9c441841abdcf932672aedf7b63f8bc..ef35905ed24e91cfdd193b40eef52dda255e2371 100644 GIT binary patch delta 79 zcmca9^Hzp8l$V!_0SIIza^gxh^6qD1WSe}JNmi7-hPj5NhBbv_4$DGDMur-;U%l Olm9ctY|dx?#{~f8p%9G# diff --git a/news/views.py b/news/views.py index 765e5b9..1bbb7f6 100644 --- a/news/views.py +++ b/news/views.py @@ -21,7 +21,7 @@ class NewsManagement(LoginRequiredMixin, ListView): news = News.objects.filter(agency__pk=self.request.user.profile.agency.pk).filter(go_online_on__lt=filterdate).filter(go_offline_on__gt=filterdate).order_by('-created_date') news_arch = News.objects.filter(agency__pk=self.request.user.profile.agency.pk).filter(go_offline_on__lt=filterdate).order_by('-created_date') - news_coming = News.objects.filter(agency__pk=self.request.user.profile.agency.pk).filter(go_offline_on__gt=filterdate).order_by('-created_date') + news_coming = News.objects.filter(agency__pk=self.request.user.profile.agency.pk).filter(go_online_on__gt=filterdate).order_by('-created_date') context = super().get_context_data(**kwargs) context.update({'active_link' : 'dashboard', 'news' : news, 'news_arch' : news_arch, 'news_coming' : news_coming}) diff --git a/standards/__pycache__/models.cpython-38.pyc b/standards/__pycache__/models.cpython-38.pyc index 475fd1c5cfbee07974488f31dc801ab1f5fbd246..df8199757c9856ecfb7e7dc6298202ed49079bec 100644 GIT binary patch delta 451 zcmcb{|DK;Ol$V!_0SJE0&5qOO+Q_HO$i)WaIskET)MRVMOZBp;0x4`M{3!yx%u#Zw z%vlh=Aeb)?=L>=P3Shn>P`z+3Q&`lY5vB8gY~srxwK*r50#16$t=cS|ki4qS(Qr zsTENW>BQ0!O-8VE<`>4vlbG!o#V226_GdJktjJQKEd|mh3L?beganXvOCUY9Bt9{z zI6tSfBsIRYD938@5f*hut;ug#av4P?N3k9h;P*|;s|?8pk#3o(IVqE+*i$0z$!pkT1lR$DYrVVSn delta 426 zcmaFQe~q6nl$V!_0SMH4vg77+Y~)jBFs9LjodvO1fJ;4OaN#JtLod=TlDnVOR_ z*_+K+vq%bLm@M2xRI`h?ffBqxT&ywqAe#&is~8gq@`2#ww`?Z_5X!+U$;n6AwE#L+ BW+wmu diff --git a/standards/__pycache__/views.cpython-38.pyc b/standards/__pycache__/views.cpython-38.pyc index 4427a520d61170ed233e8bab23c36dc25d0448b0..79cbb5f062b629a0f3dbeb1e6e006f37a590b02a 100644 GIT binary patch delta 1093 zcmY+C&ubGw6vyYyc9U$jn>4Zcou*CFwAQxPAK*p7g9=&;qEI~93Jw*g(9$p>$XhB1 z-U7urs<81OC>50Tq8G)ZH;?`Uf+xLrQBmJcV{A7}cIUhA^WN+PW%yv_C1YEjQ+T$tC#Gc9)stsrSSxujP!7th#oILMK0Y4L9+Y?<#V z|7OCLg`Pr_VJ0bZw-`-G`h#1hAse!3d>xRsfDZR*DC9U*+s0VX!i4dEMop0a zj)`lM|IogT3FMMG-es$Cv+qaKwBA7PVMN!;_aPI$EZ+oZgp<`z00%>;(e8YBYxD`g<*-)&$>Dlf Y9xwBeWe&+jTCr?~{#{zt-aXCXFQZ``ApigX delta 1158 zcmZXTO=uHA6vyZ7X0u<}e6(rOq+e-FYg<#R9;Apz4^?up(xcYHsCA0LmJvL>C1Amm z0dYMPt++WT2ny9bc~bBuUOXzISMlsku)dv!w8ezUzS()dnR);B&raiW!&~w^htX&3 z-s+`~uf11xwxBbHOfU|s+I?;PRPfQBb{7#sqr+&v82q*0wm|f8tHe-W9>h4dRa{cB zqvA5^VYGwkA|Z=ewl(~ht{kGdEMN9CBPh;cNy*M<%Nt*p%} zHr->Bm{hFULbD4?f~y2)6m0H;rGhg(*g{LeHricwo7h9d))Z^+W49G+l$h^OPLaw^ zlO%dL!LuEpnUR*0;o;zuJ3c^9WITt?W5)AO^o|BhP6b+Oq7`pD9b+OXOkQY%pTZPf zVZpcM%mNwo*H#~}VTz_*|&LKlj?NHy)X|=hxdS6>>BA~_xlx_#k zL02A=GbaxmU*v;rZ3B3z#6(@GwTBdWxvlY`Ez?iSty$on;KAA@xqRTzP zWLQH>^{Fl=s82Sw;#OCwQLw&(7HWd5(P68mn)lMl)+>@7IJ%$bX={fr<)T9usKiDg zeyYd+q{i2fR8xP8pQvLZZaw8xX_PT3rv;omSdE-fRqR#RPacddP$Uaf(dC0%j_=7M z(PsZufO@c#7s1zlC%8TE8{Pyr3ROcjK6+R<3t&axi|+yQ!PC-97z!HY2at(=ly3o4 xqNU+4#7A?ZG&>tT8+#706g9^GXmBN3sFk&miyAmfG?INe`gLgxcb^#z{sEZLE7AY} diff --git a/standards/models.py b/standards/models.py index 5fff059..c44af06 100644 --- a/standards/models.py +++ b/standards/models.py @@ -32,11 +32,15 @@ class Standards(models.Model): # USER # VERTRETER - representative = models.ForeignKey(User, on_delete=models.PROTECT, related_name="user_repr", blank=True, null=True) + #representative = models.ForeignKey(User, on_delete=models.PROTECT, related_name="user_repr", blank=True, null=True) + representative = models.ManyToManyField(User, blank=True, related_name='user_rep') # AUSFÜHRENDER - executor = models.ForeignKey(User, on_delete=models.PROTECT, related_name="user_executor", blank=True, null=True) + #executor = models.ForeignKey(User, on_delete=models.PROTECT, related_name="user_executor", blank=True, null=True) + executor = models.ManyToManyField(User, blank=True, related_name='user_ex') # VERANTWORTLICHER - authority = models.ForeignKey(User, on_delete=models.PROTECT, related_name="user_authority", blank=True, null=True) + #authority = models.ForeignKey(User, on_delete=models.PROTECT, related_name="user_authority", blank=True, null=True) + authority = models.ManyToManyField(User, blank=True, related_name='user_aut') + # FILES addedfiles = models.ManyToManyField(DataFile, blank=True) # VERLINKTE STANDARDS @@ -44,6 +48,9 @@ class Standards(models.Model): # GORUPS visibleby = models.ManyToManyField(AgencyGroup, blank=True) + indi_name = models.CharField(max_length=200, blank=False, default="") + indi_conmtent = models.CharField(max_length=500, blank=False, default="") + def __str__(self): return f'{self.name}' diff --git a/standards/templates/standards/standards_add.html b/standards/templates/standards/standards_add.html index 0ef03e1..49f1fcc 100644 --- a/standards/templates/standards/standards_add.html +++ b/standards/templates/standards/standards_add.html @@ -11,9 +11,9 @@ {% for field in normalForm %} {% if forloop.counter|divisibleby:6 %}
- {{field|as_crispy_field }} + {{field|as_crispy_field }} {% else %} - {{field|as_crispy_field }} + {{field|as_crispy_field }} {% endif %} {% endfor %} @@ -105,6 +105,23 @@
+ diff --git a/standards/templates/standards/standards_single.html b/standards/templates/standards/standards_single.html index 93caced..d3f5ae6 100644 --- a/standards/templates/standards/standards_single.html +++ b/standards/templates/standards/standards_single.html @@ -17,18 +17,30 @@  | Bearbeiten {% endif%} -
- - {% if standard.authority %} - Verantwortlicher:   {{standard.authority.first_name}} {{standard.authority.last_name}} |  +
+ + {% if standard.authority.count > 0 %} + Verantwortliche:  + {% for u in standard.authority.all %} + {{u.first_name}} {{u.last_name}} |  + {% endfor %} +
{% endif %} - {% if standard.executor %} - Ausführende Person: {{standard.executor.first_name}} {{standard.executor.last_name}} |  + {% if standard.executor.count > 0 %} + Ausführende Personen:  + {% for u in standard.executor.all %} + {{u.first_name}} {{u.last_name}} |  + {% endfor %} +
{% endif %} - {% if standard.representative %} - Vertreter: {{standard.representative.first_name}} {{standard.representative.last_name}} |  + {% if standard.representative.count > 0 %} + Vertreter:  + {% for u in standard.representative.all %} + {{u.first_name}} {{u.last_name}} |  + {% endfor %} +
{% endif %} diff --git a/standards/views.py b/standards/views.py index dd21acc..dbfee48 100644 --- a/standards/views.py +++ b/standards/views.py @@ -107,13 +107,15 @@ def StandardAdd(request): new_standard.content = editorForm.cleaned_data['content'] new_standard.public = normalForm.cleaned_data['public'] - new_standard.representative = normalForm.cleaned_data['representative'] - new_standard.executor = normalForm.cleaned_data['executor'] - new_standard.authority = normalForm.cleaned_data['authority'] - # GROUPS new_standard.save() + new_standard.representative.set(normalForm.cleaned_data['representative']) + new_standard.executor.set(normalForm.cleaned_data['executor']) + new_standard.authority.set(normalForm.cleaned_data['authority']) + + + # ADD GROUPS groups = normalForm.cleaned_data['checked_groups'].split(",") @@ -192,9 +194,9 @@ def StandardUpdate(request, id): existing_standard.name = normalForm.cleaned_data['name'] existing_standard.content = editorForm.cleaned_data['content'] - existing_standard.representative = normalForm.cleaned_data['representative'] - existing_standard.executor = normalForm.cleaned_data['executor'] - existing_standard.authority = normalForm.cleaned_data['authority'] + existing_standard.representative.set(normalForm.cleaned_data['representative']) + existing_standard.executor.set(normalForm.cleaned_data['executor']) + existing_standard.authority.set(normalForm.cleaned_data['authority']) '''