ok this is view.

def junior_pending_impacts(request, pk=None):
    queryset_list = IgcNew.objects.all()
    count_new = IgcNew.objects.filter(IGC_Status__contains='New').count()
    # log.warning('%s' % count_new)
    noregistro = overall_impact.objects.all()
    # log.warning('%s' % overall_impact.igc_master)
    
    if overall_impact.igc_master == IgcNew.pk:
        valor = overall_impact.igc_master
        log.warning('%s' % valor)

    context = {
        "title": "Pending Impacts.",
        "count": count_new,
        "object_list": queryset_list,
        "overall": noregistro,
    }
    return render(request, "junior_pending_impacts.html", context)    

this is template.

    {% for obj in object_list %}
    <script>
          var myVar = setInterval(myTimer, 1000);
          
          function myTimer() {
              var d = new Date();
              document.getElementById("demo").innerHTML = 
d.toLocaleTimeString();
          }
      </script>
        {% if obj.IGC_Status == 'New' %}
<div class="panel panel-primary">
  <div class="panel-heading">
    <p><img src="{% static 'img/logo-ea-sof.png' %}" style="float: left;" 
/><h4 align="right" style="color: white; font-family: consolas; float: 
right;">IGC ID: <a style="color: black; font-family: consolas;font-size: 
7;">{{ obj.pk }}</a></h4></p>
      <p><a align="left" style="color: white; font-family: consolas;">IGC 
Subject: </a><a align="left" style="color: black; font-family: 
consolas;font-size: medium;">{{ obj.subject|truncatechars:100 }}</a></p>
      <hr>
  </div>
  <div id="lesen" class="panel-body" style="overflow: auto; 
                background: #D8D8D8; 
                color: grey; 
                font-family: consolas, Candara; font-size: 12;">
    <strong>Summary: </strong>{{ obj.summary|truncatechars:100 }}</p>
    <strong>Impact: </strong>{% for over in overall %}{% ifequal 
over.igc_master obj.id %}TEST{{ over.igc_master }}{{ over.impact }}</p>{% 
endifequal %}{% endfor %}
    <strong>Pimary Contact(s): </strong>
    {% for over in overall %}

        {% with index=over.igc_master %}

            test {{ index }}
            {% if index == obj.pk %}    <!--here is the problem, because 
dont return nothing.-->
            mal {{ index }}
            {% else %}                
            OK {{ index }}
            {% endif %}

        {% endwith %}
        

        {% ifequal obj.pk over.igc_master %}
          Test Jaime Sanchez
          {{ over.primary_contacts }}
        {% endifequal %} 
    {% endfor %}</p>
    <strong>NOC Technician: </strong></p>
    <strong style="float: right;">Status: </strong></p>
    <strong style="float: right;">Remaining Time: </strong><p id="demo" 
style="float: right;"></p></p>
    <a href='{{ obj.get_absolute_url_detail }}' class="btn btn-primary" 
role="button">Preview</a>
  </div>
</div>        
    {% endif %}
    {% endfor %}

El jueves, 9 de junio de 2016, 11:33:24 (UTC-5), Ing. Jaime Sanchez 
escribió:
>
> Help please!!
>
> I need do like this
> in django 1.9 template tag 
>
> {% if model1.obj == model2.obj %}
> print ok
> {% else %}
> print not OK
> {% endif %}
>
> but don't work.
>
> someone help me??
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/08860d9d-beb2-483a-81c2-1c9bbccb8899%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to