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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:53:50+00:00 2026-06-07T01:53:50+00:00

Within my model I have defined a required field class like this: class Contact(models.Model):

  • 0

Within my model I have defined a required field class like this:

class Contact(models.Model):
    last_name = models.CharField(_(u"Last Name"), max_length=50)

For the form I am simply using the ModelForm to keep it simple:

class ContactsForm(ModelForm):
   class Meta:
        model = Contact

I understand there are third-party-mods helping with rendering forms, however going plain for now to see when I hit the limitations, so I tried this:

            <tr>
                <td>
                    {{form.last_name.label}}:
                </td>
                <td>
                    {{form.last_name}}
                    {% if  form.last_name.required %}(*){% endif %}
                </td>
            </tr>

Surprisingly I don’t get to see the (*) even though its a required field.

What am I missing?

  • 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-07T01:53:52+00:00Added an answer on June 7, 2026 at 1:53 am

    I can’t test this now, but I’m pretty sure you need form.last_name.field.required – form.last_name is an instance of BoundField, and it has a field property which points to the original CharField, which in turn contains the required property.

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

Sidebar

Related Questions

I have a basic model: class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) state
I have a simple model that is defined as: class Article(models.Model): slug = models.SlugField(max_length=50,
I have a business model with many classes in, some logical entities within this
I have defined a model within it I have default model schema. I have
I have a fetch request defined within my core data model called RemainingGaneProjections. I
I have an object model like that: Folder - simple structure with name etc.
I am trying to expand the relationships within my Django Models. I have a
How can I get at the Labels data from within my Task model? class
Are models available within the modules. Can I access constants stored in a model
I am using asp.net mvc 2.0(default binding model) and I have this problem. I

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.