Finish versions model
This commit is contained in:
Родитель
f72d41dac9
Коммит
9881a6a1a7
|
@ -2,16 +2,15 @@ from django.db import models
|
||||||
|
|
||||||
import amo
|
import amo
|
||||||
from addons.models import Addon
|
from addons.models import Addon
|
||||||
|
from users.models import User
|
||||||
|
from applications.models import Application
|
||||||
from translations.fields import TranslatedField
|
from translations.fields import TranslatedField
|
||||||
|
|
||||||
|
|
||||||
class Version(amo.ModelBase):
|
class Version(amo.ModelBase):
|
||||||
|
|
||||||
addon = models.ForeignKey(Addon)
|
addon = models.ForeignKey(Addon)
|
||||||
license = models.ForeignKey('License')
|
license = models.ForeignKey('License')
|
||||||
|
|
||||||
releasenotes = TranslatedField()
|
releasenotes = TranslatedField()
|
||||||
|
|
||||||
approvalnotes = models.TextField()
|
approvalnotes = models.TextField()
|
||||||
version = models.CharField(max_length=255, default=0)
|
version = models.CharField(max_length=255, default=0)
|
||||||
|
|
||||||
|
@ -20,9 +19,31 @@ class Version(amo.ModelBase):
|
||||||
|
|
||||||
|
|
||||||
class License(amo.ModelBase):
|
class License(amo.ModelBase):
|
||||||
|
|
||||||
rating = models.SmallIntegerField(default=-1)
|
rating = models.SmallIntegerField(default=-1)
|
||||||
text = TranslatedField()
|
text = TranslatedField()
|
||||||
|
|
||||||
class Meta(amo.ModelBase.Meta):
|
class Meta(amo.ModelBase.Meta):
|
||||||
db_table = 'licenses'
|
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'
|
||||||
|
|
Загрузка…
Ссылка в новой задаче