Esempio n. 1
0
    def record(self, dbrow):
        """Transforms each raw table row into data model objects."""
        raw_vndr_name = (
            strip_plus4(dbrow["vendorlegalorganizationname"].strip() or dbrow["vendorname"].strip())
            .decode("utf8")
            .encode("utf8", "replace")
        )
        raw_duns = dbrow["dunsnumber"][:9].strip()
        raw_parent_duns = dbrow["parentdunsnumber"][:9].strip()

        if (
            len(raw_vndr_name) > 0
            and (len(raw_duns) > 0 or len(raw_parent_duns) > 0)
            and dbrow["fiscal_year"] is not None
        ):
            vndr_name = self._name(raw_vndr_name)
            duns = self._duns(raw_duns) if len(raw_duns) > 0 else None
            parent_duns = self._duns(raw_parent_duns) if len(raw_parent_duns) > 0 else None

            fpds = FPDS(data_commons_id=dbrow["id"])
            fpds.unique_transaction_id = dbrow["unique_transaction_id"]
            fpds.duns = duns
            fpds.duns_parent = parent_duns
            fpds.company_name = vndr_name
            fpds.fiscal_year = dbrow["fiscal_year"]
            fpds.piid = dbrow["piid"]
            fpds.psc = dbrow["productorservicecode"]
            fpds.psc_category = dbrow["psc_cat"]
            fpds.save()
Esempio n. 2
0
    def record(self, dbrow):
        """Transforms each raw table row into data model objects."""
        raw_vndr_name = strip_plus4(
            dbrow['vendorlegalorganizationname'].strip()
            or dbrow['vendorname'].strip()).decode('utf8').encode(
                'utf8', 'replace')
        raw_duns = dbrow['dunsnumber'][:9].strip()
        raw_parent_duns = dbrow['parentdunsnumber'][:9].strip()

        if len(raw_vndr_name) > 0 and (len(raw_duns) > 0
                                       or len(raw_parent_duns) > 0
                                       ) and dbrow['fiscal_year'] is not None:
            vndr_name = self._name(raw_vndr_name)
            duns = self._duns(raw_duns) if len(raw_duns) > 0 else None
            parent_duns = self._duns(
                raw_parent_duns) if len(raw_parent_duns) > 0 else None

            fpds = FPDS(data_commons_id=dbrow['id'])
            fpds.unique_transaction_id = dbrow['unique_transaction_id']
            fpds.duns = duns
            fpds.duns_parent = parent_duns
            fpds.company_name = vndr_name
            fpds.fiscal_year = dbrow['fiscal_year']
            fpds.piid = dbrow['piid']
            fpds.psc = dbrow['productorservicecode']
            fpds.psc_category = dbrow['psc_cat']
            fpds.save()
Esempio n. 3
0
    def record(self, dbrow):
        """Transforms each raw table row into data model objects."""
        raw_rcpt_name = strip_plus4(dbrow['recipient_name'].strip()).decode('utf8').encode('utf8', 'replace')
        raw_duns = dbrow['duns_no'][:9].strip()

        if raw_rcpt_name != '' and raw_duns != '':
            rcpt_name = self._name(raw_rcpt_name)
            duns = self._duns(raw_duns)

            faads = FAADS(data_commons_id=dbrow['id'])
            faads.unique_transaction_id = dbrow['unique_transaction_id']
            faads.duns = duns
            faads.recipient_name = rcpt_name
            faads.fiscal_year = dbrow['fiscal_year']
            faads.cfda_program_num = dbrow['cfda_program_num']
            faads.cfda_program_title = dbrow['cfda_program_title']
            faads.federal_award_id = dbrow['federal_award_id']
            faads.federal_award_mod = dbrow['federal_award_mod']
            faads.obligation_action_date = dbrow['obligation_action_date']
            faads.duns_conf_code = dbrow['duns_conf_code']
            faads.save()
Esempio n. 4
0
    def record(self, dbrow):
        """Transforms each raw table row into data model objects."""
        raw_rcpt_name = strip_plus4(
            dbrow['recipient_name'].strip()).decode('utf8').encode(
                'utf8', 'replace')
        raw_duns = dbrow['duns_no'][:9].strip()

        if raw_rcpt_name != '' and raw_duns != '':
            rcpt_name = self._name(raw_rcpt_name)
            duns = self._duns(raw_duns)

            faads = FAADS(data_commons_id=dbrow['id'])
            faads.unique_transaction_id = dbrow['unique_transaction_id']
            faads.duns = duns
            faads.recipient_name = rcpt_name
            faads.fiscal_year = dbrow['fiscal_year']
            faads.cfda_program_num = dbrow['cfda_program_num']
            faads.cfda_program_title = dbrow['cfda_program_title']
            faads.federal_award_id = dbrow['federal_award_id']
            faads.federal_award_mod = dbrow['federal_award_mod']
            faads.obligation_action_date = dbrow['obligation_action_date']
            faads.duns_conf_code = dbrow['duns_conf_code']
            faads.save()