diff --git a/news/__pycache__/views.cpython-38.pyc b/news/__pycache__/views.cpython-38.pyc index 0b197b2..ef35905 100644 Binary files a/news/__pycache__/views.cpython-38.pyc and b/news/__pycache__/views.cpython-38.pyc differ 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 475fd1c..df81997 100644 Binary files a/standards/__pycache__/models.cpython-38.pyc and b/standards/__pycache__/models.cpython-38.pyc differ diff --git a/standards/__pycache__/views.cpython-38.pyc b/standards/__pycache__/views.cpython-38.pyc index 4427a52..79cbb5f 100644 Binary files a/standards/__pycache__/views.cpython-38.pyc and b/standards/__pycache__/views.cpython-38.pyc differ 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 %}