Using fixed data_value instead of adding 256 to its value

This commit is contained in:
Felipe Martín 2013-05-29 18:02:44 +02:00
parent 680de44cdf
commit 45f37ecf2a
3 changed files with 4 additions and 4 deletions

View File

@ -7,13 +7,13 @@
{% for item in page.object_list %} {% for item in page.object_list %}
<div class="span3"> <div class="span3">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a href="{{ url('items_detail', item.data_value + 256) }}"> <a href="{{ url('items_detail', item.data_value) }}">
{% else %} {% else %}
<a href="#"> <a href="#">
{% endif %} {% endif %}
<div class="well"> <div class="well">
<div class="pull-right text-right"> <div class="pull-right text-right">
<span class="badge">{{ item.data_value + 256 }}</span> <span class="badge">{{ item.data_value }}</span>
<h5 class="text-black">{{ item.name() }}</h5> <h5 class="text-black">{{ item.name() }}</h5>
</div> </div>
<div class="codexicon x4 margin-auto pull-left"> <div class="codexicon x4 margin-auto pull-left">

View File

@ -18,7 +18,7 @@
{% endif %} {% endif %}
</div> </div>
<ul> <ul>
<li>Data value: {{ item.data_value + 256 }}</li> <li>Data value: {{ item.data_value }}</li>
</li> </li>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>

View File

@ -73,7 +73,7 @@ def items(request):
def items_detail(request, data_value): def items_detail(request, data_value):
section = 'items' section = 'items'
if request.user.is_authenticated(): if request.user.is_authenticated():
item = Item.objects.get(data_value=int(data_value)-256) item = Item.objects.get(data_value=int(data_value))
data = { data = {
'section': section, 'section': section,
'item': item 'item': item