update_memopol_representatives.py 385 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
        for representative in MemopolRepresentative.objects.all():
Arnaud Fabre's avatar
Arnaud Fabre committed
13
            representative.update_all()