Skip to main content

Dropzone.js bindings for Lona

Project description

lona-dropzone

license MIT Python Version Latest Version

Dropzone.js bindings for Lona

Installation

lona-dropzone can be installed using pip

pip install lona lona-dropzone

Usage

lona-dropzone uses Lonas Bucket API. lona_dropzone.Dropzone accepts all arguments of a Lona Bucket to create a new Bucket on the fly. You can also use a previously created Bucket using the keyword bucket.

from lona.html import HTML, H1
from lona import View

from lona_dropzone import Dropzone


class DropzoneView(View):
    def handle_request(self, request):
        self.dropzone = Dropzone(
            request=request,
            on_add=self.on_add,
            on_delete=self.on_delete,
        )

        return HTML(
            H1('Dropzone'),
            self.dropzone,
        )

    def on_add(self, file_names):
        print(f'{file_names} added to {self.dropzone.bucket.get_path()}')

    def on_delete(self, file_names):
        print(f'{file_names} deleted from {self.dropzone.bucket.get_path()}')

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lona-dropzone-0.1.tar.gz (201.1 kB view hashes)

Uploaded Source

Built Distribution

lona_dropzone-0.1-py3-none-any.whl (210.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page