def __init__(self,submission): super(SubmissionQuery,self).__init__(submission) if self.author is None: self.author = 'None' self.title = Query.addquote(self.title) self.label = LabelMaker().create(self.submission) self.created = datetime.fromtimestamp( self.created, tz=timezone('US/Eastern')).strftime("%Y-%m-%d")
def __init__(self,comment): super(CommentQuery,self).__init__(comment) if self.author is None: self.author = 'None' if not self.edited: self.edited = str(0) else: self.edited = str(1) if self.body == '[removed]' or self.body == '[deleted]': self.deleted = str(1) else: self.deleted = str(0) self.created = datetime.fromtimestamp( self.created, tz=timezone('US/Eastern')).strftime("%Y-%m-%d") self.body = Query.addquote(self.body)