Skip to content

Instantly share code, notes, and snippets.

@flebel
flebel / admin.py
Last active June 27, 2023 09:14 — forked from dokterbob/admin.py
(Django2.0/Py3.6) InlineAdmin mixin limiting the selection of related items according to criteria which can depend on the current parent object being edited.
class LimitedAdminInlineMixin(object):
"""
InlineAdmin mixin limiting the selection of related items according to
criteria which can depend on the current parent object being edited.
A typical use case would be selecting a subset of related items from
other inlines, ie. images, to have some relation to other inlines.
Use as follows::
@flebel
flebel / sphinx.rb
Last active March 8, 2016 19:38 — forked from kmullin/sphinx.rb
sphinx.rb
require 'formula'
class Sphinx < Formula
url 'http://sphinxsearch.com/files/sphinx-2.2.10-release.tar.gz'
homepage 'http://www.sphinxsearch.com'
sha256 '054cb86e64bd48997d89386e1224d4405063d9857b2d7c33dc6cc1b9ef6df440'
depends_on 'mysql'
def install