Exemplo n.º 1
0
        a.AnimalName = "(unknown)"
    a.DateBroughtIn = getdate(d["Date In"]) or asm.today()
    if d["DOB"].strip() != "":
        a.DateOfBirth = getdate(d["DOB"])
    if a.DateOfBirth is None:
        a.DateOfBirth = asm.subtract_days(a.DateBroughtIn, 365)
    a.CreatedDate = a.DateBroughtIn
    a.LastChangedDate = a.DateBroughtIn
    a.ShortCode = d["File"]
    a.ShelterCode = str(a.ID) + " " + d["File"]
    a.BreedID = asm.breed_id_for_name(d["Breed"].replace(" mix", ""))
    a.BreedName = asm.breed_name_for_id(a.BreedID)
    if d["Breed"].find("mix") != -1:
        a.CrossBreed = 1
        a.Breed2ID = 442
        a.BreedName = asm.breed_name(a.BreedID, a.Breed2ID)
    a.BaseColourID = asm.colour_id_for_name(d["Color"])

    a.Sex = asm.getsex_mf(d["Male Female"])
    a.Weight = asm.cint(d["Weight"].replace("lbs", "").strip())

    if a.Weight > 0:
        l = asm.Log()
        logs.append(l)
        l.LogTypeID = 4  # Weight
        l.LinkID = a.ID
        l.LinkType = 0
        l.Date = a.DateBroughtIn
        l.Comments = d["Weight"]

    a.NeuteredDate = getdate(d["Spay Neuter Date"])
Exemplo n.º 2
0
     a.AnimalTypeID = 12
 else:
     # Other species
     a.SpeciesID = asm.species_id_for_name(d["SPECIES"])
     a.AnimalTypeID = asm.type_id_for_name(d["SPECIES"])
 a.generateCode()
 a.ShortCode = d["ANIMALNO"]
 a.Sex = asm.getsex_mf(d["SEX"])
 a.BreedID = asm.breed_id_for_name(d["BREED1"])
 if d["BREED2"] == "Unspecified":
     a.Breed2ID = a.BreedID
     a.CrossBreed = 0
 else:
     a.CrossBreed = 1
     a.Breed2ID = asm.breed_id_for_name(d["BREED2"])
 a.BreedName = asm.breed_name(a.BreedID, a.Breed2ID)
 if d["BREED2"].find("Mix") != -1:
     a.CrossBreed = 1
     a.Breed2ID = 442
     a.BreedName = asm.breed_name_for_id(a.BreedID) + " / " + asm.breed_name_for_id(a.Breed2ID)
 a.BaseColourID = asm.colour_id_for_name(d["COLOR1"])
 a.DateBroughtIn = d["FOUNDDATE"]
 if a.DateBroughtIn is None: a.DateBroughtIn = asm.now()
 a.Neutered = asm.iif(d["ALTERED"] == "Yes", 1, 0)
 a.DateOfBirth = d["BIRTHDATE"]
 if a.DateOfBirth is None:
     a.EstimatedDOB = 1
     a.DateOfBirth = asm.subtract_days(a.DateBroughtIn, 365)
 a.PickupAddress = d["CITY"]
 a.AnimalComments = d["NOTES"]
 a.Markings = d["MARKINGS"]