B
B
Boldy2014-12-16 14:33:29
Django
Boldy, 2014-12-16 14:33:29

How to send date to view in django?

There is a view:

@login_required
def bonuses(request):
    template = 'incomes.html'
    context = {'user': request.user, }
    return render_to_response(template, context_instance=RequestContext(request, context))

and template:
{% for bonus in user.treenode.bonuses.all %}
    <tr class="entry{% if not bonus.paid %} fresh{% endif %}">
        <td class="date"><p>{{ bonus.use_date }}</p></td>
        <td class="total"><p>{{ bonus.total }}</p></td>
        <td class="newbie"><p>{{ bonus.newbie }}</p></td>
        <td class="line"><p>{{ bonus.line }}</p></td>
    </tr>
{% endfor %}

How to add selections to html bounds? I want to have something like filter the results from ___ to ___ |select| (Some kind of interactive calendar is desirable so that you do not have to manually enter the date). Then, as I understand it, both of these dates should be passed to request and processed in the view, there are no problems with this. It is only necessary to ensure that the date is delivered before bonuses(request). Thanks to.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2014-12-16
@Boldy

Through the form.
https://docs.djangoproject.com/en/dev/ref/forms/fi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question