Skip to content

Instantly share code, notes, and snippets.

View maxwellcc's full-sized avatar
💭
Segue os meus 5 centavos de contribuição

Maxwell Anderson maxwellcc

💭
Segue os meus 5 centavos de contribuição
View GitHub Profile
@stemsmit
stemsmit / ha-uninstall.sh
Last active September 16, 2024 22:10
Uninstaller for Home Assistant Supervised on Debian 10
#!/usr/bin/env bash
sudo systemctl disable apparmor
sudo systemctl disable hassio-apparmor.service
sudo systemctl disable hassio-supervisor.service
sudo systemctl daemon-reload
sudo systemctl reset-failed
sudo rm /etc/systemd/system/hassio-supervisor.service
sudo rm /etc/systemd/system/hassio-apparmor.service
@rafen
rafen / README.md
Last active January 28, 2024 10:32
Django ExtendedActionsMixin allows ModelAdmin classes to execute actions with empty queryset and filtered queryset

ExtendedActionsMixin

This is a Django mixin that allows ModelAdmin classes to execute actions without selecting any objects on the change list of the Django Admin.

To implement it you need to include the Mixin as usual (see https://docs.djangoproject.com/en/1.10/topics/class-based-views/mixins/) and define a class attribute called extended_actions containing a list of string with the name of the actions that you want to be exectued with empty queryset.

If in the action you want to use the same queryset that the user is seeing, you can use the get_filtered_queryset method also provided by the mixin