示例#1
0
文件: admin.py 项目: dudarev/osmtweet
def update_count(date, count):
    """
    Returns False if already in datastore and has the same count
    """
    c = Count.get_by_key_name(str(date))
    if not c:
        c = Count(key_name=str(date))
    else:
        if c.count == count:
            return False
    c.count = count
    c.date = date
    c.put()
    return True