Ejemplo n.º 1
0
class User(ndb.Model):
    token_timeline = ndb.StringProperty(default="")
    am_pm = ndb.BooleanProperty(default=False)
    tester = ndb.BooleanProperty(default=False)
    send_timeline_welcome_back = ndb.BooleanProperty(default=False)

    address_home = ndb.StringProperty()
    address_work = ndb.StringProperty()
    route_avoid_tolls = ndb.BooleanProperty(default=False)
    route_avoid_highways = ndb.BooleanProperty(default=False)
    route_avoid_ferries = ndb.BooleanProperty(default=False)

    timeline_enabled = ndb.BooleanProperty(default=True)
    timeline_pins_sent = ndb.IntegerProperty(default=0)
    timeline_onboarding_sent = ndb.BooleanProperty(default=False)
    timeline_work_arrival_local = ndb.TimeProperty()
    timeline_work_departure_local = ndb.TimeProperty()
    timeline_work_timezone = ndb.StringProperty()

    trip_home_work_mean = ndb.IntegerProperty(default=0)
    trip_home_work_count = ndb.IntegerProperty(default=0)
    trip_work_home_mean = ndb.IntegerProperty(default=0)
    trip_work_home_count = ndb.IntegerProperty(default=0)

    created = ndb.DateTimeProperty(auto_now_add=True)
    updated = ndb.DateTimeProperty(
        auto_now_add=True)  # Update manually when user changes config
Ejemplo n.º 2
0
class Reservation(ndb.Model):
    id = ndb.StringProperty(indexed=True)
    resource_id = ndb.StringProperty(indexed=True)
    resource_name = ndb.StringProperty(indexed=False)
    start_time = ndb.TimeProperty(indexed=True)
    duration = ndb.TimeProperty(indexed=True)
    user_id = ndb.StringProperty(indexed=True)
Ejemplo n.º 3
0
class Channel(ndb.Model):
    name = ndb.StringProperty(required = True)
    classes = ndb.KeyProperty(repeated = True)
    active = ndb.BooleanProperty(required = True)
    icon = ndb.BlobKeyProperty()
    startTime = ndb.TimeProperty(auto_now = True)
    endTime = ndb.TimeProperty(auto_now = True)
Ejemplo n.º 4
0
class LocationAlert(ndb.Model):
    alert_status = ndb.BooleanProperty(default=True)
    alert_name = ndb.StringProperty(required=True, verbose_name="Name your alert") 
    alert_owner = ndb.StringProperty()
    alert_tracked_people = ndb.StringProperty(repeated=True, verbose_name="People to Track")
    alert_location_center = ndb.GeoPtProperty()
    alert_location_radius = ndb.FloatProperty()
    alert_day_sun = ndb.BooleanProperty(default=False)
    alert_day_mon = ndb.BooleanProperty(default=False)
    alert_day_tue = ndb.BooleanProperty(default=False)
    alert_day_wed = ndb.BooleanProperty(default=False)
    alert_day_thu = ndb.BooleanProperty(default=False)
    alert_day_fri = ndb.BooleanProperty(default=False)
    alert_day_sat = ndb.BooleanProperty(default=False)
    alert_time_start = ndb.TimeProperty()
    alert_time_end = ndb.TimeProperty()
    # direction: False = outward, True = inward
    alert_direction = ndb.BooleanProperty(default=False)

    class RESTMeta:
        user_owner_property = 'alert_owner'
# [END LocationAlert]

    @classmethod
    def get_by_owner_user(cls, user):
        return cls.query().filter(cls.alert_owner == user.user_id()).get()

    @classmethod
    def get_by_member_user(cls, user):
        return cls.query().filter(user.user_id() in cls.alert_tracked_people).get()
Ejemplo n.º 5
0
class StudyProcedures(ndb.Model):
    Pname = ndb.StringProperty(required=True)
    startTime = ndb.TimeProperty(auto_now_add=True)
    endTime = ndb.TimeProperty(auto_now_add=True)
    datetimeStarted = ndb.DateTimeProperty(auto_now_add=True)
    iteration = ndb.IntegerProperty(
        required=True)  #The TSInstance iteration Number
Ejemplo n.º 6
0
class Resource(ndb.Model):
    name = ndb.StringProperty()
    date = ndb.DateProperty()
    start_time = ndb.TimeProperty()
    end_time = ndb.TimeProperty()
    tag_keys = ndb.KeyProperty('Tag', repeated=True)
    owner = ndb.UserProperty()
    reservation_keys = ndb.KeyProperty('Reservation', repeated=True)
Ejemplo n.º 7
0
class Club(ndb.model):
    name = ndb.StringProperty()
    startTime = ndb.TimeProperty()
    endTime = ndb.TimeProperty()
    days = ndb.StringProperty(repeated=True)
    days = ndb.DateProperty()
    contact_email = ndb.StringProperty()
    contact_phone = ndb.StringProperty()
Ejemplo n.º 8
0
class Resource(ndb.Model):
    id = ndb.StringProperty(indexed=True)
    user_id = ndb.StringProperty(indexed=True)
    name = ndb.StringProperty(indexed=False)
    start_time = ndb.TimeProperty(default=time.min, indexed=True)
    end_time = ndb.TimeProperty(default=time.max, indexed=True)
    tags = ndb.StructuredProperty(Tag, repeated=True)
    last_reservation_time = ndb.TimeProperty(indexed=True)
    reservations = ndb.StructuredProperty(Reservation, repeated=True)
Ejemplo n.º 9
0
class Eater(ndb.Model):
    creator = ndb.KeyProperty(kind=Feeder)
    name = ndb.StringProperty(default='Your first pet')
    am = ndb.TimeProperty(default=time(7))
    pm = ndb.TimeProperty(default=time(19, 30))

    @classmethod
    def query_feeder(cls, feeder):
        return cls.query().filter(cls.creator == feeder.key).fetch(1000)
Ejemplo n.º 10
0
class Resource(ndb.Model):
    resourceId = ndb.StringProperty(indexed=True)
    resourceName = ndb.StringProperty(indexed=True)
    startTime = ndb.TimeProperty(indexed=False)
    endTime = ndb.TimeProperty(indexed=False)
    tags = ndb.StringProperty(indexed=False, repeated=True)
    owner = ndb.StringProperty(indexed=True)
    lastReservationTime = ndb.DateTimeProperty(indexed=True)
    count = ndb.IntegerProperty(indexed=False)
Ejemplo n.º 11
0
class Session(ndb.Model):
    """ Session - session object """
    name = ndb.StringProperty(required=True)
    highlights = ndb.StringProperty()
    speaker = ndb.StringProperty()
    duration = ndb.TimeProperty()
    typeOfSession = ndb.StringProperty()
    date = ndb.DateProperty()
    startTime = ndb.TimeProperty()
Ejemplo n.º 12
0
class Session(ndb.Model):
    """Session -- conference session info"""
    name = ndb.StringProperty(required=True)
    highlights = ndb.StringProperty()
    speaker = ndb.StringProperty()
    typeOfSession = ndb.StringProperty(default="NOT_SPECIFIED")
    date = ndb.DateProperty()
    startTime = ndb.TimeProperty()
    endTime = ndb.TimeProperty()
class Session(ndb.Model):
    """Session object"""
    name = ndb.StringProperty(required=True)
    highlights = ndb.StringProperty()
    duration = ndb.IntegerProperty()
    typeOfSession = ndb.StringProperty(default='NOT_SPECIFIED')
    date = ndb.DateProperty()
    startTime = ndb.TimeProperty()
    endTime = ndb.TimeProperty()
    speakers = ndb.KeyProperty(kind='Speaker', repeated=True)
Ejemplo n.º 14
0
class Event(ndb.Model):
    name = ndb.StringProperty()
    date = ndb.DateProperty()
    start_time = ndb.TimeProperty()
    end_time = ndb.TimeProperty()

    teacher = ndb.StringProperty()
    location = ndb.StringProperty()
    levels = ndb.StringProperty()
    equipment = ndb.StringProperty()
    remarks = ndb.StringProperty()
Ejemplo n.º 15
0
class Resource(ndb.Model):
    owner = ndb.StringProperty(required=True)
    resource_name = ndb.StringProperty(required=True)
    available_time_start = ndb.TimeProperty(indexed=False)
    available_time_end = ndb.TimeProperty(indexed=False)
    tags = ndb.StringProperty(repeated=True)
    # last_reserve_time=ndb.DateTimeProperty(required=True,default=datetime(2000,1,1,10,0))
    last_reserve_time = ndb.StringProperty(required=True,
                                           default="01/01/00,10:00 to 12:00")
    reserve_times = ndb.IntegerProperty(required=True, default=0)
    img = ndb.BlobProperty()
    description = ndb.TextProperty()
Ejemplo n.º 16
0
class Event(ndb.Model):
    """Individual time block (30 min minimum) to be stored in calendars"""
    owner = ndb.StringProperty(indexed=True)
    attendees = ndb.StructuredProperty(Invitee, indexed=True, repeated=True)
    day = ndb.DateProperty(indexed=True)
    beginning_time = ndb.TimeProperty(indexed=True)
    ending_time = ndb.TimeProperty(indexed=True)
    event_name = ndb.StringProperty(indexed=False)
    event_location = ndb.StringProperty(indexed=False)
    event_description = ndb.TextProperty(indexed=False)
    recurring = ndb.BooleanProperty(indexed=False, default=False)
    recurring_day = ndb.StringProperty(indexed=True)
    num_blocks = ndb.IntegerProperty(indexed=False)
Ejemplo n.º 17
0
class Session(ndb.Model):
    """Session -- Session object"""
    name = ndb.StringProperty(required=True)
    # multiple highlights can exist
    highlights = ndb.StringProperty(repeated=True)
    # multiple speaker entities can exist
    speakers = ndb.KeyProperty(kind=Speaker, repeated=True)
    duration = ndb.TimeProperty()
    # the msgprop module is used
    typeOfSession = ndb.StringProperty()
    date = ndb.DateProperty()
    startTime = ndb.TimeProperty()
    location = ndb.StringProperty()
Ejemplo n.º 18
0
class Session(ndb.Model):
    """Conference session model"""
    name            = ndb.StringProperty(required=True)
    highlights      = ndb.StringProperty(repeated=True)
    speaker         = ndb.StringProperty() # TODO: make into a class
    duration        = ndb.TimeProperty()
    typeOfSession   = ndb.StringProperty(default='NOT_SPECIFIED')
    # TODO: do we need to split into Date and Time values separately?
    # The issue is that then we could query on date without using
    # an inequality, which means we would be more flexible. In that
    # case we'd have one LocalDateProperty() and one LocalTimeProperty().
    localDate       = ndb.DateProperty()
    localTime       = ndb.TimeProperty()
    speakerWebsafeKeys = ndb.StringProperty(repeated=True)
Ejemplo n.º 19
0
class BidCart(ndb.Model):
    bid = ndb.StructuredProperty(Bid, indexed=True)
    bidder = ndb.StructuredProperty(Author)
    bid_price = ndb.FloatProperty(indexed=True)
    quantity_to_bid = ndb.IntegerProperty(indexed=True)
    date = ndb.DateProperty(auto_now_add=True)
    time = ndb.TimeProperty(auto_now_add=True)
Ejemplo n.º 20
0
class MyAffiliates(ndb.Expando):
    strUserID = ndb.StringProperty()
    strAffiliatedID = ndb.StringProperty(
    )  # User ID for the Account which is affiliated by this user
    strDate = ndb.DateProperty(auto_now_add=True)
    strTime = ndb.TimeProperty(auto_now_add=True)
    strCredits = ndb.IntegerProperty(default=0)

    def writeUserID(self, strinput):
        try:
            strinput = str(strinput)
            if strinput != None:
                self.strUserID = strinput
                return True
            else:
                return False
        except:
            return False

    def writeAffiliateID(self, strinput):
        try:
            strinput = str(strinput)
            if strinput != None:
                self.strAffiliatedID = strinput
                return True
            else:
                return False
        except:
            return False

    def writeCredits(self, strinput):
        try:
            strinput = str(strinput)
            if strinput.isdigit():
                self.strCredits += int(strinput)
                return True
            else:
                return False
        except:
            return False

    def writeDate(self, strinput):
        try:
            if isinstance(strinput, datetime.date):
                self.strDate = strinput
                return True
            else:
                return False
        except:
            return False

    def writeTime(self, strinput):
        try:
            if isinstance(strinput, datetime.time):
                self.strTime = strinput
                return True
            else:
                return False
        except:
            return False
Ejemplo n.º 21
0
class Commento(ndb.Model):
    commento_id = ndb.StringProperty(required=True)
    guest_name = ndb.StringProperty()
    guest_email = ndb.StringProperty(required=True)
    guest_picture = ndb.StringProperty()
    testo =ndb.StringProperty()
    datetime = ndb.TimeProperty(auto_now=True)
Ejemplo n.º 22
0
class SMSInBox(ndb.Expando):
    strContactID = ndb.StringProperty()
    strMessageID = ndb.StringProperty()
    strResponse = ndb.StringProperty()
    strDateReceived = ndb.DateProperty()
    strTimeReceived = ndb.TimeProperty()

    def writeContactID(self, strinput):
        try:
            strinput = str(strinput)
            if not (strinput == None):
                self.strContactID = strinput
                return True
            else:
                return False
        except:
            return False

    def writeMessageID(self, strinput):
        try:
            strinput = str(strinput)
            if not (strinput == None):
                self.strMessageID = strinput
                return True
            else:
                return False
        except:
            return False

    def writeResponse(self, strinput):
        try:
            strinput = str(strinput)
            if not (strinput == None):
                self.strResponse = strinput
                return True
            else:
                return False
        except:
            return False

    def writeDateReceived(self, strinput):
        try:
            if isinstance(strinput, datetime.date):
                self.strDateReceived = strinput
                return True
            else:
                return False
        except:
            return False

    def writeTimeReceived(self, strinput):
        try:
            if isinstance(strinput, datetime.time):
                self.strTimeReceived = strinput
                return True
            else:
                return False

        except:
            return False
Ejemplo n.º 23
0
class Publicacion(ndb.Model):
    titulo = ndb.StringProperty(required=True)
    fecha = ndb.DateProperty(indexed=True, auto_now_add=True)
    hora = ndb.TimeProperty(auto_now_add=True)
    foto = ndb.BlobProperty(default="null")
    email_creador = ndb.StringProperty(required=True)

    @staticmethod
    def recupera(req):
        try:
            id = req.GET["id"]
        except:
            id = ""

        return ndb.Key(urlsafe=id).get()

    @staticmethod
    def recuperar_user(req):
        try:
            email_user = req.GET["email"]
        except:
            email_user = ""

        if email_user:
            email_creador = ndb.Key(urlsafe=email_user)
            publicaciones = Publicacion.query(
                Publicacion.email_creador == email_creador)
            return (email_creador.get(), publicaciones)
        else:
            print("ERROR: creador no encontrado")
Ejemplo n.º 24
0
class RideModel(ndb.Model):
    destination = ndb.StringProperty()
    date = ndb.DateProperty()
    time = ndb.TimeProperty()
    capacity = ndb.IntegerProperty()
    passengers = ndb.StringProperty(repeated=True)
    origin = ndb.StringProperty()
Ejemplo n.º 25
0
class GameEntity(ndb.Model):
    #     def to_dict(self):
    #         output = {}
    #         for key, prop in self._properties.iteritems():
    #             value = coerce(getattr(self, key))
    #             if value is not None:
    #                 output[key] = value
    #         return output
    # Date
    date = ndb.DateTimeProperty(auto_now_add=True)
    # Location
    location = ndb.GeoPtProperty()
    # Team #1 colour, score
    # Team #2 colour, score
    teams = ndb.StructuredProperty(TeamEntity, repeated=True)
    # Game start time
    start_time = ndb.TimeProperty()
    description = ndb.StringProperty()
    type = ndb.IntegerProperty()
    age_category = ndb.IntegerProperty(default=0)
    gender_category = ndb.IntegerProperty(default=0)

    # MAYBE
    # Unique Observers
    # Unique Contributors
    def to_dict(self):
        ret = ndb.Model.to_dict(self,
                                exclude=['date', 'start_time', 'location'])
        ret['gid'] = str(self.key.id())
        ret['start_time'] = self.start_time.strftime('%H:%M')
        return ret
Ejemplo n.º 26
0
class Meet_Up(ndb.Model):
    dbMeetUpName = ndb.StringProperty(required=True)
    dbMeetUpDate = ndb.DateTimeProperty(required=True)
    dbMeetUpTime = ndb.TimeProperty(required=True)
    dbMeetUpPlace = ndb.StringProperty(required=True)
    dbMeetUpSpot = ndb.StringProperty(required=False)
    dbMeetUpFriends = ndb.StringProperty(required=False)
Ejemplo n.º 27
0
class MessageModelTest(ndb.Model):
    string = ndb.StringProperty()
    repeatedString = ndb.StringProperty(repeated=True)
    text = ndb.TextProperty()
    repeatedText = ndb.TextProperty(repeated=True)
    blob = ndb.BlobProperty()
    repeatedBlob = ndb.BlobProperty(repeated=True)
    keyProp = ndb.KeyProperty()
    repeatedKey = ndb.KeyProperty(repeated=True)
    boolean = ndb.BooleanProperty()
    repeatedBoolean = ndb.BooleanProperty(repeated=True)
    integer = ndb.IntegerProperty()
    repeatedInteger = ndb.IntegerProperty(repeated=True)
    float = ndb.FloatProperty()
    repeatedFloat = ndb.FloatProperty(repeated=True)
    datetime = ndb.DateTimeProperty()
    repeatedDatetime = ndb.DateTimeProperty(repeated=True)
    time = ndb.TimeProperty()
    date = ndb.DateProperty()
    geopt = ndb.GeoPtProperty()
    repeatedGeopt = ndb.GeoPtProperty(repeated=True)
    blobkey = ndb.BlobKeyProperty()
    repeatedBlobkey = ndb.BlobKeyProperty(repeated=True)
    structured = ndb.StructuredProperty(InnerModel)
    repeatedStructured = ndb.StructuredProperty(InnerModel, repeated=True)
Ejemplo n.º 28
0
class DefaultPair(ndb.Model):
    classname = ndb.StringProperty()
    start_time = ndb.TimeProperty()
    duration = ndb.IntegerProperty(default=90)
    week_day = ndb.IntegerProperty()
    group_id = ndb.StringProperty()
    pair_type = ndb.StringProperty()
Ejemplo n.º 29
0
class Session(ndb.Model):
    name = ndb.StringProperty(required=True)
    highlights = ndb.StringProperty()
    speaker = ndb.StringProperty(required=True)
    duration = ndb.IntegerProperty()
    typeOfSession = ndb.StringProperty(repeated=True)
    date = ndb.DateProperty()
    time = ndb.TimeProperty()
Ejemplo n.º 30
0
class Event(ndb.Model):
    # key name: str(chat_id)
    organizer = ndb.StringProperty(indexed=False, default=False)
    organizer_id = ndb.IntegerProperty()
    eventname = ndb.TextProperty()
    day = ndb.DateProperty()
    starttime = ndb.TimeProperty()
    description = ndb.TextProperty()