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

  • Home
  • SEARCH
  • 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 187477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:49:49+00:00 2026-05-11T15:49:49+00:00

This is using Google App Engine. I am not sure if this is applicable

  • 0

This is using Google App Engine. I am not sure if this is applicable to just normal Django development or if Google App Engine will play a part. If it does, would you let me know so I can update the description of this problem.

class MessageModel(db.Model):     to_user_id = db.IntegerProperty()     to_user = db.StringProperty(multiline=False)     message = db.StringProperty(multiline=False)     date_created = db.DateTimeProperty(auto_now_add=True) 

Now when I do a query a get a list of ‘MessageModel’ and send it to the template.html to bind against, I would like to include a few more properties such as the ‘since_date_created’ to output how long ago since the last output, potentially play around with the message property and add other parameters that will help with the layout such as ‘highlight’ , ‘background-color’ etc…

The only way I thought of is to loop through the initial Query Object and create a new list where I would add the property values and then append it back to a list.

    for msg in messagesSQL:     msg.lalaland = 'test'             msg.since_created_time = 321932             msglist.append(msg) 

Then instead of passing the template.html messagesSQL, I will now pass it msglist.

  • 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. 2026-05-11T15:49:50+00:00Added an answer on May 11, 2026 at 3:49 pm

    You should still be able to send it messagesSQL to the template after you’ve added elements to it via the for loop. Python allows that sort of thing.

    Something else that might make sense in some cases would be to give your MessageModel methods. For instance, if you have a

    def since_date_created(self):     '''Compute the time since creation time based on self.date_created.''' 

    Then (assuming you have ‘messagesSQL’ in the template), you can use the function as

    {% for msg in messagesSQL %}     {{ msg.since_date_created }} {% endfor %} 

    Basically, you can call any method in the model as long as you it needs no arguments passed to it.

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

Sidebar

Ask A Question

Stats

  • Questions 167k
  • Answers 167k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There's no overhead. It's just a static method called with… May 12, 2026 at 1:27 pm
  • Editorial Team
    Editorial Team added an answer If you are trying to play recorded MP4 then it… May 12, 2026 at 1:27 pm
  • Editorial Team
    Editorial Team added an answer you cannot implicitely know. if your intranet urls look like… May 12, 2026 at 1:27 pm

Related Questions

I am having a issue using Google's SDC (Secure Data Connector) with my Google
One can easily use JDO syntax to query on multiple parameters as follows: //specify
I am trying to get my Django app (NOT using Google app engine) retrieve
I am developing an application on the Google App Engine using Python. I have

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.