Skip to content

Commit

Permalink
blindly commit working version, this may need tweaks <holds breath>
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfenfen committed Dec 4, 2018
1 parent b065e50 commit 2b7dabd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def write_sked(self, schedule):

variables_in_this_part = Variable.objects.filter(
parent_sked_part=form_part.parent_sked_part,
versions__contains=CANONICAL_VERSION,
version_end='',
).exclude(in_a_group=True).order_by('ordering',)
if variables_in_this_part:
# only write it if it contains anything
Expand All @@ -132,7 +132,7 @@ def write_sked(self, schedule):

groups_in_this_sked = Group.objects.filter(
parent_sked=schedule,
versions__contains=CANONICAL_VERSION,
version_end='',
).order_by('ordering',)

for group in groups_in_this_sked:
Expand All @@ -148,7 +148,7 @@ def write_sked(self, schedule):

variables_in_this_group = Variable.objects.filter(
db_table=group.db_name,
versions__contains=CANONICAL_VERSION,
version_end='',
).order_by('ordering',)

if variables_in_this_group:
Expand Down
10 changes: 5 additions & 5 deletions irsdb/metadata/management/commands/load_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def reload_variables(self, *args, **options):
if i%REPORT_COUNT == 0:
print("Created %s rows" % i)

if CANONICAL_VERSION in row['versions']:
row['is_canonical'] = True
row['canonical_version'] = CANONICAL_VERSION
else:
row['is_canonical'] = False
#if CANONICAL_VERSION in row['versions']:
# row['is_canonical'] = True
# row['canonical_version'] = CANONICAL_VERSION
#else:
# row['is_canonical'] = False
Variable.objects.create(**row)
print("Total Variables %s" % i)

Expand Down
12 changes: 8 additions & 4 deletions irsdb/metadata/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class Variable(IRSxBase):
db_type = models.CharField(max_length=63, blank=True, null=True, help_text="db type", editable=False)
line_number = models.CharField(max_length=255, blank=True, null=True, help_text="IRS line number. Missing in returnheader", editable=False)
description = models.TextField(help_text="IRS-supplied description, from .xsd. ")
versions = models.TextField(help_text="semicolon-delimited ")
version_start = models.TextField(help_text="Start year", null=True)
version_end = models.TextField(help_text="End year", null=True)
is_canonical = models.NullBooleanField(help_text="", default=False)
canonical_version = models.CharField(max_length=16, blank=True, null=True, help_text="canonical_version", editable=False)

Expand All @@ -30,7 +31,8 @@ class Group(IRSxBase):
line_number = models.CharField(max_length=255, blank=True, null=True, help_text="IRS-supplied line numbers. Missing for returnheaders", editable=False)
description = models.TextField(help_text="IRS-supplied description, from .xsd. ")
headless = models.NullBooleanField(help_text="", default=False)
versions = models.TextField(help_text="IRS-supplied description, from .xsd. ")
version_start = models.TextField(help_text="Start year", null=True)
version_end = models.TextField(help_text="End year", null=True)

def get_absolute_url(self):
return ("/metadata/groups/%s.html" % self.db_name)
Expand All @@ -48,10 +50,12 @@ def get_absolute_url(self):

class LineNumber(models.Model):
xpath = models.CharField(max_length=255, blank=True, null=True, help_text="xpath", editable=False) #is this not equivalent to xpath?
versions = models.TextField(help_text="versions")
version_start = models.TextField(help_text="Start year", null=True)
version_end = models.TextField(help_text="End year", null=True)
line_number = models.CharField(max_length=255, blank=True, null=True, help_text="IRS-supplied line numbers. Missing for returnheaders", editable=False)

class Description(models.Model):
xpath = models.CharField(max_length=255, blank=True, null=True, help_text="xpath", editable=False) #is this not equivalent to xpath?
versions = models.TextField(help_text="versions")
version_start = models.TextField(help_text="Start year", null=True)
version_end = models.TextField(help_text="End year", null=True)
description = models.TextField(help_text="description")
2 changes: 1 addition & 1 deletion irsdb/return/management/commands/load_filings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def process_sked(self, sked):


def run_filing(self, filing):

object_id = filing.object_id
print("run_filing %s" % object_id)

parsed_filing = self.xml_runner.run_filing(object_id)
if not parsed_filing:
Expand Down

0 comments on commit 2b7dabd

Please sign in to comment.