summaryrefslogtreecommitdiffstats
path: root/apps/it/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/it/models.py')
-rw-r--r--apps/it/models.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/it/models.py b/apps/it/models.py
index a397b6d..d7922e4 100644
--- a/apps/it/models.py
+++ b/apps/it/models.py
@@ -12,9 +12,13 @@ class Attachment(models.Model):
content_object = generic.GenericForeignKey("content_type", "object_id")
@classmethod
- def get_content_type(self, model):
+ def get_content_type(cls, model):
return ContentType.objects.get(app_label='it', model=model)
+ @classmethod
+ def get_files(cls, model):
+ ct = ContentType.objects.get_for_model()
+ return cls.objects.filter(content_type=ct, object_id=model.pk)
class Issue(models.Model):
description = models.TextField()