New Event model
This commit is contained in:
committed by
GitHub
parent
d750f29fad
commit
d98d802a33
@@ -37,7 +37,9 @@ class Thread(object):
|
|||||||
last_message_timestamp = None
|
last_message_timestamp = None
|
||||||
#: Number of messages in the thread
|
#: Number of messages in the thread
|
||||||
message_count = None
|
message_count = None
|
||||||
def __init__(self, _type, uid, photo=None, name=None, last_message_timestamp=None, message_count=None):
|
#: List of :class:`Event`
|
||||||
|
event_reminders = None
|
||||||
|
def __init__(self, _type, uid, photo=None, name=None, last_message_timestamp=None, message_count=None, event_reminders=[]):
|
||||||
"""Represents a Facebook thread"""
|
"""Represents a Facebook thread"""
|
||||||
self.uid = str(uid)
|
self.uid = str(uid)
|
||||||
self.type = _type
|
self.type = _type
|
||||||
@@ -45,6 +47,7 @@ class Thread(object):
|
|||||||
self.name = name
|
self.name = name
|
||||||
self.last_message_timestamp = last_message_timestamp
|
self.last_message_timestamp = last_message_timestamp
|
||||||
self.message_count = message_count
|
self.message_count = message_count
|
||||||
|
self.event_reminders = event_reminders
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return self.__unicode__()
|
return self.__unicode__()
|
||||||
@@ -464,7 +467,7 @@ class PollOption(object):
|
|||||||
text = None
|
text = None
|
||||||
#: Whether vote when creating or client voted
|
#: Whether vote when creating or client voted
|
||||||
vote = None
|
vote = None
|
||||||
#: ID's of the persons who voted for this poll option
|
#: ID of the users who voted for this poll option
|
||||||
voters = None
|
voters = None
|
||||||
#: Votes count
|
#: Votes count
|
||||||
votes_count = None
|
votes_count = None
|
||||||
@@ -480,6 +483,43 @@ class PollOption(object):
|
|||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return '<PollOption ({}): {} voters={}>'.format(self.uid, repr(self.text), self.voters)
|
return '<PollOption ({}): {} voters={}>'.format(self.uid, repr(self.text), self.voters)
|
||||||
|
|
||||||
|
class Event(object):
|
||||||
|
#: ID of the event
|
||||||
|
uid = None
|
||||||
|
#: Event time (unix time stamp)
|
||||||
|
time = None
|
||||||
|
#: Event title
|
||||||
|
title = None
|
||||||
|
#: Event location name
|
||||||
|
location = None
|
||||||
|
#: Event location ID
|
||||||
|
location_id = None
|
||||||
|
#: ID of the event creator
|
||||||
|
creator_id = None
|
||||||
|
#: List of the people IDs who will take part in the event
|
||||||
|
going = None
|
||||||
|
#: List of the people IDs who won't take part in the event
|
||||||
|
declined = None
|
||||||
|
#: List of the people IDs who are invited to the event
|
||||||
|
invited = None
|
||||||
|
|
||||||
|
def __init__(self, time, title, location='', location_id=''):
|
||||||
|
"""Represents a event"""
|
||||||
|
self.time = time
|
||||||
|
self.title = title
|
||||||
|
self.location = location
|
||||||
|
self.location_id = location_id
|
||||||
|
self.creator_id = None
|
||||||
|
self.going = []
|
||||||
|
self.declined = []
|
||||||
|
self.invited = []
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return self.__unicode__()
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return '<Event ({}): {} time={}, location={}, location_id={}>'.format(self.uid, repr(self.title), self.time, repr(self.location), repr(self.location_id))
|
||||||
|
|
||||||
class Enum(enum.Enum):
|
class Enum(enum.Enum):
|
||||||
"""Used internally by fbchat to support enumerations"""
|
"""Used internally by fbchat to support enumerations"""
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
Reference in New Issue
Block a user