예제 #1
0
파일: walls.py 프로젝트: wkral/scrwall.com
def add_url(id, url):
    if(url.startswith('http://')):
        wall = fetch(id)
        if wall:
            wall.item_count += 1
            item = WallItem(id=wall.item_count, wall=wall, url=url)
            item.put()
            wall.put()
            return item
    else:
        raise ValueError('Must be a well formatted URL')
예제 #2
0
파일: walls.py 프로젝트: wkral/scrwall.com
def fetch_item(wall_id, item_id):
    wall = fetch(wall_id)
    if wall:
        q = WallItem.gql('WHERE wall = :1 and id = :2', wall, item_id)
        item = q.get()
        return item