symposion_app/symposion/reviews/management/commands/promoteproposals.py

16 lines
608 B
Python
Raw Normal View History

2012-08-14 07:54:45 +00:00
from django.core.management.base import BaseCommand
from django.db import connections
from symposion.reviews.models import ProposalResult, promote_proposal
class Command(BaseCommand):
def handle(self, *args, **options):
accepted_proposals = ProposalResult.objects.filter(status="accepted")
2012-08-14 07:54:45 +00:00
accepted_proposals = accepted_proposals.order_by("proposal")
for result in accepted_proposals:
promote_proposal(result.proposal)
connections["default"].cursor().execute("SELECT setval('schedule_session_id_seq', (SELECT max(id) FROM schedule_session))")