def get_queryset(self): queryset = Poetry.objects.all() md5codeParam= self.kwargs['md5code'] if len(md5codeParam)>0: #修改 HandlePoetryDb.addPraiseNumber(md5codeParam) if md5codeParam is not None: queryset = queryset.filter(md5code=md5codeParam) return queryset
def get_queryset(self): queryset = Poetry.objects.all() useridParam= self.kwargs['userid'] poetryParam=self.kwargs['poetry'] # get md5code if len(poetryParam)>0: md5codeParam=GetMd5Code.getMd5(poetryParam) HandlePoetryDb.insertPoetry(useridParam,poetryParam, md5codeParam) if poetryParam is not None: queryset = queryset.filter(md5code=md5codeParam) return queryset