def getdate(s): return asm.getdate_iso(s)
a = asm.Animal() animals.append(a) ppa[row["id"]] = a a.AnimalName = row["name"] if a.AnimalName.strip() == "": a.AnimalName = "(unknown)" a.ShortCode = row["code"] a.AnimalTypeID = asm.type_id_for_name(row["species"]) a.SpeciesID = asm.species_id_for_name(row["species"]) a.BreedID = asm.breed_id_for_name(row["primary breed"]) a.Breed2ID = asm.breed_id_for_name(row["secondary breed"]) a.CrossBreed = asm.iif(row["secondary breed"] != "", 1, 0) a.BreedName = asm.breed_name_for_id(a.BreedID) a.BaseColourID = asm.colour_id_for_name(row["primary color"]) a.Sex = asm.getsex_mf(row["sex"]) a.DateBroughtIn = asm.getdate_iso(row["time entered"]) a.DateOfBirth = asm.getdate_iso(row["birth date"]) if a.DateOfBirth is None: a.DateOfBirth = asm.getdate_iso(row["time entered"]) a.NeuteredDate = asm.getdate_iso(row["neutered/spayed date"]) if a.NeuteredDate is not None: a.Neutered = 1 a.Archived = 0 a.IdentichipNumber = row["microchip #"] if a.IdentichipNumber != "": a.Identichipped = 1 a.HiddenAnimalDetails = "Original Breed: %s/%s, Color: %s\n%s" % (row["primary breed"], row["secondary breed"], row["primary color"], row["hidden comments"]) a.AnimalComments = row["general comments"] a.Markings = row["distinctive features"] a.DeceasedDate = asm.getdate_iso(row["date of death"]) a.PTSReason = row["reason of death"] a.RabiesTag = row["tag #"] a.InTheShelter = row["in the shelter"]
a = asm.Animal() animals.append(a) ppa[row["id"]] = a a.AnimalName = row["name"] if a.AnimalName.strip() == "": a.AnimalName = "(unknown)" a.ShortCode = row["code"] a.AnimalTypeID = asm.type_id_for_name(row["species"]) a.SpeciesID = asm.species_id_for_name(row["species"]) a.BreedID = asm.breed_id_for_name(row["primary breed"]) a.Breed2ID = asm.breed_id_for_name(row["secondary breed"]) a.CrossBreed = asm.iif(row["secondary breed"] != "", 1, 0) a.BreedName = asm.breed_name_for_id(a.BreedID) a.BaseColourID = asm.colour_id_for_name(row["primary color"]) a.Sex = asm.getsex_mf(row["sex"]) a.DateBroughtIn = asm.getdate_iso(row["time entered"]) if a.DateBroughtIn is None: a.DateBroughtIn = asm.now() a.DateOfBirth = asm.getdate_iso(row["birth date"]) if a.DateOfBirth is None: a.DateOfBirth = asm.getdate_iso(row["time entered"]) if a.DateOfBirth is None: a.DateOfBirth = a.DateBroughtIn a.NeuteredDate = asm.getdate_iso(row["neutered/spayed date"]) if a.NeuteredDate is not None: a.Neutered = 1 a.Archived = 0 a.IdentichipNumber = row["microchip #"] if a.IdentichipNumber != "": a.Identichipped = 1 a.HiddenAnimalDetails = "Original Breed: %s/%s, Color: %s\n%s" % ( row["primary breed"], row["secondary breed"], row["primary color"], row["hidden comments"]) a.HiddenAnimalDetails = a.HiddenAnimalDetails.replace("\\", "/") a.AnimalComments = ("%s" % row["general comments"]).replace("\\", "/")
a = asm.Animal() a.Archived = 1 a.DateBroughtIn = datetime.datetime.today() - datetime.timedelta(days=365) animals[ca["animalID"]] = a if ca["animalType"] == "C": a.SpeciesID = 2 elif ca["animalType"] == "D": a.SpeciesID = 1 else: a.SpeciesID = 7 # X - assume rabbit/misc a.AnimalName = ca["nameIfKnown"] if a.AnimalName.strip() == "": a.AnimalName = "(unknown)" a.DateOfBirth = asm.getdate_yyyymmdd(ca["DOB"]) if a.DateOfBirth is None: a.DateOfBirth = asm.getdate_iso(ca["dateEntered"]) a.EstimatedDOB = ca["DOBisActual"] == "0" and 1 or 0 a.Sex = 1 if ca["sex"] == "F": a.Sex = 0 a.Neutered = 1 if ca["altered"] == "U": a.Neuteured = 0 # Find the breed if ca["animalType"] == "C": b = findin(cacat, "animalID", ca["animalID"], "felineBreedLUID") b = findin(clucat, "luid", b, "hoverText") if b != "": a.BreedID = asm.breed_id_for_name(b) a.BreedName = asm.breed_name_for_id(a.BreedID) elif ca["animalType"] == "D": b1 = findin(cadog, "animalID", ca["animalID"], "canineBreed1LUID") b2 = findin(cadog, "animalID", ca["animalID"], "canineBreed2LUID")
a = asm.Animal() animals.append(a) ppa[row["id"]] = a a.AnimalName = row["name"] if a.AnimalName.strip() == "": a.AnimalName = "(unknown)" a.ShortCode = row["code"] a.AnimalTypeID = asm.type_id_for_name(row["species"]) a.SpeciesID = asm.species_id_for_name(row["species"]) a.BreedID = asm.breed_id_for_name(row["primary breed"]) a.Breed2ID = asm.breed_id_for_name(row["secondary breed"]) a.CrossBreed = asm.iif(row["secondary breed"] != "", 1, 0) a.BreedName = asm.breed_name_for_id(a.BreedID) a.BaseColourID = asm.colour_id_for_name(row["primary color"]) a.Sex = asm.getsex_mf(row["sex"]) a.DateBroughtIn = asm.getdate_iso(row["time entered"]) a.DateOfBirth = asm.getdate_iso(row["birth date"]) if a.DateOfBirth is None: a.DateOfBirth = asm.getdate_iso(row["time entered"]) a.NeuteredDate = asm.getdate_iso(row["neutered/spayed date"]) if a.NeuteredDate is not None: a.Neutered = 1 a.Archived = 0 a.IdentichipNumber = row["microchip #"] if a.IdentichipNumber != "": a.Identichipped = 1 a.HiddenAnimalDetails = "Original Breed: %s/%s, Color: %s\n%s" % ( row["primary breed"], row["secondary breed"], row["primary color"], row["hidden comments"]) a.AnimalComments = row["general comments"] a.Markings = row["distinctive features"] a.DeceasedDate = asm.getdate_iso(row["date of death"]) a.PTSReason = row["reason of death"]