skip to Main Content

Html – Paginator only working for one web page django

Paginator is only working for the first index page but it doesn't work on the profile page def profile(request, profile): cur_profile = User.objects.get(username=profile) user_posts = Posts.objects.filter(creator=cur_profile.id).all().order_by('-id') follow_num = cur_profile.following.all().order_by('id') following_num = cur_profile.followers.all().order_by('id') paginator2 = Paginator(user_posts, 5) page_numberr = request.GET.get(paginator2) page_objj…

VIEW QUESTION

Reactjs – React: 'map' function

I'm fetching a list of objects. Using map function should display a list but there wasn't. I checked if it was saved to 'useState' via console.log(posts), and yes there was a list of objects. My only problem is I cant…

VIEW QUESTION

Mongodb – pymongo count_doucment() not working with datetime

Hi i am trying to query data from mongodb using python = 3.8, django=4.2.2, arrow==1.2.3 pymongo = 3.13.0, mongodb is serverless. this is my filter object filter['created_at']={ '$gte': arrow.now(settings.LOCAL_TIME_ZONE).shift(hours=-24).span('day')[0].to(settings.TIME_ZONE).datetime, '$lt': arrow.now(settings.LOCAL_TIME_ZONE).span('day')[1].to(settings.TIME_ZONE).datetime, } when i print filter['created_at'] i get output as…

VIEW QUESTION
Back To Top
Search