Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Django action with an intermediate page to parse data from a form
You can install the package via pip:
pip install django-form-action
Example usage showing an action in UserAdmin which has an intermediate form that parses data on how to perform that action.
from typing import Any
from django.contrib import admin
from django.contrib import messages
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.db.models import QuerySet
from django.forms import CharField
from django.forms import Form
from django.http import HttpRequest
from django_form_action import form_action
admin.site.unregister(User)
class ChangeFirstName(Form):
first_name = CharField()
@form_action(ChangeFirstName, "Change selected users' first name")
def change_first_name(
modeladmin: Any,
request: HttpRequest,
queryset: QuerySet[User],
form: ChangeFirstName,
):
queryset.update(first_name=form.cleaned_data["first_name"])
messages.add_message(
request,
messages.INFO,
"Successfully changed the first name of selected users.",
)
@admin.register(User)
class CustomUserAdmin(UserAdmin):
actions = [change_first_name]
This project is licensed under the terms of the MIT license.
FAQs
Django action with an intermediate page to parse data from a form
We found that django-form-action demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.