Beispiel #1
0
def getPostArticle(request, postId):
    # postId = 1
    test = PostsDataAccessLayer()
    post = test.getPosts([postId])[str(postId)]
    data = json.dumps(post.__dict__)
    res = HttpResponse(data, status=200, content_type='application/json')
    return res
Beispiel #2
0
 def __init__(self):
     Thread.__init__(self)
     self.__postCollection = {}
     self.__postDal = PostsDataAccessLayer()