diff options
author | Filipp Lepalaan <f@230.to> | 2014-02-17 14:59:14 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2014-02-17 14:59:14 +0200 |
commit | d3e089b71b64cfc1f9f96be141f41806ce5b9e77 (patch) | |
tree | f476fec3f91b0f29526457b02a34f443a593bb99 /apps/it/models.py | |
parent | b494dfc0933c28729eaf8bc2105bbeb28d24ceae (diff) | |
download | pudding-d3e089b71b64cfc1f9f96be141f41806ce5b9e77.tar.gz pudding-d3e089b71b64cfc1f9f96be141f41806ce5b9e77.tar.bz2 pudding-d3e089b71b64cfc1f9f96be141f41806ce5b9e77.zip |
Switching WS
Diffstat (limited to 'apps/it/models.py')
-rw-r--r-- | apps/it/models.py | 6 |
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() |