{"id":882,"date":"2022-05-10T18:00:00","date_gmt":"2022-05-10T09:00:00","guid":{"rendered":"https:\/\/www.sea2800.com\/?p=882"},"modified":"2022-05-10T16:19:19","modified_gmt":"2022-05-10T07:19:19","slug":"%e3%80%90django%e3%80%91queryset-object-has-no-attribute-%e3%81%8c%e7%99%ba%e7%94%9f%e3%81%97%e3%81%9f%e6%99%82%e3%81%ae%e5%af%be%e5%87%a6%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.sea2800.com\/?p=882","title":{"rendered":"\u3010Django\u3011QuerySet Object has no attribute \u2018~~~\u2019\u304c\u767a\u751f\u3057\u305f\u6642\u306e\u5bfe\u51e6\u6cd5"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3-1024x576.png\" alt=\"\" class=\"wp-image-884\" srcset=\"https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3-1024x576.png 1024w, https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3-300x169.png 300w, https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3-768x432.png 768w, https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3-920x518.png 920w, https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3-230x129.png 230w, https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3-350x197.png 350w, https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3-480x270.png 480w, https:\/\/www.sea2800.com\/wp-content\/uploads\/2022\/05\/\u540d\u79f0\u672a\u8a2d\u5b9a\u306e\u30c7\u30b6\u30a4\u30f3.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u30b3\u30e1\u30f3\u30c8\u306e\u524a\u9664\u5f8c\u306b\u30d6\u30ed\u30b0\u30da\u30fc\u30b8\u306b\u623b\u308b\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u305f\u304f\u8abf\u6574\u3057\u3066\u3044\u305f\u3068\u6240\u4e45\u3005\u306b\u3053\u306e\u30a8\u30e9\u30fc\u306b\u3042\u3044\u3001\u3069\u3046\u3084\u3063\u3066\u5bfe\u51e6\u3059\u308b\u306e\u304b\u5fd8\u308c\u304b\u3051\u3066\u3044\u305f\u306e\u3067\u3082\u3046\u4e8c\u5ea6\u3068\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u5b66\u7fd2\u30e1\u30e2\u3068\u3057\u3066\u516c\u958b\u3057\u307e\u3059\u3002\u3082\u3057\u3001\u306a\u3093\u304b\u3053\u3093\u306a\u611f\u3058\u306e\u30a8\u30e9\u30fc\u3092\u5410\u3044\u3066\u3057\u307e\u3063\u3066\u3044\u3066\u82e6\u6226\u3057\u3066\u3044\u308b\u4eba\u306e\u624b\u52a9\u3051\u306b\u306a\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u6c7a\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u300c\u305d\u306eobject\u306b\u306f\u6307\u5b9a\u3057\u305f\u540d\u524d\u306f\u306d\u3047\uff01\uff01\u300d\u3068\u3044\u3046\u7d50\u679c\u304c\u8fd4\u3063\u3066\u304d\u3066\u305f\u306e\u3067\u3001\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u4e01\u5be7\u306b\u5834\u6240\u3092\u6559\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u50d5\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5f62\u3067\u76f4\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class CommentDelete(LoginRequiredMixin, generic.DeleteView):\n    model = Comment\n    def delete(self, request, *args, **kwargs):\n        return super().delete(request, *args, **kwargs)\n    def get_success_url(self):\n        comment = get_object_or_404(Comment, slug=self.kwargs&#91;'slug'])\uff03\u6d88\u3057\u305f\u3044\u30b3\u30e1\u30f3\u30c8\u304c\u3069\u3053\u306b\u7e4b\u304c\u3063\u3066\u3044\u308b\u306e\u304b\u3092Django\u306b\u8aac\u660e\u3059\u308b\u6587\n        return resolve_url('Blog:post', slug=comment.post.slug)#\u3046\u307e\u304f\u884c\u3063\u305f\u3089Comment\u3092\u6d88\u3059\u524d\u306b\u30ea\u30f3\u30af\u3057\u305f\u30e2\u30c7\u30ebPost\u306eslug\u3092\u53c2\u7167\u3057\u3066\u305d\u3053\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u7528\u306b\u652f\u6301\u3059\u308b\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u767a\u751f\u7d4c\u7def<\/h2>\n\n\n\n<p>\u7c21\u5358\u306b\u767a\u751f\u3057\u305f\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      blog= get_object_or_404(Blog, slug=self.kwargs&#91;'slug'])\n      return resolve_url('Blog:post', slug=blog.slug)\n<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u306e\u5834\u5408\u30b3\u30e1\u30f3\u30c8\u81ea\u8eab\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u305fslug\u3092\u53c2\u7167\u3057\u3066\u3057\u307e\u3044\u6d88\u3048\u308b\u524d\u306b\u305d\u306eslug\u306e\u8a18\u4e8b\u306f\u306d\u3047\u3068\u8fd4\u3055\u308c\u308b\u3053\u3068\u3067\u767a\u751f\u3059\u308b\u30a8\u30e9\u30fc\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5ba3\u4f1d<\/h2>\n\n\n\n<p>\u4ed6\u306b\u3082Django\u3067\u4f5c\u3063\u305f\u3082\u306e\u306e\u6280\u8853\u306e\u307e\u3068\u3081\u3092\u4ee5\u4e0b\u306e\u8a18\u4e8b\u306b\u3057\u3066\u307e\u3068\u3081\u3066\u304a\u308a\u307e\u3059\u306e\u3067\u3001\u6687\u304c\u3042\u3063\u305f\u308a\u4f55\u304b\u8208\u5473\u304c\u5f15\u304b\u308c\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3057\u305f\u3089\u662f\u975e\u898b\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-espresso-log wp-block-embed-espresso-log\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"ET2laGJefe\"><a href=\"https:\/\/www.sea2800.com\/?p=765\">Django\u3067\u6c7a\u6e08\u3092\u884c\u3046\uff08Stripe\u6c7a\u6e08\uff09<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Django\u3067\u6c7a\u6e08\u3092\u884c\u3046\uff08Stripe\u6c7a\u6e08\uff09&#8221; &#8212; Espresso log\" src=\"https:\/\/www.sea2800.com\/?p=765&#038;embed=true#?secret=wVPpAkAICK#?secret=ET2laGJefe\" data-secret=\"ET2laGJefe\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-espresso-log wp-block-embed-espresso-log\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"o0HDD8Pq1c\"><a href=\"https:\/\/www.sea2800.com\/?p=723\">Django3.2\u3067runserver\u3092\u5165\u529b\u3057\u305f\u3089\u7a81\u7136\u30e2\u30c7\u30eb\u306eWARNING\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Django3.2\u3067runserver\u3092\u5165\u529b\u3057\u305f\u3089\u7a81\u7136\u30e2\u30c7\u30eb\u306eWARNING\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5&#8221; &#8212; Espresso log\" src=\"https:\/\/www.sea2800.com\/?p=723&#038;embed=true#?secret=tpx7e32X6f#?secret=o0HDD8Pq1c\" data-secret=\"o0HDD8Pq1c\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-espresso-log wp-block-embed-espresso-log\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"VIAKRArRTc\"><a href=\"https:\/\/www.sea2800.com\/?p=401\">gTTS\u3092\u4f7f\u304a\u3046\u3068\u3057\u305f\u3089 No module named &#8216;six&#8217;\u304c\u51fa\u305f\u306e\u3067\u76f4\u3057\u305f\u304a\u8a71<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;gTTS\u3092\u4f7f\u304a\u3046\u3068\u3057\u305f\u3089 No module named &#8216;six&#8217;\u304c\u51fa\u305f\u306e\u3067\u76f4\u3057\u305f\u304a\u8a71&#8221; &#8212; Espresso log\" src=\"https:\/\/www.sea2800.com\/?p=401&#038;embed=true#?secret=EByKynLkfi#?secret=VIAKRArRTc\" data-secret=\"VIAKRArRTc\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b3\u30e1\u30f3\u30c8\u306e\u524a\u9664\u5f8c\u306b\u30d6\u30ed\u30b0\u30da\u30fc\u30b8\u306b\u623b\u308b\u6a5f\u80fd\u3092\u8ffd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-882","post","type-post","status-publish","format-standard","hentry","category-1"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.sea2800.com\/index.php?rest_route=\/wp\/v2\/posts\/882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sea2800.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sea2800.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sea2800.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sea2800.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=882"}],"version-history":[{"count":4,"href":"https:\/\/www.sea2800.com\/index.php?rest_route=\/wp\/v2\/posts\/882\/revisions"}],"predecessor-version":[{"id":887,"href":"https:\/\/www.sea2800.com\/index.php?rest_route=\/wp\/v2\/posts\/882\/revisions\/887"}],"wp:attachment":[{"href":"https:\/\/www.sea2800.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sea2800.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sea2800.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}