Sunday, March 30, 2014

Django python checkbox


i wan to do download file of a checkbox ;
Please help me

this is my viewspy:

def export_selected_dataqq(request):
    if request.method == 'POST':
        _selected_action = request.FILES("_selected_action")
    response = HttpResponse(mimetype='application/; charset="Shift_JIS"')
    response['Content-Disposition'] = 'attachment; filename=file.csv'
    writer = csv.writer(response)
    _selected_action = []
    for obj in _selected_action:
        for field in User._meta.fields:
    return response

this is mmy html:

<table >
{% if articles.count > 0 %}
{% for user in articles %}
        <td ><input class="action-select" name="_selected_action" id ="_selected_action" type="checkbox" value="{{ }}" type="submit" class="button"></td>
        <td ><a href="/articles/get/{{ }}/">{{ user.user_name  }}</a></td>
        <td >{{ }}</td>
        <td >{{ user.number }}</td>
{% endfor %}

{% else %}
{% endif %}

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
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment