diff options
Diffstat (limited to 'djangopypi/models.py')
-rw-r--r-- | djangopypi/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/djangopypi/models.py b/djangopypi/models.py index d66f5c8..d7c5fc7 100644 --- a/djangopypi/models.py +++ b/djangopypi/models.py | |||
@@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. | |||
32 | 32 | ||
33 | import os | 33 | import os |
34 | from django.db import models | 34 | from django.db import models |
35 | from django.contrib.auth.models import User | ||
35 | from django.utils.translation import ugettext_lazy as _ | 36 | from django.utils.translation import ugettext_lazy as _ |
36 | 37 | ||
37 | OS_NAMES = ( | 38 | OS_NAMES = ( |
@@ -85,6 +86,7 @@ class Project(models.Model): | |||
85 | description = models.TextField(blank=True) | 86 | description = models.TextField(blank=True) |
86 | author_email = models.CharField(max_length=255, blank=True) | 87 | author_email = models.CharField(max_length=255, blank=True) |
87 | classifiers = models.ManyToManyField(Classifier) | 88 | classifiers = models.ManyToManyField(Classifier) |
89 | owner = models.ForeignKey(User, related_name="projects") | ||
88 | 90 | ||
89 | class Meta: | 91 | class Meta: |
90 | verbose_name = _(u"project") | 92 | verbose_name = _(u"project") |
@@ -108,7 +110,8 @@ class Release(models.Model): | |||
108 | verbose_name_plural = _(u"releases") | 110 | verbose_name_plural = _(u"releases") |
109 | 111 | ||
110 | def __unicode__(self): | 112 | def __unicode__(self): |
111 | return self.version | 113 | return u"%s %s (%s)" % ( |
114 | self.project.name, self.version, self.distribution.name) | ||
112 | 115 | ||
113 | @property | 116 | @property |
114 | def filename(self): | 117 | def filename(self): |