This commit is contained in:
Wil Clouser 2010-01-13 16:01:23 -08:00
Родитель f72d41dac9
Коммит 9881a6a1a7
1 изменённых файлов: 25 добавлений и 4 удалений

Просмотреть файл

@ -2,16 +2,15 @@ from django.db import models
import amo
from addons.models import Addon
from users.models import User
from applications.models import Application
from translations.fields import TranslatedField
class Version(amo.ModelBase):
addon = models.ForeignKey(Addon)
license = models.ForeignKey('License')
releasenotes = TranslatedField()
approvalnotes = models.TextField()
version = models.CharField(max_length=255, default=0)
@ -20,9 +19,31 @@ class Version(amo.ModelBase):
class License(amo.ModelBase):
rating = models.SmallIntegerField(default=-1)
text = TranslatedField()
class Meta(amo.ModelBase.Meta):
db_table = 'licenses'
class VersionComment(amo.ModelBase):
"""Editor comments for version discussion threads."""
version = models.ForeignKey(Version)
user = models.ForeignKey(User)
reply_to = models.ForeignKey(Version, related_name="reply_to", null=True)
subject = models.CharField(max_length=1000)
comment = models.TextField()
class Meta(amo.ModelBase.Meta):
db_table = 'versioncomments'
class VersionSummary(amo.ModelBase):
addon = models.ForeignKey(Addon)
version = models.ForeignKey(Version)
application = models.ForeignKey(Application)
min = models.IntegerField(null=True)
max = models.IntegerField(null=True)
class Meta(amo.ModelBase.Meta):
db_table = 'versions_summary'