Ejemplo n.º 1
0
    def save(self, force_insert=False, force_update=False, using=None,
             update_fields=None):
        self.address = self.address.strip()
        self.description = self.description.strip()
        self.location = self.location.strip()

        if self.address and not self.anon_address:
            # Let's anonymize this address
            address = StreetAddressParser().parse(self.address)

            if address.get('block') and int(address.get('block')) > 0:
                self.anon_address = u'%s block of %s' % (address.get('block'), address.get('street_full'))
            else:
                self.anon_address = self.address

        return super(CincinnatiPolice, self).save(force_insert, force_update, using, update_fields)
Ejemplo n.º 2
0
    def save(self, force_insert=False, force_update=False, using=None,
             update_fields=None):
        self.location = self.location.strip()
        self.address = self.address.strip()

        if self.location and not self.anon_location:
            address = StreetAddressParser().parse(self.location)

            if address.get('block') and int(address.get('block')) > 0:
                self.anon_location = u'%s block of %s' % (address.get('block'), address.get('street_full'))
            else:
                self.anon_location = self.location

        if self.address and not self.anon_address:
            address = StreetAddressParser().parse(self.address)

            if address.get('block') and int(address.get('block')) > 0:
                self.anon_address = u'%s block of %s' % (address.get('block'), address.get('street_full'))
            else:
                self.anon_address = self.address

        return super(GenericData, self).save(force_insert, force_update, using, update_fields=update_fields)
Ejemplo n.º 3
0
    def save(self, force_insert=False, force_update=False, using=None,
             update_fields=None):
        self.arrest_address = self.arrest_address.strip()
        self.home_address = self.home_address.strip()

        if self.arrest_address and not self.anon_arrest_address:
            address = StreetAddressParser().parse(self.arrest_address)

            if address.get('block') and int(address.get('block')) > 0:
                self.anon_arrest_address = u'%s block of %s' % (address.get('block'), address.get('street_full'))
            else:
                self.anon_arrest_address = self.arrest_address

        if self.home_address and not self.anon_home_address:
            address = StreetAddressParser().parse(self.home_address)

            if address.get('block') and int(address.get('block')) > 0:
                self.anon_home_address = u'%s block of %s' % (address.get('block'), address.get('street_full'))
            else:
                self.anon_home_address = self.home_address

        return super(Arrest, self).save(force_insert, force_update, using, update_fields=update_fields)