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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:51:46+00:00 2026-05-13T17:51:46+00:00

I have django objects: class Event(models.Model): title = models.CharField(max_length=255) event_start_date = models.DateField(null=True, blank=’true’) …

  • 0

I have django objects:

class Event(models.Model):
   title = models.CharField(max_length=255)
   event_start_date = models.DateField(null=True, blank='true')
   ...

class RegistrationDate(models.Model):
    event = models.ForeignKey(tblEvents)
    date_type = models.CharField(max_length=10, choices=registration_date_type)
    start_date = models.DateField(blank='true', null='true')
    end_date = models.DateField(blank='true', null='true') 

An Event can have early, normal, and late registration periods.

I wrote a function that takes in an event and returns one of: None, “Early”, “Normal”, or “Late”

All that works great.

In my app, I want to display a list of events and where their registration status is. So I did a query as such.

Events = tblEvents.objects.all()

So I have all of the info about the event, but not the status.

What is the easiest/best way to get the status for each event displayed in the template.

I figure that I can write a template tag, but that seems like more work then should be necessary.

  • 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-05-13T17:51:47+00:00Added an answer on May 13, 2026 at 5:51 pm

    Add a property to your Event class e.g.:

    class Event:
      # stuff here
    
      @property
      def status(self):
         # do the same thing here as in your status function
         return status
    

    The you can do in your template:

    {{ event.status }}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 300k
  • Answers 300k
  • 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 A better way is to get rid of the cause… May 13, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer The C# compiler is fully unicode aware - what problems… May 13, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer The math.ceil (ceiling) function returns the smallest integer higher or… May 13, 2026 at 7:59 pm

Related Questions

I've got models like this: class PledgeItem(models.Model): title = models.CharField(...) usd_amount = models.DecimalField(...) class
Good Morning All, I've been a PHP programmer for quite some time, but I've
This question is related to (but perhaps not quite the same as): Does Django
So far, I've had great success using PyAMF to communicate between my Flex front-end
If you came here from Google looking for model to dict, skip my question,

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.