def __init__(self, record=None): if record is None: record = lbsn.Event() self.origin_id = record.pkey.origin.origin_id self.event_guid = record.pkey.id self.name = HF.null_check(record.name) self.event_latlng = HF.null_geom_check(record.event_latlng) self.event_area = HF.null_check(record.event_area) self.event_website = HF.null_check(record.event_website) self.event_date = HF.null_check_datetime(record.event_date) self.event_date_start = HF.null_check_datetime(record.event_date_start) self.event_date_end = HF.null_check_datetime(record.event_date_end) self.duration = HF.null_check(record.duration) self.place_guid = HF.null_check(record.place_pkey.id) self.city_guid = HF.null_check(record.city_pkey.id) self.country_guid = HF.null_check(record.country_pkey.id) self.user_guid = HF.null_check(record.user_pkey.id) self.event_description = HF.null_check(record.event_description) self.event_type = HF.null_check(record.event_type) self.event_share_count = HF.null_check(record.event_share_count) self.event_like_count = HF.null_check(record.event_like_count) self.event_comment_count = HF.null_check(record.event_comment_count) self.event_views_count = HF.null_check(record.event_views_count) self.event_engage_count = HF.null_check(record.event_engage_count)
def __init__(self, record=None): if record is None: record = lbsn.PostReaction() self.origin_id = record.pkey.origin.origin_id self.guid = record.pkey.id self.reaction_latlng = HF.null_geom_check(record.reaction_latlng) self.user_guid = HF.null_check(record.user_pkey.id) self.referenced_post = HF.null_check(record.referencedPost_pkey.id) self.referenced_postreaction = HF.null_check( record.referencedPostreaction_pkey.id) self.reaction_type = HF.turn_lower( HF.null_check(lbsn.PostReaction().ReactionType.Name( record.reaction_type))) self.reaction_date = HF.null_check_datetime(record.reaction_date) self.reaction_content = HF.null_check(record.reaction_content) self.reaction_like_count = HF.null_check(record.reaction_like_count) self.user_mentions = list( set([pkey.id for pkey in record.user_mentions_pkey]))
def __init__(self, record=None): if record is None: record = lbsn.Post() self.origin_id = record.pkey.origin.origin_id self.guid = record.pkey.id self.post_latlng = HF.null_geom_check(record.post_latlng) self.place_guid = HF.null_check(record.place_pkey.id) self.city_guid = HF.null_check(record.city_pkey.id) self.country_guid = HF.null_check(record.country_pkey.id) self.post_geoaccuracy = HF.turn_lower( HF.null_check(lbsn.Post().PostGeoaccuracy.Name( record.post_geoaccuracy))) self.user_guid = HF.null_check(record.user_pkey.id) self.post_create_date = HF.null_check_datetime(record.post_create_date) self.post_publish_date = HF.null_check_datetime( record.post_publish_date) self.post_body = HF.null_check(record.post_body) self.post_language = HF.null_check(record.post_language.language_short) self.user_mentions = list( set([pkey.id for pkey in record.user_mentions_pkey])) self.hashtags = list(set(record.hashtags)) self.emoji = list(set(record.emoji)) self.post_like_count = HF.null_check(record.post_like_count) self.post_comment_count = HF.null_check(record.post_comment_count) self.post_views_count = HF.null_check(record.post_views_count) self.post_title = HF.null_check(record.post_title) self.post_thumbnail_url = HF.null_check(record.post_thumbnail_url) self.post_url = HF.null_check(record.post_url) self.post_type = HF.turn_lower( HF.null_check(lbsn.Post().PostType.Name(record.post_type))) self.post_filter = HF.null_check(record.post_filter) self.post_quote_count = HF.null_check(record.post_quote_count) self.post_share_count = HF.null_check(record.post_share_count) self.input_source = HF.null_check(record.input_source) self.post_content_license = HF.null_check(record.post_content_license) # optional: self.latitude = 0 self.longitude = 0