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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:32:42+00:00 2026-06-15T00:32:42+00:00

Can anyone help me with this issues. Help is very much appreciated. Thanks. Here

  • 0

Can anyone help me with this issues. Help is very much appreciated. Thanks.

Here is my program

template.html

<tbody>
{% for condition in conditioner %}
{{ condition.owner }}
{% with "#CCE6FF" as bgcolor %} 
<tr>
    <td style="height: 30">{{ condition.NEW_DATE }}</td>
    <td>
        <select class="SMOKER select_input" name="condition">
            <option value="{{condition.SMOKER.01}}" >Never</option>
            <option value="{{condition.SMOKER.02}}" >Ex-Smoker</option>
        </select>
    <td><input type="text" name="condition" id="condition{{ forloop.counter }}" value="{{ condition.WEIGHT }}" /></td>
    <td><input type="text" name="condition" id="condition{{ forloop.counter }}" value="{{ condition.HEIGHT }}" /></td>
    <td><input type="text" name="condition" id="condition{{ forloop.counter }}" value="{{ condition.BP }}" /></td>
</tr>
----more program---

models.py

class Condition(models.Model):
owner = models.ForeignKey(Afdeling)
CPR = models.ForeignKey(Patient)
NEW_DATE = models.DateField(null = True, blank = True)

smoker = (("01" , 'Never'),
         ("02" , 'Ex-Smoker'),

SMOKER      = models.CharField(max_length = 2, choices = smoker, null = True, blank = True)    

WEIGHT      = models.DecimalField(max_digits = 5, decimal_places = 1, null = True, blank = True)

HEIGHT      = models.DecimalField(max_digits = 5, decimal_places = 1, null = True, blank = True)

BP = models.SmallIntegerField(max_length = 3, null = True, blank = True)
----more models.py---

Condition output

It shows the table and selected option but it’s not showing the correct data.

In my database 19 okt should be Ex-Smoker but here it shown Never to all of the column.

The html for the table are:

<select class="SMOKER select_input" name="condition">
<option value="2" >Never</option>
<option value >Ex-Smoker</option>
</select>

I hope my explanation is understandable and if anyone need more clarification I will try my best to explain. I really need help on this. Thank you very much.

  • 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-15T00:32:44+00:00Added an answer on June 15, 2026 at 12:32 am

    I admit that I don’t fully understand, for example what you’re trying to do with {{condition.SMOKER.01}}, it looks like you would rather want to do {{ condition.smoker.0.0 }} and {{ condition.smoker.1.0 }} which would respectively output 01 and 02, like in python condition.smoker[0][0] and condition.smoker[0][1].

    Anyway, about this:

    In my database 19 okt should be Ex-Smoker but here it shown Never to all of the column.

    It is simply because you never set a option with selected="selected". Maybe it should look like this:

        <select class="SMOKER select_input" name="condition">
            <option value="{{condition.smoker.0.0}}" {% if condition.SMOKER == condition.smoker.0.0 %}selected="selected"{% endif %}>Never</option>
            <option value="{{condition.smoker.1.0}}" {% if condition.SMOKER == condition.smoker.1.0 %}selected="selected"{% endif %}>Ex-Smoker</option>
        </select>
    

    Hope this helps. But as I said, it is hard to understand what you are trying to do and the fact that you have deliberately broken common standards doesn’t help: using caps for property names and lower case for pseudo-constants is the opposite of what we use to do – and what you can see in django documentation which would look like:

    class Condition(models.Model):
        SMOKER_CHOICES = (
            ("01" , 'Never'),
            ("02" , 'Ex-Smoker'),
        )
        smoker = models.CharField(max_length=2, choices=SMOKER_CHOICES)
        # etc ....
    

    So maybe you’re just confused by your own makings ?

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

Sidebar

Related Questions

can anyone help me with this issue? i tried it but the frame of
Can anyone help - this is driving me mad. I am calling a mysql
Can anyone help with this... vector<unsigned int> *vVec = new vector<unsigned int>; vVec .reserve(frankReservedSpace);
Can anyone help convert this this actionscript to Objective-c? if(mcMain.y >= stage.stageHeight - mcMain.height)
Can anyone help in this php page navigation script switch on counting normal serial
Can anyone help me with this error? alt text http://abbeylegal.com/downloads/parsererror.jpg full image here It
Can anyone help me to do this in the right way?I mean.. like that
Can anyone help me getting started with this? We have a current keygen for
Can anyone help me with reversing this PHP page navigation? Current script setting shows
Can anyone help me spot the problem on this PLEASE? I'm eternally grateful for

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.