semvec/pypi-packages huggingface dataset:
tvm-book 0.0.6
TVM Book
Requires Python: >=3.8

# TVM 手册

[![PyPI][pypi-badge]][pypi-link]
[![GitHub issues][issue-badge]][issue-link]
[![GitHub forks][fork-badge]][fork-link]
[![GitHub stars][star-badge]][star-link]
[![GitHub license][license-badge]][license-link]
[![contributors][contributor-badge]][contributor-link]
[![watcher][watcher-badge]][watcher-link]
[![Binder][binder-badge]][binder-link]
[![Downloads][download-badge]][download-link]
[![Documentation Status][status-badge]][status-link]
[![PyPI - Downloads][install-badge]][install-link]
![repo size](https://img.shields.io/github/repo-size/xinetzone/tvm-book.svg)
[![Downloads Week](https://pepy.tech/badge/tvm-book/week)](https://pepy.tech/project/tvm-book)
[![Documentation Status][rtd-badge]][rtd-link]

[pypi-badge]: https://img.shields.io/pypi/v/tvm-book.svg
[pypi-link]: https://pypi.org/project/tvm-book/
[issue-badge]: https://img.shields.io/github/issues/xinetzone/tvm-book
[issue-link]: https://github.com/xinetzone/tvm-book/issues
[fork-badge]: https://img.shields.io/github/forks/xinetzone/tvm-book
[fork-link]: https://github.com/xinetzone/tvm-book/network
[star-badge]: https://img.shields.io/github/stars/xinetzone/tvm-book
[star-link]: https://github.com/xinetzone/tvm-book/stargazers
[license-badge]: https://img.shields.io/github/license/xinetzone/tvm-book
[license-link]: https://github.com/xinetzone/tvm-book/LICENSE
[contributor-badge]: https://img.shields.io/github/contributors/xinetzone/tvm-book
[contributor-link]: https://github.com/xinetzone/tvm-book/contributors
[watcher-badge]: https://img.shields.io/github/watchers/xinetzone/tvm-book
[watcher-link]: https://github.com/xinetzone/tvm-book/watchers
[binder-badge]: https://mybinder.org/badge_logo.svg
[binder-link]: https://mybinder.org/v2/gh/xinetzone/tvm-book/main
[install-badge]: https://img.shields.io/pypi/dw/tvm-book?label=pypi%20installs
[install-link]: https://pypistats.org/packages/tvm-book
[status-badge]: https://readthedocs.org/projects/tvm-book/badge/?version=latest
[status-link]: https://tvm-book.readthedocs.io/zh/latest/?badge=latest
[download-badge]: https://pepy.tech/badge/tvm-book
[download-link]: https://pepy.tech/project/tvm-book
[rtd-badge]: https://readthedocs.org/projects/tvm-book/badge/?version=latest
[rtd-link]: https://tvm-book.readthedocs.io/zh/latest/?badge=latest

打造优质的 TVM 中文社区。
django-selectize 2.0
django-selectize is a Django app based on Selectize.js that help you to create Select and Multiselect widgets in Django forms.
Requires Python: >=3.6

## Django Selectize

django-selectize  is a Django app based on Selectize.js that help you to create Select and Multiselect widgets in Django forms.

## Installation

Install `django-selectize`:

    pip install django-selectize



Add `django-selectize` to your `INSTALLED_APPS` in your project settings.

    INSTALLED_APPS = [
        # other django apps...
        'django_selectize',
    ]

## Quick Start

Here is a quick example to get you started:

We have the following model:

    # models.py
    from django.conf import settings
    from django.db import models

    class Book(models.Model):
        author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
        co_authors = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name='co_authored_by')


Next, we create a model form with custom Selectize widgets.

	# forms.py
	from django import forms
	from django_selectize import forms as s2forms

	from . import models

	class AuthorWidget(s2forms.SelectizeWidget):
		search_fields = [
			"username__icontains",
			"email__icontains",
		]

	class CoAuthorsWidget(s2forms.SelectizeMultipleWidget):
		search_fields = [
			"username__icontains",
			"email__icontains",
		]

	class BookForm(forms.ModelForm):
		class Meta:
			model = models.Book
			fields = "__all__"
			widgets = {
				"author": AuthorWidget,
				"co_authors": CoAuthorsWidget,
			}


A simple class based view will do, to render your form:

    # views.py
    from django.views import generic

    from . import forms, models

    class BookCreateView(generic.CreateView):
        model = models.Book
        form_class = forms.BookForm
        success_url = "/"

Make sure to add the view to your `urls.py`:

    # urls.py
    from django.urls import include, path
    from . import views

    urlpatterns = [
        # ... other patterns
        path("", views.BookCreateView.as_view(), name="book-create"),
    ]


Finally, we need a little template, `myapp/templates/myapp/book_form.html`

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title>Create Book</title>
        {{ form.media.css }}
        <style>
            input, select {width: 100%}
        </style>
    </head>
    <body>
        <h1>Create a new Book</h1>
        <form method="POST">
            {% csrf_token %}
            {{ form.as_p }}
            <input type="submit">
        </form>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
        {{ form.media.js }}
    </body>
    </html>