コード例 #1
0
        c += "\nAdditional: %s" % d["Additional Information"]
        c += "\n%s" % d["Comments"]
        ac.CallNotes = c

# Extract color info from location history
if LOCATION_FILENAME != "" and asm.file_exists(LOCATION_FILENAME):
    idfield = "textbox15"
    colfield = "textbox59"
    for d in asm.csv_to_list(LOCATION_FILENAME):
        if idfield not in d:
            continue  # Can't do anything without field present
        if d[idfield] == idfield: continue  # Ignore repeated headers
        if ppa.has_key(d[idfield]):
            name1, name2 = d[colfield].split("/", 1)
            a = ppa[d[idfield]]
            a.BaseColourID = asm.colour_id_for_names(name1, name2)
            if a.HiddenAnimalDetails.find("color:") == -1:
                a.HiddenAnimalDetails += ", color: " + d[colfield]


def process_vacc(animalno, vaccdate=None, vaccexpires=None, vaccname=""):
    """ Processes a vaccination record. PP have multiple formats of this data file """
    if ppa.has_key(animalno):
        a = ppa[animalno]
    else:
        asm.stderr("cannot process vacc %s, %s, %s, - no matching animal" %
                   (animalno, vaccdate, vaccname))
        return
    av = asm.AnimalVaccination()
    animalvaccinations.append(av)
    if vaccdate is None:
コード例 #2
0
ファイル: petstablished.py プロジェクト: bobintetley/asm3
        a.ShortCode = d["Petstablished ID"]

        a.IsNotAvailableForAdoption = 0
        a.Sex = asm.getsex_mf(d["Gender"])
        a.Size = asm.size_from_db(d["Size"])
        a.Weight = asm.atof(d["Weight"])
        breeds = d["Pet Breed"].split(",")
        breed1 = breeds[0]
        breed2 = ""
        if len(breeds) > 1: breed2 = breeds[1]
        asm.breed_ids(a, breed1, breed2)
        colors = d["Color"].split(",")
        color1 = colors[0]
        color2 = ""
        if len(colors) > 1: color2 = colors[1]
        a.BaseColourID = asm.colour_id_for_names(color1, color2)

        a.Neutered = d["Spayed/Neutered?"].lower() == "yes" and 1 or 0
        a.HasSpecialNeeds = d["Special Need?"].lower() == "yes" and 1 or 0
        a.IsGoodWithDogs = psYesNoUnknown(d["Gets along with Dogs?"])
        a.IsGoodWithCats = psYesNoUnknown(d["Gets along with Cats?"])
        a.IsGoodWithChildren = psYesNoUnknown(d["Gets along with Kids?"])
        a.HouseTrained = 0

        a.EntryReasonID = 17 # Surrender
        if d["Type of Intake"] == "Stray At Large": a.EntryReasonID = 7 # Stray
        if d["Type of Intake"] == "Transferred In": a.EntryReasonID = 15 # Transfer from other shelter
        if d["Type of Intake"] == "Relinquished By Owner": a.EntryReasonID = 17 # Surrender
    
        a.AnimalComments = d["Internal Notes"].replace("<p>", "").replace("</p>", "")
        a.HiddenAnimalDetails = d["Additional Comments"]
コード例 #3
0
     added = row["ADDEDDATET"]
 if "DOB" in row: a.DateOfBirth = row["DOB"]
 if a.DateOfBirth is None: a.DateOfBirth = getdateage(age, added)
 a.DateBroughtIn = added
 a.LastChangedDate = a.DateBroughtIn
 a.CreatedDate = a.DateBroughtIn
 a.EntryReasonID = 4
 a.generateCode(gettypeletter(a.AnimalTypeID))
 a.ShortCode = row["ANIMALKEY"]
 a.Neutered = asm.cint(row["FIX"])
 a.Declawed = asm.cint(row["DECLAWED"])
 a.IsNotAvailableForAdoption = 0
 a.ShelterLocation = 1
 a.Sex = asm.getsex_mf(asm.strip(row["GENDER"]))
 a.Size = getsize(asm.strip(row["WEIGHT"]))
 a.BaseColourID = asm.colour_id_for_names(asm.strip(row["FURCOLR1"]),
                                          asm.strip(row["FURCOLR2"]))
 a.IdentichipNumber = asm.strip(row["MICROCHIP"])
 comments = "Original breed: " + asm.strip(row["BREED1"]) + "/" + asm.strip(
     row["CROSSBREED"]) + ", age: " + age
 comments += ",Color: " + asm.strip(row["FURCOLR1"]) + "/" + asm.strip(
     row["FURCOLR2"])
 comments += ", Coat: " + asm.strip(row["COAT"])
 comments += ", Collar: " + asm.strip(row["COLLRTYP"])
 a.BreedID = asm.breed_id_for_name(asm.strip(row["BREED1"]))
 a.Breed2ID = a.BreedID
 a.BreedName = asm.breed_name_for_id(a.BreedID)
 if row["PUREBRED"] == "0":
     a.Breed2ID = asm.breed_id_for_name(asm.strip(row["CROSSBREED"]))
     if a.Breed2ID == 1: a.Breed2ID = 442
     a.BreedName = "%s / %s" % (asm.breed_name_for_id(
         a.BreedID), asm.breed_name_for_id(a.Breed2ID))
コード例 #4
0
ファイル: shelterpro_licencedisp.py プロジェクト: magul/asm3
     a.ShortCode = row["REGISTRATI"]
 a.SpeciesID = asm.species_id_for_name(row["ANIMLDES"].split(" ")[0])
 a.AnimalName = row["PETNAME"]
 if a.AnimalName.strip() == "":
     a.AnimalName = "(unknown)"
 age = row["AGE"].split(" ")[0]
 a.DateOfBirth = asm.getdate_yyyymmdd(row["DOB"])
 if a.DateOfBirth is None: a.DateOfBirth = asm.now()
 a.EntryReasonID = 4
 a.Neutered = asm.cint(row["FIX"])
 a.Declawed = asm.cint(row["DECLAWED"])
 a.IsNotAvailableForAdoption = 0
 a.ShelterLocation = 1
 a.Sex = asm.getsex_mf(asm.fw(row["GENDER"]))
 a.Size = getsize(asm.fw(row["WEIGHT"]))
 a.BaseColourID = asm.colour_id_for_names(asm.fw(row["FURCOLR1"]), asm.fw(row["FURCOLR2"]))
 a.IdentichipNumber = row["MICROCHIP"]
 if a.IdentichipNumber != "": a.Identichipped = 1
 if len(a.IdentichipNumber) == 8: a.IdentichipNumber = "0" + a.IdentichipNumber
 comments = "Original breed: " + row["BREED1"] + "/" + row["CROSSBREED"] + ", age: " + age
 comments += ",Color: " + asm.fw(row["FURCOLR1"]) + "/" + asm.fw(row["FURCOLR2"])
 comments += ", Coat: " + row["COAT"]
 comments += ", Collar: " + row["COLLRTYP"]
 comments += ", Disposition: " + row["LICENSE"]
 a.BreedID = asm.breed_id_for_name(row["BREED1"])
 a.Breed2ID = a.BreedID
 a.BreedName = asm.breed_name_for_id(a.BreedID)
 if row["PUREBRED"] == "0":
     a.Breed2ID = asm.breed_id_for_name(row["CROSSBREED"])
     if a.Breed2ID == 1: a.Breed2ID = 442
     a.BreedName = "%s / %s" % ( asm.breed_name_for_id(a.BreedID), asm.breed_name_for_id(a.Breed2ID) )
コード例 #5
0
ファイル: multiops.py プロジェクト: Reeco2014/asm3
 a.Weight = asm.atoi(row["Weight"])
 a.IsNotAvailableForAdoption = 0
 location = asm.find_value(cshelterareas, "sysShelterAreasID",
                           row["sysShelterAreasID"], "ShelterArea")
 pen = asm.find_value(cpens, "sysPensID", row["sysPensID"], "Pen")
 a.ShelterLocation = asm.location_from_db(location, 1)
 a.ShelterLocationUnit = pen
 a.Sex = asm.getsex_mf(
     asm.find_value(cgenders, "sysGenderChoicesID",
                    row["sysGenderChoicesID"], "GenderChoice"))
 a.Size = 2
 color1 = asm.find_value(ccolors, "sysCoatColorsID", row["ColorPrimaryID"],
                         "Description")
 color2 = asm.find_value(ccolors, "sysCoatColorsID",
                         row["ColorSecondaryID"], "Description")
 a.BaseColourID = asm.colour_id_for_names(asm.fw(color1), asm.fw(color2))
 #a.IdentichipNumber = row["MICROCHIP"]
 breed1 = asm.find_value(cbreeds, "sysBreedsID", row["sysBreedPrimaryID"],
                         "Breed")
 breed2 = asm.find_value(cbreeds, "sysBreedsID", row["sysBreedSecondaryID"],
                         "Breed")
 a.BreedID = asm.breed_id_for_name(breed1)
 a.Breed2ID = asm.breed_id_for_name(breed2)
 # Not sure if this was customer specific with the (Mix) (Purebred) -
 # needs checking on future conversions.
 # It wasn't customer specific - present in last multiops we saw.
 if breed2 == "(Mix)":
     a.Breed2ID = 442
     a.CrossBreed = 1
     a.BreedName = asm.breed_name(a.BreedID, a.Breed2ID)
 if breed2 == "(Purebred)":
コード例 #6
0
 typecol = row["Type"]
 breedcol = row["Breed"]
 breed2col = row["Secondary Breed"]
 a.AnimalTypeID = asm.type_id_for_name(typecol)
 a.generateCode(asm.type_name_for_id(a.AnimalTypeID))
 a.SpeciesID = asm.species_id_for_name(typecol)
 asm.breed_ids(a, breedcol, breed2col)
 a.DateBroughtIn = getdate(row["Incoming Date"])
 a.DateOfBirth = getdate(row["DOB"])
 if a.DateOfBirth is None: a.DateOfBirth = a.DateBroughtIn
 a.Neutered = row["Spay/Neutered"].strip().lower() == "yes" and 1 or 0
 a.NeuteredDate = getdate(row["Spay/Neutered Date"])
 a.IdentichipNumber = row["Microchip"]
 if a.IdentichipNumber != "": a.Identichipped = 1
 a.Sex = asm.getsex_mf(row["Gender"])
 a.BaseColourID = asm.colour_id_for_names(row["Color"], row["Second Color"])
 a.ReasonForEntry = row["Surrender Reason"]
 a.EntryReasonID = 11
 if row["Source (Current)"] == "Stray":
     a.EntryReasonID = 7
 comments = "Original Type: " + typecol
 comments += "\nOriginal Breed: " + breedcol + "/" + breed2col
 comments += "\nOriginal Colour: " + row["Color"] + "/" + row["Second Color"]
 comments += "\nSource: " + row["Source (Current)"]
 comments += "\nStatus: " + row["Status (Current)"]
 a.HiddenAnimalDetails = comments
 a.Markings = row["Distinguishing Features"]
 a.PTSReason = row["Euthanasia Reason"]
 a.AnimalComments = row["General Notes from animal details screen"]
 a.CreatedDate = a.DateBroughtIn
 a.LastChangedDate = a.DateBroughtIn
コード例 #7
0
ファイル: org_sb1875.py プロジェクト: Reeco2014/asm3
    a.AnimalName = d["Name"]
    if a.AnimalName.strip() == "":
        a.AnimalName = "(unknown)"
    a.DateBroughtIn = getdate(d["Date_Admitted"]) or asm.today()
    if d["Date_Of_Birth"].strip() != "":
        a.DateOfBirth = getdate(d["Date_Of_Birth"])
    if a.DateOfBirth is None:
        a.DateOfBirth = asm.subtract_days(a.DateBroughtIn, 365)
    a.CreatedDate = a.DateBroughtIn
    a.LastChangedDate = a.DateBroughtIn
    asm.additional_field("Legacy_Tag_No", 0, a.ID, d["Tag_no"])
    asm.additional_field("Legacy_Tag_No_Q", 0, a.ID, d["Tag_no_qualifier"])
    a.ShortCode = "%s:%s" % (d["Tag_no"], d["Tag_no_qualifier"])
    a.ShelterCode = a.ShortCode
    asm.breed_ids(a, d["Breed"], d["Cross_Breed"])
    a.BaseColourID = asm.colour_id_for_names(d["Base_Colour"],
                                             d["Secondary_Colour"])
    a.AnimalComments = d["Notes"]
    a.Sex = asm.getsex_mf(d["Sex"])
    a.Size = asm.size_id_for_name(d["Size"])
    a.NeuteredDate = getdate(d["Date_Desexed"])
    if a.NeuteredDate is not None: a.Neutered = 1
    a.IdentichipNumber = d["Microchip_no"]
    a.Identichip2Number = d["Alternate_Chip_No"]
    if a.IdentichipNumber != "": a.Identichipped = 1
    a.IdentichipDate = asm.getdate_ddmmyyyy(d["Date_Microchipped"])
    a.IsGoodWithCats = 2
    a.IsGoodWithDogs = 2
    a.IsGoodWithChildren = 2
    a.HouseTrained = 0
    a.AcceptanceNumber = d["Litter No"]
コード例 #8
0
ファイル: multiops.py プロジェクト: magul/asm3
 if row["sysAlteredChoicesID"] == "1" or row["sysAlteredChoicesID"] == "2":
     a.Neutered = 1
 a.Markings = row["DistinguishingMarks"]
 a.HealthProblems = row["Condition"]
 a.AnimalComments = row["Description"]
 a.Weight = asm.atoi(row["Weight"])
 a.IsNotAvailableForAdoption = 0
 location = asm.find_value(cshelterareas, "sysShelterAreasID", row["sysShelterAreasID"], "ShelterArea")
 pen = asm.find_value(cpens, "sysPensID", row["sysPensID"], "Pen")
 a.ShelterLocation = asm.location_from_db(location, 1)
 a.ShelterLocationUnit = pen
 a.Sex = asm.getsex_mf(asm.find_value(cgenders, "sysGenderChoicesID", row["sysGenderChoicesID"], "GenderChoice"))
 a.Size = 2
 color1 = asm.find_value(ccolors, "sysCoatColorsID", row["ColorPrimaryID"], "Description")
 color2 = asm.find_value(ccolors, "sysCoatColorsID", row["ColorSecondaryID"], "Description")
 a.BaseColourID = asm.colour_id_for_names(asm.fw(color1), asm.fw(color2))
 #a.IdentichipNumber = row["MICROCHIP"]
 breed1 = asm.find_value(cbreeds, "sysBreedsID", row["sysBreedPrimaryID"], "Breed")
 breed2 = asm.find_value(cbreeds, "sysBreedsID", row["sysBreedSecondaryID"], "Breed")
 a.BreedID = asm.breed_id_for_name(breed1)
 a.Breed2ID = asm.breed_id_for_name(breed2)
 # Not sure if this was customer specific with the (Mix) (Purebred) -
 # needs checking on future conversions
 if breed2 == "(Mix)": 
     a.Breed2ID = 442
     a.CrossBreed = 1
     a.BreedName = asm.breed_name(a.BreedID, a.Breed2ID)
 if breed2 == "(Purebred)":
     a.Breed2ID = a.BreedID
     a.CrossBreed = 0
     a.BreedName = asm.breed_name_for_id(a.BreedID)