def create(cls, session, username): user = cls() user.name = username Util.add_and_refresh(session, user) dispatcher.send(signal=cls.CREATED_SIGNAL, sender=user) return user
def create(cls, session, user, post, vote): inst = cls() inst.post_id = post.id inst.user_id = user.id inst.vote = vote Util.add_and_refresh(session, inst) return inst
def create(cls, session, user_id): meta = cls() meta.user_id = user_id Util.add_and_refresh(session, meta) return meta
def create(cls, session, comment_id): comment = cls() comment.reddit_id = Util.plain_id(comment_id) Util.add_and_refresh(session, comment) return comment
def create(cls, session, post_id): post = cls() post.reddit_id = Util.plain_id(post_id) Util.add_and_refresh(session, post) return post
def create(cls, session, display_name): sub = cls() sub.display_name = display_name Util.add_and_refresh(session, sub) return sub