Ejemplo n.º 1
0
# Import external modules
from google.appengine.api import memcache
from google.appengine.ext import ndb
import logging
import random
import time
# Import app modules
from configuration import const as conf
from constants import Constants
import text

const = Constants()
const.MAX_RETRY = 3
const.MIN_REAGGREGATE_DELAY_SEC = 60


# Parent key: RequestForProposals?   No, use KeyProperty instead.
class Proposal(ndb.Model):
    requestId = ndb.StringProperty()  # May be null

    title = ndb.StringProperty()
    detail = ndb.StringProperty()
    creator = ndb.StringProperty()
    allowEdit = ndb.BooleanProperty()
    freezeUserInput = ndb.BooleanProperty(default=False)

    voteAggregateStartTime = ndb.IntegerProperty()
    numPros = ndb.IntegerProperty(default=0)
    numCons = ndb.IntegerProperty(default=0)
    netPros = ndb.IntegerProperty(default=0)  # numPros - numCons
    score = ndb.FloatProperty(default=0)