Added a GenericRelation field to the attachments

remotes/origin/enhancement/email-actions
David Barragán Merino 2013-11-05 00:55:09 +01:00
parent 232c9487c6
commit 53ae1d3b1b
5 changed files with 10 additions and 0 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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"))

View File

@ -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",

View File

@ -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"