Skip to main content

django-form-button

Django admin extra buttons with form

Screenshots

changelist

form

Installation

You can install the package via pip:

pip install django-form-button

Usage

from django.contrib import admin
from django.forms import FileField
from django.forms import Form
from django.http import HttpRequest
from django.http import HttpResponse

from django_form_button import FormButtonMixin
from django_form_button import form_button

from .models import Account


class UploadForm(Form):
    file = FileField()


@form_button("Upload Accounts", UploadForm)
def upload_accounts(request: HttpRequest, validated_form: Form):
    file = validated_form.cleaned_data["file"]
    return HttpResponse(file.name)


@admin.register(Account)
class AccountAdmin(FormButtonMixin, admin.ModelAdmin):  # type: ignore
    form_buttons = [upload_accounts]

License

This project is licensed under the terms of the MIT license.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Contact

If you want to contact me you can reach me at pradishbijukchhe@gmail.com.

Metadata

Release files for django-form-button 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-form-button 1.0.0
File Size Uploaded Provenance
django-form-button-1.0.0.tar.gz 4.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-form-button 1.0.0
File Interpreter ABI Platform
django_form_button-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / django-form-button-1.0.0.tar.gz

Download URL django-form-button-1.0.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d656135f401a4c9929c0515ccf469d258785dac7e9060f2f16f3d4118fd34903
BLAKE2b-256 checksum
How to use checksums
e5b393155640cd3fb2841f50238fa761e6e4f90a1b5fd7028ebf2112aee1f74f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / django_form_button-1.0.0-py3-none-any.whl

Download URL django_form_button-1.0.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd99f5d913c273dd194b01ae375771f34d20ea5a7a1c01d57543d8f9d0bca348
BLAKE2b-256 checksum
How to use checksums
9e151bf44fbf82a6e3fce517d87a786bcfac137ccc9c04f6f1fcf178ce2a0fb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for django-form-button 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page