2012-02-20 11:07:23 +04:00
|
|
|
from django.db import models
|
|
|
|
|
2012-02-21 03:40:42 +04:00
|
|
|
import amo.models
|
2012-02-20 11:07:23 +04:00
|
|
|
import mkt
|
|
|
|
|
|
|
|
|
2012-02-21 03:40:42 +04:00
|
|
|
class AppSubmissionChecklist(amo.models.ModelBase):
|
2012-02-20 14:21:06 +04:00
|
|
|
addon = models.OneToOneField('addons.Addon')
|
2012-02-20 11:07:23 +04:00
|
|
|
terms = models.BooleanField()
|
|
|
|
manifest = models.BooleanField()
|
|
|
|
details = models.BooleanField()
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
db_table = 'submission_checklist_apps'
|
|
|
|
|
|
|
|
def get_completed(self):
|
|
|
|
"""Return a list of completed submission steps."""
|
|
|
|
completed = []
|
|
|
|
for step, label in mkt.APP_STEPS:
|
2012-02-20 14:21:06 +04:00
|
|
|
if getattr(self, step, False):
|
2012-02-20 11:07:23 +04:00
|
|
|
completed.append(step)
|
|
|
|
return completed
|
2012-02-22 03:55:57 +04:00
|
|
|
|
|
|
|
def get_next(self):
|
|
|
|
"""Return the next step."""
|
|
|
|
# Look through all the steps as defined in order and
|
|
|
|
# see for each of the steps if they are completed or not.
|
|
|
|
#
|
|
|
|
# We don't care about done, plus there's no column for it.
|
|
|
|
for step, label in mkt.APP_STEPS[:-1]:
|
|
|
|
if not getattr(self, step, False):
|
|
|
|
return step
|