
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.