Skip to main content

a package on top of flask-assets

Project description

flask-topassets

a package on top of flask-assets for plugin

installation

pip install flask_topassets

usage

# e.g. in flask-tomselect

from flask_topassets import TopAssets

# used in flask-tabler import
CLASS_NAME = "TomSelect"

class TomSelect(TopAssets):
    def __init__(self, app=None) -> None:
        if app:
            self.init_app(app)

    def init_app(self, app) -> None:
        self.prepare(app, "tomselect")
        self.bundle_js("tom-select.complete.min.js")
        self.bundle_css("tom-select.tabler.min.css")


# in templates head
{{ tomselect.get_path("css") }}
# output is:
# <link rel="stylesheet" href="/tomselect/select/tom-select.tabler.min.css" />

# for javascript
{{ tomselect.get_path("js") }}
# output is:
# <script type="text/javascript" src="/tomselect/select/tom-select.complete.min.js"></script>

{% from "tomselect/helpers.html" import js_tomselect %}

<div class="mb-3">
  <div class="form-label">Select</div>
  <select class="form-select" id="demo" name="demo">
    <option value="1">One</option>
    <option value="2">Two</option>
    <option value="3">Three</option>
  </select>
</div>
{{ js_tomselect("demo", plugins=["remove_button", "clear_button"]) }}

Project details


Download files

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

Source Distribution

flask_topassets-0.1.0.20250915.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_topassets-0.1.0.20250915-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file flask_topassets-0.1.0.20250915.tar.gz.

File metadata

  • Download URL: flask_topassets-0.1.0.20250915.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for flask_topassets-0.1.0.20250915.tar.gz
Algorithm Hash digest
SHA256 5d1fa45967825f62c5dd98fff598e9829eb8b0e29bc7f3091619864ff3dba32b
MD5 8e0470016644a2345eefc5d2fce699a9
BLAKE2b-256 c0618071ee53ec4c9e8b64a1c15f5a64171611cd08dcbd53d46358742bbc7b5c

See more details on using hashes here.

File details

Details for the file flask_topassets-0.1.0.20250915-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_topassets-0.1.0.20250915-py3-none-any.whl
Algorithm Hash digest
SHA256 e1781ac9278d32cbdff4af4656113fc7dbe26272502c90ff941b17e16738557e
MD5 ecc3f62fc7b8d355f6eeb062c91dfac4
BLAKE2b-256 9c7a223adcfb024a133a5aa00e570c6f76f2d442ea8a2dd383562ce4d904ccf3

See more details on using hashes here.

Supported by

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