Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
django-nested-inline
Advanced tools
Nested inline support for Django admin
Most of the code from this package is from https://code.djangoproject.com/ticket/9025
https://github.com/s-block/django-nested-inline
pip install django-nested-inline
Add nested_inline
to INSTALLED_APPS
# models.py
from django.db import models
class TopLevel(models.Model):
name = models.CharField(max_length=200)
class LevelOne(models.Model):
name = models.CharField(max_length=200)
level = models.ForeignKey('TopLevel')
class LevelTwo(models.Model):
name = models.CharField(max_length=200)
level = models.ForeignKey('LevelOne')
class LevelThree(models.Model):
name = models.CharField(max_length=200)
level = models.ForeignKey('LevelTwo')
# admin.py
from django.contrib import admin
from nested_inline.admin import NestedStackedInline, NestedModelAdmin
from example.models import *
class LevelThreeInline(NestedStackedInline):
model = LevelThree
extra = 1
fk_name = 'level'
class LevelTwoInline(NestedStackedInline):
model = LevelTwo
extra = 1
fk_name = 'level'
inlines = [LevelThreeInline]
class LevelOneInline(NestedStackedInline):
model = LevelOne
extra = 1
fk_name = 'level'
inlines = [LevelTwoInline]
class TopLevelAdmin(NestedModelAdmin):
model = TopLevel
inlines = [LevelOneInline]
admin.site.register(TopLevel, TopLevelAdmin)
Released versions of this library should have a minified version of the js.
Minification is done with uglifyjs. If npm is installed on your system, you can install uglifyjs with the command:
npm install -g uglify-js
Then change to the directory where the file 'inlines-nested.js' and run the following command:
uglifyjs --compress --mangle --output ./inlines-nested.min.js -- inlines-nested.js
Create a file at $HOME/.pypirc and put the following text inside:
[pypi]
username = __token__
password = <Token from pypi>
Make sure the dependencies for this project are installed:
pip install django
Then install the build tool:
pip install build
Next run the distribution build of the project:
python -m build
Lastly, push the release to pypi
twine upload dist/*
0.4.6:
0.4.5 - Support django 4.0 and django-csp
0.4.4 - Add formset:added and formset:removed events (#97)
0.4.3 - Update media so it expects to find jquery in the right place. (#75)
0.4.2 - Fix assets
0.4.1 - Fix permission checks
0.4.0 - Added support for Django 3.0
0.3.7 - added support for django 1.10, fix unique fieldset id
0.3.6 - added support for django 1.9
0.3.5 - Removed deprecated methods and updated for Django 1.8/1.9
0.3.4 - added licence and updated for python 3
0.3.3 - fixed bug where inlines without inlines would cause an error
FAQs
Recursive nesting of inline forms for Django Admin
We found that django-nested-inline demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.