Created
August 7, 2012 18:32
-
-
Save selenamarie/3288123 to your computer and use it in GitHub Desktop.
Accepted proposals chunk of code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand | |
from django.db import connections | |
from review.models import ProposalResult, promote_proposal | |
class Command(BaseCommand): | |
def handle(self, *args, **options): | |
accepted_proposals = ProposalResult.objects.filter(accepted=True) | |
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))") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment