# Path: montanha/models.py
# class Mandate(models.Model):
# 
#     class Meta:
#         verbose_name = _("Mandate")
#         verbose_name_plural = _("Mandates")
# 
#     original_id = models.TextField(null=True, blank=True)
# 
#     legislator = models.ForeignKey("Legislator")
# 
#     legislature = models.ForeignKey("Legislature")
# 
#     date_start = models.DateField(verbose_name=_("Date started"),
#                                   help_text=_("""Date in which this mandate started; may also be """
#                                               """a resumption of a mandate that was paused for taking """
#                                               """an executive-branch office, or a party change."""),
#                                   db_index=True)
# 
#     date_end = models.DateField(blank=True, null=True,
#                                 verbose_name=_("Date ended"),
#                                 help_text=_("""Date in which this mandate ended, paused for taking an """
#                                             """executive-branch office, or affiliation change."""),
#                                 db_index=True)
# 
#     party = models.ForeignKey("PoliticalParty",
#                               verbose_name=_("Party"),
#                               help_text=_("""Party the legislator was affiliated to during this """
#                                           """mandate."""),
#                               blank=True,
#                               null=True)
# 
#     state = models.CharField(blank=True, null=True,
#                              max_length=512,
#                              verbose_name=_("State"),
#                              help_text=_("""The state where the legislator comes from."""))
# 
#     def __unicode__(self):
#         if self.date_end:
#             return u"%s's ongoing mandate started on %s, affiliated with %s" % (self.legislator.name,
#                                                                                 str(self.date_start),
#                                                                                 self.party)
# 
#         return u"%s's mandate started on %s ended on %s, affiliated with %s" % (self.legislator.name,
#                                                                                 str(self.date_start),
#                                                                                 str(self.date_end),
#                                                                                 self.party)


from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db import connection, transaction
from montanha.models import Mandate
            from collectors.almg import ALMG
            from collectors.algo import ALGO
            from collectors.alepe import ALEPE
            from collectors.senado import Senado
            from collectors.cmbh import CMBH
            from collectors.cmsp import CMSP
            from collectors.cdep import CamaraDosDeputados
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Affero General Public License as
#  published by the Free Software Foundation, either version 3 of the
#  License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU Affero General Public License for more details.
#
#  You should have received a copy of the GNU Affero General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.




# This hack makes django less memory hungry (it caches queries when running
# with debug enabled.
settings.DEBUG = False

debug_enabled = False


class Command(BaseCommand):
    help = "Collects data for a number of sources"
    collection_runs = []

    def add_arguments(self, parser):
        parser.add_argument('house', type=str, nargs='+')

# Path: montanha/models.py
# class Mandate(models.Model):
# 
#     class Meta:
#         verbose_name = _("Mandate")
#         verbose_name_plural = _("Mandates")
# 
#     original_id = models.TextField(null=True, blank=True)
# 
#     legislator = models.ForeignKey("Legislator")
# 
#     legislature = models.ForeignKey("Legislature")
# 
#     date_start = models.DateField(verbose_name=_("Date started"),
#                                   help_text=_("""Date in which this mandate started; may also be """
#                                               """a resumption of a mandate that was paused for taking """
#                                               """an executive-branch office, or a party change."""),
#                                   db_index=True)
# 
#     date_end = models.DateField(blank=True, null=True,
#                                 verbose_name=_("Date ended"),
#                                 help_text=_("""Date in which this mandate ended, paused for taking an """
#                                             """executive-branch office, or affiliation change."""),
#                                 db_index=True)
# 
#     party = models.ForeignKey("PoliticalParty",
#                               verbose_name=_("Party"),
#                               help_text=_("""Party the legislator was affiliated to during this """
#                                           """mandate."""),
#                               blank=True,
#                               null=True)
# 
#     state = models.CharField(blank=True, null=True,
#                              max_length=512,
#                              verbose_name=_("State"),
#                              help_text=_("""The state where the legislator comes from."""))
# 
#     def __unicode__(self):
#         if self.date_end:
#             return u"%s's ongoing mandate started on %s, affiliated with %s" % (self.legislator.name,
#                                                                                 str(self.date_start),
#                                                                                 self.party)
# 
#         return u"%s's mandate started on %s ended on %s, affiliated with %s" % (self.legislator.name,
#                                                                                 str(self.date_start),
#                                                                                 str(self.date_end),
#                                                                                 self.party)


# Path: montanha/management/commands/collect.py
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db import connection, transaction
from montanha.models import Mandate
            from collectors.almg import ALMG
            from collectors.algo import ALGO
            from collectors.alepe import ALEPE
            from collectors.senado import Senado
            from collectors.cmbh import CMBH
            from collectors.cmsp import CMSP
            from collectors.cdep import CamaraDosDeputados

#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Affero General Public License as
#  published by the Free Software Foundation, either version 3 of the
#  License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU Affero General Public License for more details.
#
#  You should have received a copy of the GNU Affero General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.




# This hack makes django less memory hungry (it caches queries when running
# with debug enabled.
settings.DEBUG = False

debug_enabled = False


class Command(BaseCommand):
    help = "Collects data for a number of sources"
    collection_runs = []

    def add_arguments(self, parser):
        parser.add_argument('house', type=str, nargs='+')

        parser.add_argument(