Ejemplo n.º 1
0
# Import external modules
from google.appengine.ext import ndb
import math
# Import app modules
from configuration import const as conf
from constants import Constants
import logging
import proposal
import reasonVote
import text

# Constants
const = Constants()
const.MAX_RETRY = 3
const.MAX_VOTE_RETRY = 3
const.CHAR_LENGTH_UNIT = 100


# Persistent record
# Parent key: proposal?  No, use key-properties instead, for better throughput.
class Reason(ndb.Model):
    proposalId = ndb.StringProperty(
    )  # Primary key.  Needed to retrieve all reasons for a single proposal.
    requestId = ndb.StringProperty(
    )  # Search index.  Needed to retrieve all reasons for request.

    content = ndb.StringProperty()
    proOrCon = ndb.StringProperty()  # { 'pro', 'con' }
    creator = ndb.StringProperty()
    allowEdit = ndb.BooleanProperty()