
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
django-cascading-dropdown-widget
Advanced tools
Provide a cascading-dropdown widget for django.
pip install django-cascading-dropdown-widget
pro/settings.py
Note:
INSTALLED_APPS = [
...
'django_cascading_dropdown_widget',
...
]
app/admin.py
Note:
from django.contrib import admin
from django_cascading_dropdown_widget.widgets import DjangoCascadingDropdownWidget
from django_cascading_dropdown_widget.widgets import CascadingModelchoices
from django import forms
from .models import Category
from .models import Book
from .models import Character
class CharacterForm(forms.ModelForm):
class Meta:
model = Category
exclude = []
widgets = {
"book": DjangoCascadingDropdownWidget(choices=CascadingModelchoices({
"model": Category,
"related_name": "books",
},{
"model": Book,
"fk_name": "category",
})),
}
class CharacterAdmin(admin.ModelAdmin):
form = CharacterForm
list_display = ["name", "book"]
class CascadingModelchoices(object):
def __init__(self, *cascadings):
...
The parameters for CascadingModelchoices generator are the CASCADING-MODEL-SETTINGS(name it cascadings for short). A MODEL-SETTING(name it cascading for short)'s config items are:
class SimpleChoices(object):
def __init__(self, *cascadings, empty1="-"*10, empty2="-"*10):
...
Use CascadingModelchoices for the generator.
Create indented_title function for the MPTTModel. You use whatever name for the indented_title.
class MyModel(MPTTModel):
def indented_title(self):
return ("-"*4) * self.get_level() + self.name
Setting "str": "indented_title" in cascading.
The application django-cascading-dropdown-widget is NOT required django-mptt, so install django-mptt by youself. We have did try...except... with django-mptt's missing.
$(document).on("change", ".django-cascading-dropdown-widget-select", function(){...}) instead of arrive monitor. So now we do NOT depends on django-static-arrive.white-space: nowrap; for django-cascading-dropdown-widget.FAQs
Provide a cascading-dropdown widget for django.
We found that django-cascading-dropdown-widget 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.