Skip to content
This repository has been archived by the owner on Apr 14, 2019. It is now read-only.

Commit

Permalink
Merge pull request #260 from caciviclab/fix_netfile_download
Browse files Browse the repository at this point in the history
Fix netfile download
  • Loading branch information
tdooner authored Aug 14, 2016
2 parents bc82ddd + 5fdb4b4 commit 0bd6608
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
3 changes: 2 additions & 1 deletion netfile_raw/management/commands/downloadnetfilerawdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def combine(self):
headers_written = headers
else:
# make sure things don't go all wierd between files.
assert headers == headers_written
assert headers == headers_written, \
'Headers in %s do not match the first written csv' % (csv_path,)

for line in agency_csv.readlines():
combined_csv.write(','.join([agency, line]))
Expand Down
38 changes: 38 additions & 0 deletions netfile_raw/migrations/0002_auto_20160814_2012.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('netfile_raw', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='netfilecal201transaction',
name='filerLocalId',
field=models.CharField(default='Unknown', max_length=32, db_column='filerLocalId'),
preserve_default=False,
),
migrations.AddField(
model_name='netfilecal201transaction',
name='filerStateId',
field=models.CharField(default='Unknown', max_length=32, db_column='filerStateId'),
preserve_default=False,
),
migrations.AddField(
model_name='netfilecal201transaction',
name='filingEndDate',
field=models.DateField(default='1970-01-01', db_column='filingEndDate'),
preserve_default=False,
),
migrations.AddField(
model_name='netfilecal201transaction',
name='filingStartDate',
field=models.DateField(default='1970-01-01', db_column='filingStartDate'),
preserve_default=False,
),
]
14 changes: 11 additions & 3 deletions netfile_raw/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ class NetFileCal201Transaction(CalAccessBaseModel):
"""
Netfile 201 data.
"""
agency_shortcut = models.CharField(
max_length=32,
db_column='agency_shortcut')
agency_shortcut = models.CharField(max_length=32, db_column='agency_shortcut')
filerId = models.CharField(
max_length=32,
db_column='filerId')
Expand Down Expand Up @@ -75,6 +73,8 @@ class NetFileCal201Transaction(CalAccessBaseModel):
tran_NamT = models.CharField(
max_length=256,
db_column='tran_NamT')
filingStartDate = models.DateField(
db_column='filingStartDate')
tran_Dscr = models.CharField(
max_length=256,
db_column='tran_Dscr')
Expand Down Expand Up @@ -150,6 +150,8 @@ class NetFileCal201Transaction(CalAccessBaseModel):
intr_NamF = models.CharField(
max_length=256,
db_column='intr_NamF')
filingEndDate = models.DateField(
db_column='filingEndDate')
transactionType = models.IntegerField(
null=True,
db_column='transactionType')
Expand Down Expand Up @@ -255,6 +257,9 @@ class NetFileCal201Transaction(CalAccessBaseModel):
int_CmteId = models.CharField(
max_length=32,
db_column='int_CmteId')
filerLocalId = models.CharField(
max_length=32,
db_column='filerLocalId')
calculated_Date = models.DateField(
null=True,
db_column='calculated_Date')
Expand Down Expand Up @@ -288,6 +293,9 @@ class NetFileCal201Transaction(CalAccessBaseModel):
entity_Cd = models.CharField(
max_length=3,
db_column='entity_Cd')
filerStateId = models.CharField(
db_column='filerStateId',
max_length=32)
tres_Adr1 = models.CharField(
max_length=256,
db_column='tres_Adr1')
Expand Down

0 comments on commit 0bd6608

Please sign in to comment.