update_memopol_representatives.py 387 Bytes
Newer Older
Arnaud Fabre's avatar
Arnaud Fabre committed
1
from __future__ import absolute_import
luxcem's avatar
luxcem committed
2
3

from django.db import transaction
Arnaud Fabre's avatar
Arnaud Fabre committed
4
from django.core.management.base import BaseCommand
luxcem's avatar
luxcem committed
5

6
from legislature.models import MemopolRepresentative
Arnaud Fabre's avatar
Arnaud Fabre committed
7
8
9

class Command(BaseCommand):
    
luxcem's avatar
luxcem committed
10
11
    @transaction.atomic
    def handle(self, *args, **options):
12
13
        for representative in MemopolRepresentative.objects.all():
            representative.update_score()