One more thing. if your view code is indented exactly the way it is in the 
provided then you need to fix the indentation of 

def post_details_view(request, post):

This should be under class SearchResultsViews()

like this...

class SearchResultsViews(ListView):
    model = Post
    template_name = 'Search.html'

    def get_queryset(self):
        query = self.request.GET.get('q')
        object_list = Post.objects.filter(Q(title__icontains=query))
        return object_list


    def post_details_view(request, post):
        f = get_object_or_404(Post, slug=post)
        return render(request, 'post_details.html', {'f': f})


On Friday, July 3, 2020 at 5:10:14 PM UTC-4, Tanni Seriki wrote:
>
> Please let me know if you have seen the file.
> Am sorry am sending it to you as file, my phone is malfunctioning
>
> On Fri, Jul 3, 2020, 9:49 PM Tanni Seriki <[email protected] 
> <javascript:>> wrote:
>
>> Sir here it's all the project, currently my phone camera has fault please 
>> help me out.
>>
>> On Fri, Jul 3, 2020, 9:23 PM coolguy <[email protected] 
>> <javascript:>> wrote:
>>
>>> I am away at this time but can you send the project urls.py screen shot 
>>> as well.
>>>
>>> On Friday, July 3, 2020 at 4:09:01 PM UTC-4, Tanni Seriki wrote:
>>>>
>>>> Here is my WhatsApp number
>>>> +2348095594236
>>>> Please I really need to solve this out
>>>>
>>>> On Fri, Jul 3, 2020, 9:07 PM Tanni Seriki <[email protected]> wrote:
>>>>
>>>>> Coolguy
>>>>> Please can we chat on WhatsApp...
>>>>> The post details is really giving me headache, please help out 
>>>>>
>>>>> On Fri, Jul 3, 2020, 9:04 PM coolguy <[email protected]> wrote:
>>>>>
>>>>>> Seems pretty simple unless you have specific question about something.
>>>>>>
>>>>>> You have a model which has some fields including Slug field which 
>>>>>> should be unique i.e. unique=True but your screen shot is not clear..
>>>>>>
>>>>>> In views you are overriding the get_queryset() method of base class 
>>>>>> and assigning it to query variable for the 'q' from http GET request. 
>>>>>> Then 
>>>>>> filtering Post data with the values in query object you have just 
>>>>>> created. 
>>>>>> Finally returned the revised object_list including this new query 
>>>>>> context.
>>>>>>
>>>>>> In post_detail_views you are retrieving data from Post based on the 
>>>>>> post slug and assigning it to variable 'f'. Finally you used the 
>>>>>> render() 
>>>>>> shortcut to render the retrieved post using a template.
>>>>>>
>>>>>> In your urlpatterns you have defined the path for your post_detail 
>>>>>> which send the post as a slug to your view and in turn view returns the 
>>>>>> HTTP response.
>>>>>>
>>>>>> On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:
>>>>>>>
>>>>>>> Please can someone put me through on this, post details view either 
>>>>>>> one the function based view or class based view. Thanks
>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Django users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to [email protected].
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected] <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6bc99e96-0830-4e23-9482-cd4268c14329o%40googlegroups.com.

Reply via email to