Пример #1
0
def create(accountKey, number):
    depot = jt.model.Depot(parent=accountKey,
                           account=accountKey,
                           number=number,
                           pickedUp=True)
    depot.put()
    return depot.key()
Пример #2
0
def drop(accountKey, depotKey, lat, lon, imageData):
    photoKey = jt.service.photo.create(imageData,accountKey,accountKey)
    
    query = db.GqlQuery("SELECT * FROM Depot WHERE __key__ = :1 AND account = :2 AND ANCESTOR IS :2",depotKey, accountKey)
    depot = query.get()
    depot.coordinate = db.GeoPt(lat=lat,lon=lon)
    depot.dateDropped = datetime.datetime.utcnow()
    depot.photo = photoKey
    depot.pickedUp = False
    
    depot.put()
    return depot.key()
Пример #3
0
def drop(accountKey, depotKey, lat, lon, imageData):
    photoKey = jt.service.photo.create(imageData, accountKey, accountKey)

    query = db.GqlQuery(
        "SELECT * FROM Depot WHERE __key__ = :1 AND account = :2 AND ANCESTOR IS :2",
        depotKey, accountKey)
    depot = query.get()
    depot.coordinate = db.GeoPt(lat=lat, lon=lon)
    depot.dateDropped = datetime.datetime.utcnow()
    depot.photo = photoKey
    depot.pickedUp = False

    depot.put()
    return depot.key()
Пример #4
0
def getDepotsAsTargetForTag(accountKey, tagKey):
    tag = db.get(tagKey)
    #tag.hasReachedDestination
    direction = 0
    if tag.hasReachedDestination:
        direction = 1

    depotQuery = jt.service.depot.getByStatus(accountKey, False)

    logQuery = db.GqlQuery("SELECT * FROM DepotTagLog WHERE tag = :1", tagKey)

    depotList = []
    for depot in depotQuery:
        status = True
        for logEntry in logQuery:
            if logEntry.depot.key() == depot.key():
                status = False
        depot.tagCanUse = status
        depotList.append(depot)

    return depotList
Пример #5
0
def getDepotsAsTargetForTag(accountKey, tagKey):
    tag = db.get(tagKey)
    #tag.hasReachedDestination
    direction = 0
    if tag.hasReachedDestination:
        direction = 1

    depotQuery = jt.service.depot.getByStatus(accountKey,False)

    logQuery = db.GqlQuery("SELECT * FROM DepotTagLog WHERE tag = :1",tagKey)

    depotList = []
    for depot in depotQuery:
        status = True
        for logEntry in logQuery:
            if logEntry.depot.key() == depot.key():
                status = False
        depot.tagCanUse = status
        depotList.append(depot)

    return depotList
Пример #6
0
def create(accountKey,number):
    depot = jt.model.Depot(parent=accountKey, account=accountKey, number=number, pickedUp=True)
    depot.put()
    return depot.key()