Beispiel #1
0
    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
Beispiel #2
0
    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
Beispiel #3
0
    def create(cls, session, user_id):
        meta  = cls()
        meta.user_id = user_id

        Util.add_and_refresh(session, meta)
        return meta
Beispiel #4
0
    def create(cls, session, comment_id):
        comment = cls()
        comment.reddit_id = Util.plain_id(comment_id)

        Util.add_and_refresh(session, comment)
        return comment
Beispiel #5
0
    def create(cls, session, post_id):
        post = cls()
        post.reddit_id = Util.plain_id(post_id)

        Util.add_and_refresh(session, post)
        return post
Beispiel #6
0
    def create(cls, session, display_name):
        sub = cls()
        sub.display_name = display_name

        Util.add_and_refresh(session, sub)
        return sub