Beispiel #1
0
def upload(request):
    sheet = request.FILES['sheet']
    _, xtn = sheet.name.rsplit(".", 1)
    jurisdiction = Jurisdiction.objects.get(id=request.POST['jurisdiction'])

    transaction = import_stream(
        sheet.read(),
        xtn,
        request.user,
        jurisdiction,
    )

    return render_to_response("ssu/public/upload.html", {
        "transaction": transaction,
    })
Beispiel #2
0
def istream(test, xtn, stream, jurisdiction):
    for el in import_stream(stream, xtn, None, jurisdiction):
        if isinstance(el, test):
            yield el
Beispiel #3
0
def istream(test, xtn, stream, jurisdiction):
    for el in import_stream(stream, xtn, None, jurisdiction):
        if isinstance(el, test):
            yield el