diff --git a/greenmine/projects/issues/models.py b/greenmine/projects/issues/models.py index 4fbaa280..7ca917b9 100644 --- a/greenmine/projects/issues/models.py +++ b/greenmine/projects/issues/models.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django.db import models +from django.contrib.contenttypes import generic from django.conf import settings from django.utils import timezone from django.dispatch import receiver @@ -48,6 +49,7 @@ class Issue(WatchedMixin): related_name="watched_issues", verbose_name=_("watchers")) tags = PickledObjectField(null=False, blank=True, verbose_name=_("tags")) + attachments = generic.GenericRelation("projects.Attachment") notifiable_fields = [ "owner", diff --git a/greenmine/projects/questions/models.py b/greenmine/projects/questions/models.py index ad1e226f..77031a9a 100644 --- a/greenmine/projects/questions/models.py +++ b/greenmine/projects/questions/models.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django.db import models +from django.contrib.contenttypes import generic from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.utils import timezone @@ -42,6 +43,7 @@ class Question(WatchedMixin): related_name="watched_questions", verbose_name=_("watchers")) tags = PickledObjectField(null=False, blank=True, verbose_name=_("tags")) + attachments = generic.GenericRelation("projects.Attachment") notifiable_fields = [ "owner", diff --git a/greenmine/projects/tasks/models.py b/greenmine/projects/tasks/models.py index 0cef11ee..7a2e5c46 100644 --- a/greenmine/projects/tasks/models.py +++ b/greenmine/projects/tasks/models.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django.db import models +from django.contrib.contenttypes import generic from django.conf import settings from django.utils import timezone from django.dispatch import receiver @@ -43,6 +44,7 @@ class Task(WatchedMixin): watchers = models.ManyToManyField(settings.AUTH_USER_MODEL, null=True, blank=True, related_name="watched_tasks", verbose_name=_("watchers")) tags = PickledObjectField(null=False, blank=True, verbose_name=_("tags")) + attachments = generic.GenericRelation("projects.Attachment") is_iocaine = models.BooleanField(default=False, null=False, blank=True, verbose_name=_("is iocaine")) diff --git a/greenmine/projects/userstories/models.py b/greenmine/projects/userstories/models.py index edd2489a..6d9030ce 100644 --- a/greenmine/projects/userstories/models.py +++ b/greenmine/projects/userstories/models.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django.db import models +from django.contrib.contenttypes import generic from django.conf import settings from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ @@ -70,6 +71,7 @@ class UserStory(WatchedMixin): verbose_name=_("is team requirement")) tags = PickledObjectField(null=False, blank=True, verbose_name=_("tags")) + attachments = generic.GenericRelation("projects.Attachment") notifiable_fields = [ "milestone", diff --git a/greenmine/projects/wiki/models.py b/greenmine/projects/wiki/models.py index a3e2ed61..a9652a96 100644 --- a/greenmine/projects/wiki/models.py +++ b/greenmine/projects/wiki/models.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django.db import models +from django.contrib.contenttypes import generic from django.conf import settings from django.utils.translation import ugettext_lazy as _ @@ -21,6 +22,7 @@ class WikiPage(models.Model): verbose_name=_("created date")) modified_date = models.DateTimeField(auto_now=True, null=False, blank=False, verbose_name=_("modified date")) + attachments = generic.GenericRelation("projects.Attachment") class Meta: verbose_name = "wiki page"