- DEP: XXX
- Author: Tom Christie
- Implementation Team: Tom Christie
- Shepherd: Tim Graham
- Status: Draft
- Type: Enhancement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%YAML 1.2 | |
--- | |
# http://www.sublimetext.com/docs/3/syntax.html | |
name: Lean | |
file_extensions: | |
- lean | |
scope: source.lean | |
contexts: | |
main: | |
- include: comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example usage: | |
dj shell < wagtail_list_allowed_subpages.py | |
Returns markdown formatted list of which page types can be added under which. | |
""" | |
def list_valid_page_subpages(readable=False, shorten=False): | |
from wagtail.core.models import Page |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
# forked from egel/auto-remove-sublime-license-popup | |
# https://gist.github.com/egel/b7beba6f962110596660 | |
from commands import getoutput as cl | |
from threading import Event, Thread | |
from sublime_plugin import EventListener |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import ProgrammingError, models | |
from django.db.models.constants import LOOKUP_SEP | |
from django.db.models.query import normalize_prefetch_lookups | |
from rest_framework import serializers | |
from rest_framework.utils import model_meta | |
class OptimizeModelViewSetMetaclass(type): | |
""" | |
This metaclass optimizes the REST API view queryset using `prefetch_related` and `select_related` | |
if the `serializer_class` is an instance of `serializers.ModelSerializer`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from wagtail.wagtailimages.models import SourceImageIOError | |
from wagtail.wagtailimages.templatetags.wagtailimages_tags import ImageNode | |
register = template.Library() | |
@register.tag(name="responsiveimage") | |
def responsiveimage(parser, token): | |
bits = token.split_contents()[1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# django | |
from django import forms | |
from django.contrib.staticfiles.templatetags.staticfiles import static | |
from django.forms import Media, widgets | |
from django.utils.functional import cached_property | |
# wagtail | |
from wagtail.utils.widgets import WidgetWithScript | |
from wagtail.wagtailcore import blocks |
Moved here:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd somewhere | |
git clone https://github.com/[OWNER]/[REPO].git --branch [SPECIFIC BRANCH] --single-branch | |
cd [REPO] | |
python setup.py develop | |
# Usually, restart dev server to prevent it using already loaded site-packages modules. | |
# Hack away on code in [REPO], python will use this one rather than the one in site-packages. | |
# When done, to switch back: | |
python setup.py develop --uninstall | |
cd .. | |
rm -rf [REPO] |
NewerOlder