Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
0
    def create(cls, session, user_id):
        meta  = cls()
        meta.user_id = user_id

        Util.add_and_refresh(session, meta)
        return meta
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 6
0
    def create(cls, session, display_name):
        sub = cls()
        sub.display_name = display_name

        Util.add_and_refresh(session, sub)
        return sub