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 8349683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:05:01+00:00 2026-06-09T08:05:01+00:00

I have this two classes: class Person(db.Model): person_name = db.StringProperty(required = True) #gender =

  • 0

I have this two classes:

class Person(db.Model):
    person_name = db.StringProperty(required = True)
    #gender = db.StringProperty(required = True)
    nacionality = db.StringProperty(required = True)
    marital_status = db.StringProperty(required = True)
    profession = db.StringProperty(required = True)
    SSN = db.IntegerProperty(required = True)
    driver_license = db.IntegerProperty(required = True)
    address = db.PostalAddressProperty(required = True)

class ContractingParty(db.Model):
    person = db.ReferenceProperty(Person, required=True, collection_name="party_to_contracts")
    contract = db.ReferenceProperty(Contract, required=True)
    condition = db.StringProperty()

I want to pass a query of ContractingParty entities to my jinja2 template. Then with a for loop, I want to acess the data I really want, from Person entities. The Contracting Party query is being passed to jinja2 (if I test it, I can see something like this: [<main.ContractingParty object at 0x0492D770>]). But the for loop bellow doesn’t working, no information of the for loop is being shown in my brownser. How could I fix it?

{% for party in parties %}
     <li> {{party.person.person_name}} </li>
{% endfor %}
  • 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-09T08:05:04+00:00Added an answer on June 9, 2026 at 8:05 am

    Seems like you’ve made a mistake in your for loop construct, colon character must be omitted:

    {% for party in parties %}
    

    The whole code must be changed to actually render objects passed to templates. You can’t execute Python code here, you must obey Jinja2 syntax:

    {% for party in parties %}
        <li>{{ party.person.profession}}</li>
        ...
    {% endfor %}
    

    If you want to make some assignment use set Jinja’s tag:

    {% set person = party.person %}
    

    I hope you’ve got the idea, here is a link with much more clarification

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

Sidebar

Related Questions

my code is like this: i have two classes first class: public class Box<E>
Supposed I have two classes like this: public class Parent { public string Id
I have this weird situation. I have these two classes: Public Class Entry End
I have two classes, Person and Company, derived from another class Contact. They are
I have two entity classes: Person and Position . public class Person { public
I have two classes: public class Person { public string FirstName { get {
I have a very simple object model with a base class Person and two
Let's say I have the following two classes: public class Person { public string
i have made two classes, which is person - the parent class and a
having this two classes I always have a doubt of which is the best

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.