Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8498619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:27:09+00:00 2026-06-11T00:27:09+00:00

First I want to state that I asked a similar question before, however I

  • 0

First I want to state that I asked a similar question before, however I would like to give this question more direction. As a noob to python, app engine and especially jquery, this is turning out to be quite a daunting task. I was wondering if someone could please point me in the right direction (perhaps a way to do this in app engine itself), and maybe even be so kind as to outline what I should do here.

The following is the code that gets posts in my profile page:

What I have now is a Query object:

 posts = db.GqlQuery("select * from Profile_Comments WHERE name_of_profile =:1 order by date_created desc", profile_id)

And a for loop in my jinja template that gets the posts:

{% for post_tmp in posts %}

        {{post_tmp.post.replace('\r\n', '<br>') | safe }}

{%  endfor %}

Thank you very very much! And sorry for the pseudo re-post!

Edit – Entire Profile Handler (the template is posted above… its a simple for loop):

  class Profile(MainHandler):
    def get(self, profile_id):
        u = User.by_name(profile_id.lower())
        if not u:
            self.redirect('/')
        if self.user and profile_id:
            current_user = self.user.name
            name1 = ''
            friend_name = ''
            team_imagee = ''
            key = ''
            monthss = ''
            yearss = ''
            dayss = ''
            countryss = ''
            team_imagee2 = ''
            imgs2 = ''
            imgs = ''
            key2 = ''
            name22 = ''
            name2 = ''
            handless = ''
            msgg = ''
            imgs  = db.GqlQuery("select * from Profile_Images WHERE name =:1", profile_id)
            imgs2  = db.GqlQuery("select * from Profile_Images WHERE name =:1", current_user)
            team_name  = db.GqlQuery("select * from Teams WHERE name =:1", profile_id)
            team_images  = db.GqlQuery("select * from Teamimg WHERE user =:1", profile_id)
            team_images2  = db.GqlQuery("select * from Teamimg WHERE user =:1", current_user)
            friends  = db.GqlQuery("select * from Friends WHERE name =:1 order by added_date desc limit 10", profile_id)
            posts = db.GqlQuery("select * from Profile_Comments WHERE name_of_profile =:1 order by date_created desc", profile_id)
            name2 = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            month = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            day = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            year = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            country = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            handle  = db.GqlQuery("select * from Handle WHERE name =:1", profile_id)
            rating = db.GqlQuery("select * from Rating WHERE name_of_profile =:1", profile_id)
            profile_msg = db.GqlQuery("select * from Profile_Msg WHERE name =:1", profile_id)
            for handles in handle:
                handless = handles.handle_name
            for months in month:
                monthss = months.month
            for countrys in country:
                countryss = countrys.country
            for days in day:
                dayss = days.day
            for years in year:
                yearss = years.year
            for clan in team_name:
                    name1 = clan.team_name_anycase
            for clan in team_name:
                    name2 = clan.team_name
            for image in team_images:
                team_imagee = image.key()
            for image2 in team_images2:
                team_imagee2 = image2.key()
            for img in imgs:
                key = img.key()
            for img2 in imgs2:
                key2 = img2.key()
            for msg in profile_msg:
                    msgg = msg.msg       
            self.render('profile.html', msg = msgg, team_name2 = name2, handle_var = handless,  imgs = imgs, team_img2 = team_imagee2, profile_image_posted = key2, posts = posts, profile_id = profile_id, country_var = countryss, day_var = dayss, year_var = yearss, month_var = monthss, current_user = current_user, friends = friends, team_img = team_imagee, team_name = name1, profile_image = key, username = self.user.name, email = self.user.email, firstname = self.user.first_name, last_name = self.user.last_name, country = self.user.country)
        else:
            self.redirect('/register')


    def post(self, profile_id):
        if self.user and profile_id:
            current_user = self.user.name
            name1 = ''
            friend_name = ''
            team_imagee = ''
            key = ''
            monthss = ''
            yearss = ''
            dayss = ''
            countryss = ''
            team_imagee2 = ''
            imgs2 = ''
            imgs = ''
            key2 = ''
            name22 = ''
            name2 = ''
            handless = ''
            msgg = ''
            imgs  = db.GqlQuery("select * from Profile_Images WHERE name =:1", profile_id)
            imgs2  = db.GqlQuery("select * from Profile_Images WHERE name =:1", current_user)
            team_name  = db.GqlQuery("select * from Teams WHERE name =:1", profile_id)
            team_images  = db.GqlQuery("select * from Teamimg WHERE user =:1", profile_id)
            team_images2  = db.GqlQuery("select * from Teamimg WHERE user =:1", current_user)
            friends  = db.GqlQuery("select * from Friends WHERE name =:1 order by added_date desc limit 10", profile_id)
            posts = db.GqlQuery("select * from Profile_Comments WHERE name_of_profile =:1 order by date_created desc", profile_id)
            name2 = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            month = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            day = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            year = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            country = db.GqlQuery("select * from User WHERE name =:1", profile_id)
            handle  = db.GqlQuery("select * from Handle WHERE name =:1", profile_id)
            for handles in handle:
                handless = handles.handle_name
            for months in month:
                monthss = months.month
            for countrys in country:
                countryss = countrys.country
            for days in day:
                dayss = days.day
            for years in year:
                yearss = years.year
            for clan in team_name:
                    name1 = clan.team_name_anycase
            for clan in team_name:
                    name2 = clan.team_name
            for image in team_images:
                team_imagee = image.key()
            for image2 in team_images2:
                team_imagee2 = image2.key()
            for img in imgs:
                key = img.key()
            for img2 in imgs2:
                key2 = img2.key()
            profile_submit_comment=''
            post_check = self.request.get('profile_submit_comment')
            if self.request.get('delete'):
                the_post = self.request.get('delete')
                q = Profile_Comments.get_by_id(int(the_post), parent=None)
                db.delete(q)
                error = "Comment successfully deleted."
                self.render('profile.html', handle_var = handless, team_name2 = name2, error = error, imgs = imgs, team_img2 = team_imagee2, profile_image_posted = key2, posts = posts, profile_id = profile_id, country_var = countryss, day_var = dayss, year_var = yearss, month_var = monthss, current_user = current_user, friends = friends, team_img = team_imagee, team_name = name1, profile_image = key, username = self.user.name, email = self.user.email, firstname = self.user.first_name, last_name = self.user.last_name, country = self.user.country)
#            if self.request.get('edit'):
#                the_post = self.request.get('edit')
#                q = Profile_Comments.get_by_id(int(the_post), parent=None)
#                db.delete(q)
#                self.redirect('/profile/%s' %profile_id)
            elif not post_check:
                error = "You cannot submit empty posts."
                self.render('profile.html', team_name2 = name2, error = error, imgs = imgs, team_img2 = team_imagee2, profile_image_posted = key2, posts = posts, profile_id = profile_id, country_var = countryss, day_var = dayss, year_var = yearss, month_var = monthss, current_user = current_user, friends = friends, team_img = team_imagee, team_name = name1, profile_image = key, username = self.user.name, email = self.user.email, firstname = self.user.first_name, last_name = self.user.last_name, country = self.user.country)
            elif self.request.get("profile_submit_comment") != '':
                profile_comments = Profile_Comments (name_of_submitted = self.user.name, name_of_profile = profile_id)
                commentupl = self.request.get("profile_submit_comment")
                profile_comments.post = (commentupl)
                profile_comments.put()
                self.redirect('/profile/%s' %profile_id)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:27:10+00:00Added an answer on June 11, 2026 at 12:27 am

    One of the main reasons why ‘Infinite Scrolling’ is used is to reduce the amount of data the needs to be sent initially when a page is loaded. I may be wrong but it looks like you have a single Gqlquery that loads all of a users posts. This doesn’t really make much sense with the infinite scroll concept. If all of the posts are queried when the page is loaded there would be minimal, if any, benefit from not displaying them all initially.

    Anyways, I would consider using a jQuery plugin such as Infinite Scroll for this. Here’s the basic concept.

    First load the page and print whatever has been returned from the GqlQuery.

    <html>
      <div id="posts">
        <div>post 1</div>
        <div>post 2</div>
        <div>post 3</div>
      </div>
    </html>
    

    Next use javascript to select the <div id="posts"> element.

    Then, load another set of posts (page 2) into an off-DOM <div>.

    Finally, when someone has reached the bottom of the page, append the <div id="posts"> element that you selected with the next set of posts (insert them below the final post in the <div id="posts"> element).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know the first part of this question has been asked before , but
This question is like another , except that one is asked in the context
Ok, first I want to state that this is Google App Engine via Python.
First I want to clearify that I mean by reverse engineering something like decompiling
First thing i want to say that it's not an easy question to explain,
This question has been asked many times before, but they all seem to relate
First of all I want to state that I've just started with Drupal so
Let me first state that I know next to nothing about LDAP and this
Before I dive into the question. Let me state that by Event Loop I
First I want to apologize for such a silly question but I'm quite new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.