~registry/ubuntu-teamreports/trunk

« back to all changes in this revision

Viewing changes to teamreports/reports/management/commands/process-proposals.py

  • Committer: Daniel Holbach
  • Date: 2010-04-16 10:07:59 UTC
  • Revision ID: daniel.holbach@canonical.com-20100416100759-eqgm3ai408shfyzn
add proposal management form, use DateFields, add possibility to mark proposals for deletion

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
3
 
from django.core.management.base import NoArgsCommand
4
 
 
5
 
from reports import models
6
 
 
7
 
class Command(NoArgsCommand):
8
 
    help = "Deal with team proposals."
9
 
 
10
 
    def handle_noargs(self, **options):
11
 
        proposals = models.TeamProposal.objects.all()
12
 
        for proposal in proposals.filter(approved=True):
13
 
            p, created = models.Team.objects.get_or_create(lpid=proposal.team)
14
 
            if created:
15
 
                p.save()
16
 
            proposal.delete()