Skip to content

Instantly share code, notes, and snippets.

@Vigrond
Vigrond / listlinksmixin.py
Last active May 18, 2020 18:13
A Django 2.2 Admin Mixin that supports foreign key relationship links with list_links attribute
from django.urls import reverse
from django.utils.html import format_html
class ListLinksMixin(object):
"""
Support for list_links attribute. Items in list_links must also be in list_display
Usage to make 'fieldTwo' a link:
list_display = ('fieldOne', 'fieldTwo',)
list_links = ('fieldTwo',)
@dmuth
dmuth / s3-undelete.sh
Created December 11, 2016 21:40
Script to undelete files from Amazon S3
#!/bin/bash
#
# This script can be used to undelete objects from an S3 bucket.
# When run, it will print out a list of AWS commands to undelete files, which you
# can then pipe into Bash.
#
# e.g.: s3-undelete.sh <options> > files.txt; cat files.txt | bash
#
# You will need the AWS CLI tool from https://aws.amazon.com/cli/ in order to run this script.
#