text
stringlengths
0
1.05M
meta
dict
from django import template from django.db.models import ObjectDoesNotExist register = template.Library() @register.simple_tag(takes_context=True) def get_contact_email(context): theme = get_theme(context) email = theme.content.contact_email if not email: try: defaults = context['req...
{ "repo_name": "OpenCanada/website", "path": "themes/templatetags/theme_tags.py", "copies": "1", "size": "1636", "license": "mit", "hash": 7992948806482151000, "line_mean": 27.701754386, "line_max": 112, "alpha_frac": 0.7121026895, "autogenerated": false, "ratio": 3.6764044943820227, "config_tes...
from django import template from django.db.models import Q, get_model from ..utils import get_page_model PageGroup = get_model('fancypages', 'PageGroup') FancyPage = get_page_model() register = template.Library() def build_tree(root, parent, data, depth): for instance in data[depth]: if not parent or...
{ "repo_name": "tangentlabs/django-fancypages", "path": "fancypages/templatetags/fp_sitemap_tags.py", "copies": "1", "size": "1972", "license": "bsd-3-clause", "hash": 3348815406749782000, "line_mean": 27.1714285714, "line_max": 76, "alpha_frac": 0.6526369168, "autogenerated": false, "ratio": 3.71...
from django import template from django.db.models import Q, get_model PageGroup = get_model('fancypages', 'PageGroup') FancyPage = get_model('fancypages', 'FancyPage') register = template.Library() def build_tree(root, parent, data, depth): for instance in data[depth]: if not parent or instance.is_chi...
{ "repo_name": "socradev/django-fancypages", "path": "fancypages/templatetags/fp_sitemap_tags.py", "copies": "1", "size": "1711", "license": "bsd-3-clause", "hash": 780253819329121300, "line_mean": 28, "line_max": 75, "alpha_frac": 0.6452367037, "autogenerated": false, "ratio": 3.727668845315904, ...
from django import template from django.db.models import Q from django.template.loader import render_to_string from threadedcomments.compat import BASE_APP, django_comments as comments from threadedcomments.util import annotate_tree_properties, fill_tree as real_fill_tree if BASE_APP == 'django.contrib.comments': ...
{ "repo_name": "SmithsonianEnterprises/django-threadedcomments", "path": "threadedcomments/templatetags/threadedcomments_tags.py", "copies": "1", "size": "14357", "license": "bsd-3-clause", "hash": 3528291418184783400, "line_mean": 34.0170731707, "line_max": 105, "alpha_frac": 0.5756077175, "autogen...
from django import template from django.db.models import Q from django.utils.html import format_html from spectator.core import app_settings from ..models import Publication, Reading from .. import utils register = template.Library() @register.simple_tag def annual_reading_counts(kind="all"): """ Returns a...
{ "repo_name": "philgyford/django-spectator", "path": "spectator/reading/templatetags/spectator_reading.py", "copies": "1", "size": "8975", "license": "mit", "hash": 5311948362704034000, "line_mean": 30.3531468531, "line_max": 85, "alpha_frac": 0.5674138508, "autogenerated": false, "ratio": 3.8534...
from django import template from django.db.models import Q from django.utils import timezone from announcements.models import Announcement register = template.Library() class AnnouncementsNode(template.Node): @classmethod def handle_token(cls, parser, token): bits = token.split_contents() i...
{ "repo_name": "percipient/django-announcements", "path": "announcements/templatetags/announcements_tags.py", "copies": "5", "size": "1419", "license": "mit", "hash": -4464927023750678000, "line_mean": 26.8235294118, "line_max": 75, "alpha_frac": 0.6229739253, "autogenerated": false, "ratio": 3.98...
from django import template from django.db.models import Q from django.utils import timezone from pinax.announcements.models import Announcement register = template.Library() class AnnouncementsNode(template.Node): @classmethod def handle_token(cls, parser, token): bits = token.split_contents() ...
{ "repo_name": "arthur-wsw/pinax-announcements", "path": "pinax/announcements/templatetags/pinax_announcements_tags.py", "copies": "1", "size": "1425", "license": "mit", "hash": -2607942749243834400, "line_mean": 26.9411764706, "line_max": 75, "alpha_frac": 0.6238596491, "autogenerated": false, "r...
from django import template from django.db.models import Q from django.utils import timezone from pinax.announcements.models import Announcement register = template.Library() class AnnouncementsNode(template.Node): @classmethod def handle_token(cls, parser, token): bits = token.split_contents() ...
{ "repo_name": "pinax/pinax-announcements", "path": "pinax/announcements/templatetags/pinax_announcements_tags.py", "copies": "2", "size": "1422", "license": "mit", "hash": 5617067149627785000, "line_mean": 27.44, "line_max": 75, "alpha_frac": 0.6251758087, "autogenerated": false, "ratio": 3.96100...
from django import template from django.db.models import Q from django.utils.safestring import mark_safe from ..models import Alert register = template.Library() @register.simple_tag(takes_context=True) def alerts(context, tags, *args, **kwargs): """ Retrieves number of unread alerts by ``tag`` for current ...
{ "repo_name": "PragmaticMates/django-alerts", "path": "alerts/templatetags/alerts.py", "copies": "1", "size": "1941", "license": "mit", "hash": -7217659321168289000, "line_mean": 31.8983050847, "line_max": 102, "alpha_frac": 0.6697578568, "autogenerated": false, "ratio": 4.256578947368421, "con...
from django import template from django.db.models import Q from django.utils.safestring import mark_safe from reversion_compare.helpers import html_diff, SEMANTIC register = template.Library() @register.simple_tag def semantic_diff(left, right, field): left_txt = left.field_dict[field] or '' right_txt = rig...
{ "repo_name": "vahtras/amy", "path": "workshops/templatetags/diff.py", "copies": "2", "size": "2881", "license": "mit", "hash": 1463903538906088000, "line_mean": 36.9078947368, "line_max": 88, "alpha_frac": 0.5907670948, "autogenerated": false, "ratio": 3.596754057428215, "config_test": false, ...
from django import template from django.db.models import Q from wforensic.whatsapp.models import WaContacts, ChatList, Messages register = template.Library() class LoadHeader(template.Node): def __init__(self, varname): self.varname = varname def render(self, context): try: cont...
{ "repo_name": "sch3m4/wforensic", "path": "wforensic/whatsapp/templatetags/gettemplateheader.py", "copies": "2", "size": "1055", "license": "bsd-3-clause", "hash": 568026060772467700, "line_mean": 30.0294117647, "line_max": 115, "alpha_frac": 0.6113744076, "autogenerated": false, "ratio": 3.95131...
from django import template from django.db.models import Sum from ..models import Visitor register = template.Library() class VisitorsOnSite(template.Node): """ Injects the number of active users on your site as an integer into the context """ def __init__(self, varname, type=None): """ ...
{ "repo_name": "pylixm/liBlog", "path": "liBlog/visitor/templatetags/visitor_tags.py", "copies": "1", "size": "2772", "license": "mit", "hash": -77861930149509500, "line_mean": 25.6538461538, "line_max": 166, "alpha_frac": 0.6038961039, "autogenerated": false, "ratio": 4.005780346820809, "config...
from django import template from django.db.models.loading import cache from django.db.models import Model as DjangoModel from django.utils.safestring import SafeUnicode from classytags.core import Options from classytags.arguments import (Argument, MultiValueArgument, MultiKeywordArgument) from classytags.helpers impo...
{ "repo_name": "airtonix/django-project-portfolio", "path": "projects/templatetags/projects_tags.py", "copies": "1", "size": "2187", "license": "bsd-3-clause", "hash": -2917803432775095000, "line_mean": 22.7717391304, "line_max": 85, "alpha_frac": 0.7046181984, "autogenerated": false, "ratio": 3.2...
from django import template from django.db.models.loading import get_model from investments.models import register = template.Library() def get_qs_for_model(val): ''' Usage: get_qs_for_model('appname.modelname') Example: get_qs_for_model('library.Book') ''' try: app_label, model_name = val...
{ "repo_name": "havencruise/django-utils", "path": "templatetags/model_objects.py", "copies": "1", "size": "1400", "license": "mit", "hash": 1059684146413239700, "line_mean": 28.7872340426, "line_max": 97, "alpha_frac": 0.625, "autogenerated": false, "ratio": 3.6458333333333335, "config_test": f...
from django import template from django.db.models.loading import get_model from .. import utils register = template.Library() @register.filter('has_fields') def has_fields(facet): if not facet: return False for val in facet: if val[1] > 0: return True return False @registe...
{ "repo_name": "zerok/pyconde-website-mirror", "path": "pyconde/search/templatetags/search_tags.py", "copies": "3", "size": "1561", "license": "bsd-3-clause", "hash": -4188606495231973000, "line_mean": 25.9137931034, "line_max": 76, "alpha_frac": 0.6252402306, "autogenerated": false, "ratio": 3.49...
from django import template from django.db.models.loading import get_model register = template.Library() def get_qs_for_model(val): ''' Usage: get_qs_for_model('appname.modelname') Example: get_qs_for_model('library.Book') ''' try: app_label, model_name = val.split(".") except ValueErr...
{ "repo_name": "havencruise/emberjam", "path": "project/apps/core/templatetags/model_objects.py", "copies": "1", "size": "1420", "license": "mit", "hash": -9063985291015450000, "line_mean": 29.8695652174, "line_max": 97, "alpha_frac": 0.614084507, "autogenerated": false, "ratio": 3.650385604113110...
from django import template from django.db.models.query import QuerySet from django.core.exceptions import ObjectDoesNotExist from calendar import month_name, day_name from polymorphic.query import PolymorphicQuerySet import re from danceschool.core.models import Event, DanceRole, Instructor, Location from danceschoo...
{ "repo_name": "django-danceschool/django-danceschool", "path": "danceschool/core/templatetags/danceschool_tags.py", "copies": "1", "size": "4700", "license": "bsd-3-clause", "hash": -6908843701149818000, "line_mean": 26.3255813953, "line_max": 94, "alpha_frac": 0.6855319149, "autogenerated": false,...
from django import template from django.db.models.query import QuerySet register = template.Library() class GetCountNode(template.Node): def __init__(self, list_var, context_var): self.list_var = template.Variable(list_var) self.context_var = context_var def render(self, context): obj...
{ "repo_name": "kaleidos/intranet", "path": "backend/cmsutils/templatetags/list_utils.py", "copies": "3", "size": "2819", "license": "apache-2.0", "hash": 5190925707358366000, "line_mean": 25.6037735849, "line_max": 96, "alpha_frac": 0.552323519, "autogenerated": false, "ratio": 3.3720095693779903...
from django import template from django.db.models.query import QuerySet register = template.Library() @register.tag def make_quiz_js(parser, token): bits = token.split_contents() try: tag = bits.pop(0) queryset = parser.compile_filter(bits.pop(0)) kana = parser.compile_filter(bits.pop...
{ "repo_name": "vforgione/kana_quiz", "path": "apps/kana/templatetags/quiz.py", "copies": "1", "size": "1543", "license": "mit", "hash": -7099938585924008000, "line_mean": 29.86, "line_max": 106, "alpha_frac": 0.569669475, "autogenerated": false, "ratio": 3.8193069306930694, "config_test": false...
from django import template from django.db.models.query import QuerySet register = template.Library() @register.tag def render_as_chart(parser, token): bits = token.split_contents() try: tag = bits.pop(0) queryset = parser.compile_filter(bits.pop(0)) kana = parser.compile_filter(bits....
{ "repo_name": "vforgione/kana_quiz", "path": "apps/kana/templatetags/gojuon.py", "copies": "1", "size": "1844", "license": "mit", "hash": -6115936004652682000, "line_mean": 31.350877193, "line_max": 135, "alpha_frac": 0.545010846, "autogenerated": false, "ratio": 4.017429193899782, "config_test...
from django import template from django.db.models.signals import post_save from django.contrib.auth.models import AnonymousUser, User from codereview import library from gae2django.utils import CallableString def nickname(email, arg=None): if isinstance(email, AnonymousUser): email = None elif isinst...
{ "repo_name": "bubenkoff/bubenkoff-gae2django", "path": "examples/rietveld/rietveld_helper/__init__.py", "copies": "3", "size": "1323", "license": "apache-2.0", "hash": -4015756228802657300, "line_mean": 30.5, "line_max": 71, "alpha_frac": 0.7210884354, "autogenerated": false, "ratio": 3.97297297...
from django import template from django.forms.formsets import all_valid from django.contrib.admin import helpers from django.contrib.admin.util import unquote, get_deleted_objects from django.core.exceptions import PermissionDenied from django.db import transaction from django.db.models.fields import FieldDoesNotExist ...
{ "repo_name": "ella/ella-newman", "path": "ella_newman/xoptions.py", "copies": "1", "size": "22476", "license": "bsd-3-clause", "hash": -3708344200895666700, "line_mean": 43.7729083665, "line_max": 159, "alpha_frac": 0.5875155722, "autogenerated": false, "ratio": 4.224812030075188, "config_test...
from django import template from django.forms.forms import BoundField from django.utils.html import format_html register = template.Library() @register.simple_tag def uka_form_row_stacked(element, errors='', classes=''): class_margin_top = '' label = BoundField.label_tag(element, "", {'class': 'uk-form-label...
{ "repo_name": "epi-log/django-uikit-admin", "path": "uikit_admin/templatetags/uikit_admin.py", "copies": "2", "size": "1561", "license": "bsd-3-clause", "hash": -4477882268782037500, "line_mean": 30.8571428571, "line_max": 118, "alpha_frac": 0.6220371557, "autogenerated": false, "ratio": 3.423245...
from django import template from django.forms.forms import BoundField register = template.Library() """ The sole purpose of these filters are to allow operations with template elements that naturally start with the underscore ('_') character. """ @register.filter(name="field_") def field_(self, name): """ G...
{ "repo_name": "halfnibble/django-underscore-filters", "path": "underscore_filters/templatetags/underscore_tags.py", "copies": "1", "size": "1483", "license": "mit", "hash": -4689031911971068000, "line_mean": 27.5192307692, "line_max": 80, "alpha_frac": 0.6331759946, "autogenerated": false, "ratio...
from django import template from django.forms import CheckboxInput, CheckboxSelectMultiple, RadioSelect, FileInput, MultiWidget from django.forms.utils import ErrorList from django.utils.encoding import force_text from django.utils.html import format_html, format_html_join, conditional_escape from django.utils.translat...
{ "repo_name": "fausecteam/ctf-gameserver", "path": "src/ctf_gameserver/web/templatetags/templatetags/form_as_div.py", "copies": "1", "size": "6062", "license": "isc", "hash": -6728069523244978000, "line_mean": 40.8068965517, "line_max": 109, "alpha_frac": 0.6570438799, "autogenerated": false, "ra...
from django import template from django.forms import CheckboxInput from django.template.base import TemplateSyntaxError, token_kwargs, Node from django.template.loader import render_to_string from is_core.config import settings from is_core.utils import pretty_class_name from is_core.forms.widgets import WrapperWidget...
{ "repo_name": "matllubos/django-is-core", "path": "is_core/templatetags/forms.py", "copies": "1", "size": "4862", "license": "bsd-3-clause", "hash": 6559487635961430000, "line_mean": 32.7638888889, "line_max": 119, "alpha_frac": 0.6542575072, "autogenerated": false, "ratio": 3.9146537842190017, ...
from django import template from django.forms import fields, CheckboxInput __author__ = 'jay' register = template.Library() def add_attrs(widget_or_field, attrs, is_replace=True): """Add attributes from attrs to widget_or_field :param widget_or_field: object it can be a widget, field :param attrs: dic...
{ "repo_name": "BusyJay/sokoban", "path": "src/sokoban/templatetags/sokoban_tags.py", "copies": "1", "size": "3200", "license": "mit", "hash": 2762627542507424300, "line_mean": 31.9896907216, "line_max": 74, "alpha_frac": 0.6509375, "autogenerated": false, "ratio": 3.690888119953864, "config_tes...
from django import template from django.forms import fields, ModelMultipleChoiceField, ModelChoiceField, BoundField, widgets from django.template.loader import render_to_string from django.urls import reverse from django.utils.safestring import mark_safe register = template.Library() @register.filter def bootstrap_f...
{ "repo_name": "StichtingBorrelbeheerZilverling/sbzwebsite", "path": "apps/util/templatetags/bootstrap_form.py", "copies": "1", "size": "3563", "license": "bsd-3-clause", "hash": -6672500766071402000, "line_mean": 34.63, "line_max": 96, "alpha_frac": 0.6828515296, "autogenerated": false, "ratio": ...
from django import template from django.forms import Textarea from django.utils import translation from django.conf import settings from django.contrib.admin.widgets import AdminTextareaWidget from pages.placeholders import PlaceholderNode from pages.placeholders import parse_placeholder try: from ckeditor.widget...
{ "repo_name": "batiste/django-page-cms", "path": "pages/templatetags/ckeditor_placeholder.py", "copies": "2", "size": "1341", "license": "bsd-3-clause", "hash": -4744858198708295000, "line_mean": 32.525, "line_max": 82, "alpha_frac": 0.7188665175, "autogenerated": false, "ratio": 4.03915662650602...
from django import template from django.forms import Textarea from django.utils import translation from django.conf import settings from pages.placeholders import PlaceholderNode from pages.placeholders import parse_placeholder register = template.Library() class CKEditorPlaceholderNode(PlaceholderNode): def get...
{ "repo_name": "akaihola/django-page-cms", "path": "pages/templatetags/ckeditor_placeholder.py", "copies": "2", "size": "1218", "license": "bsd-3-clause", "hash": -5461921399429353000, "line_mean": 32.8333333333, "line_max": 82, "alpha_frac": 0.7036124795, "autogenerated": false, "ratio": 4.06, ...
from django import template from django.forms import widgets from django.forms.fields import DateField from django.template import Context from django.template.loader import get_template from django.utils.html import escape from django.utils.safestring import mark_safe register = template.Library() def add_css_class...
{ "repo_name": "zokis/django-materialize-forms", "path": "materialize_forms/templatetags/materialize.py", "copies": "1", "size": "1951", "license": "mit", "hash": 7489927526669335000, "line_mean": 27.2753623188, "line_max": 68, "alpha_frac": 0.6422347514, "autogenerated": false, "ratio": 3.7591522...
from django import template from django_hits.models import Hit register = template.Library() class HitNode(template.Node): def __init__(self, context_var_name, as_var_name, bucket_var_name, count, count_bucket_only=False): self.context_var_name = context_var_name self.as_var_name = as_var_name ...
{ "repo_name": "bung87/django_hits", "path": "django_hits/templatetags/hit_tags.py", "copies": "1", "size": "5490", "license": "bsd-3-clause", "hash": -185739052440114800, "line_mean": 37.125, "line_max": 115, "alpha_frac": 0.5772313297, "autogenerated": false, "ratio": 3.8472319551506655, "conf...
from django import template from django.http import Http404 from django.conf import settings from copy import copy register = template.Library() REMOVE_ORDER = '<a href="{}"><i class="icon-remove"></i></a>' sort_directions = { 'asc': {'icon':'icon-arrow-up', 'inverse': 'desc'}, 'desc': {'icon':'icon-arrow-do...
{ "repo_name": "Scholr/scholr-admin", "path": "scholradmin/templatetags/sorting_tag.py", "copies": "2", "size": "3878", "license": "bsd-3-clause", "hash": 5699899451822978000, "line_mean": 31.8644067797, "line_max": 122, "alpha_frac": 0.5386797318, "autogenerated": false, "ratio": 4.06073298429319...
from django import template from django.http import Http404 from django.conf import settings register = template.Library() DEFAULT_SORT_UP = getattr(settings, 'DEFAULT_SORT_UP' , '&uarr;') DEFAULT_SORT_DOWN = getattr(settings, 'DEFAULT_SORT_DOWN' , '&darr;') INVALID_FIELD_RAISES_404 = getattr(settings, 'SORT...
{ "repo_name": "julzhk/django-sorting", "path": "django_sorting/templatetags/sorting_tags.py", "copies": "2", "size": "3607", "license": "bsd-3-clause", "hash": -3173005346319680000, "line_mean": 31.2053571429, "line_max": 83, "alpha_frac": 0.57693374, "autogenerated": false, "ratio": 3.8048523206...
from django import template from django.http import Http404 from django.core.paginator import Paginator, InvalidPage from django.conf import settings register = template.Library() DEFAULT_PAGINATION = getattr(settings, 'PAGINATION_DEFAULT_PAGINATION', 20) DEFAULT_WINDOW = getattr(settings, 'PAGINATION_DEFAULT_WINDOW'...
{ "repo_name": "hugotacito/django-pagination", "path": "pagination/templatetags/pagination_tags.py", "copies": "1", "size": "8801", "license": "bsd-3-clause", "hash": 1934064028540380200, "line_mean": 39.7453703704, "line_max": 88, "alpha_frac": 0.6003863197, "autogenerated": false, "ratio": 4.143...
from django import template from django.http import Http404 from django.shortcuts import render from django.views.generic import View from pretix.base.models import Organizer class HelpView(View): model = Organizer context_object_name = 'organizers' template_name = 'pretixcontrol/organizers/index.html' ...
{ "repo_name": "Flamacue/pretix", "path": "src/pretix/control/views/help.py", "copies": "2", "size": "1134", "license": "apache-2.0", "hash": -2850995877988262400, "line_mean": 41, "line_max": 107, "alpha_frac": 0.6710758377, "autogenerated": false, "ratio": 4.18450184501845, "config_test": fals...
from django import template from django.http import Http404 from django.utils import six from banner.models import Banner from banner.styles import BANNER_STYLES_MAP register = template.Library() @register.tag def render_banner(parser, token): tokens = token.split_contents() if len(tokens) < 2: rai...
{ "repo_name": "praekelt/jmbo-banner", "path": "banner/templatetags/banner_tags.py", "copies": "1", "size": "1364", "license": "bsd-3-clause", "hash": -162974116813514940, "line_mean": 26.28, "line_max": 64, "alpha_frac": 0.5894428152, "autogenerated": false, "ratio": 3.8640226628895182, "config...
from django import template from django.http import Http404 from django.utils.translation import ugettext_lazy as _ from .settings import INVALID_FIELD_RAISES_404 from . import common register = template.Library() def anchor(parser, token): """ Parses a tag that's supposed to be in this format '{% anchor fi...
{ "repo_name": "webstack/webstack-django-sorting", "path": "webstack_django_sorting/templatetags/sorting_tags.py", "copies": "1", "size": "3854", "license": "bsd-3-clause", "hash": -7437479030734908000, "line_mean": 29.832, "line_max": 89, "alpha_frac": 0.6004151531, "autogenerated": false, "ratio...
from django import template from django.http import HttpRequest from django.template import Context, Template from django.test.testcases import TestCase from geonode.people.models import Profile class CartoviewTemplateTagsTest(TestCase): fixtures = ['sample_admin.json', ] def render_template(self, string, c...
{ "repo_name": "cartologic/cartoview", "path": "cartoview/tests/test_template_tags.py", "copies": "1", "size": "1623", "license": "bsd-2-clause", "hash": 518791459302443600, "line_mean": 36.7441860465, "line_max": 88, "alpha_frac": 0.5551447936, "autogenerated": false, "ratio": 3.8551068883610453,...
from django import template from django.http import HttpResponse, HttpResponseRedirect from django.utils import simplejson from django.db import transaction from django.middleware import csrf from django.contrib.contenttypes.models import ContentType from oa_location.models import LocationForm, Place import random impo...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/oa_location/templatetags/locationtags.py", "copies": "1", "size": "5047", "license": "bsd-3-clause", "hash": -8180143716964581000, "line_mean": 30.9430379747, "line_max": 137, "alpha_frac": 0.6990291262, "autogenerated": false, "r...
from django import template from django.http import HttpResponseRedirect, HttpResponseNotFound, HttpResponseServerError from django.views import defaults from django.shortcuts import render_to_response from django.core.exceptions import PermissionDenied from django.template import Context, RequestContext, loader from d...
{ "repo_name": "edisonlz/fruit", "path": "web_project/base/site-packages/mobileadmin/views.py", "copies": "2", "size": "3382", "license": "apache-2.0", "hash": 8173710029770687000, "line_mean": 37, "line_max": 109, "alpha_frac": 0.6215257244, "autogenerated": false, "ratio": 3.9143518518518516, ...
from django import template from django.http import QueryDict from math import floor # Permite crear variables en un template --> https://djangosnippets.org/snippets/539/ class AssignNode(template.Node): def __init__(self, name, value): self.name = name self.value = value def render(se...
{ "repo_name": "sergio83/harvest", "path": "extra_template_tags/templatetags/extra_tags.py", "copies": "2", "size": "3246", "license": "mit", "hash": 1966906070413150200, "line_mean": 30.5242718447, "line_max": 99, "alpha_frac": 0.5120147874, "autogenerated": false, "ratio": 4.077889447236181, "...
from django import template from django.http import QueryDict from .. import utils register = template.Library() @register.filter def verbose_name(obj): """ Returns the verbose name for a Django Model instance. """ return obj._meta.verbose_name @register.filter def verbose_name_plural(obj): "...
{ "repo_name": "code-kitchen/django-utensils", "path": "utensils/templatetags/utensils_tags.py", "copies": "1", "size": "4317", "license": "mit", "hash": 440574025237827700, "line_mean": 24.8502994012, "line_max": 87, "alpha_frac": 0.596247394, "autogenerated": false, "ratio": 3.639966273187184, ...
from django import template from django.http import QueryDict register = template.Library() @register.tag() def qstring(parser, token): """ {% qstring as querystring %} """ tokens = token.split_contents() if len(tokens) not in (1, 3): raise template.TemplateSyntaxError("'%s' takes zero o...
{ "repo_name": "vosi/django-xadditions", "path": "xadditions/templatetags/query_builder.py", "copies": "1", "size": "2778", "license": "bsd-3-clause", "hash": -6775765421001774000, "line_mean": 24.2545454545, "line_max": 76, "alpha_frac": 0.6162706983, "autogenerated": false, "ratio": 3.5031525851...
from django import template from django_image import settings register = template.Library() def split_kwargs(kwargs): """Split out kwargs into options and attributes""" options = {k: v for k, v in kwargs.items() if not k.startswith('_')} attributes = {k.lstrip('_'): v for k, v in kwargs.items() if k.start...
{ "repo_name": "adamcharnock/django-image", "path": "django_image/templatetags/images.py", "copies": "1", "size": "1028", "license": "mit", "hash": 1858513645797689900, "line_mean": 34.4482758621, "line_max": 83, "alpha_frac": 0.7149805447, "autogenerated": false, "ratio": 3.508532423208191, "co...
from django import template from django import forms from django.conf import settings from django.core.urlresolvers import reverse from django.utils.safestring import mark_safe class TagAutoCompleteInput(forms.TextInput): class Media: if hasattr(settings, 'STATIC_URL'): media_url = settin...
{ "repo_name": "pydanny/django-tagging-ext", "path": "tagging_ext/widgets.py", "copies": "1", "size": "2222", "license": "mit", "hash": -3307929992903036000, "line_mean": 33.71875, "line_max": 77, "alpha_frac": 0.4774977498, "autogenerated": false, "ratio": 4.417495029821073, "config_test": fals...
from django import template from django import forms from django.db.models.query import QuerySet from django.template.loader import render_to_string from gmapi.forms.widgets import GoogleMap from gmapi import maps from gigs.gig_registry.models import Location, Gig, Venue, Band class MapForm(forms.Form): # ###TO...
{ "repo_name": "shaunokeefe/gigs", "path": "gigs/maps/templatetags/maps.py", "copies": "1", "size": "4189", "license": "bsd-3-clause", "hash": -7865298645672978000, "line_mean": 30.0296296296, "line_max": 85, "alpha_frac": 0.5779422296, "autogenerated": false, "ratio": 4.047342995169082, "config...
from django import template from django import forms from django.http import HttpResponse, HttpResponseRedirect from django.utils import simplejson from pirate_messages.models import Message, MessageForm, Notification from django.db import transaction from django.middleware import csrf from django.contrib.contenttypes....
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_messages/templatetags/messagetags.py", "copies": "1", "size": "3570", "license": "bsd-3-clause", "hash": 8233206123676607000, "line_mean": 29, "line_max": 128, "alpha_frac": 0.6588235294, "autogenerated": false, "ratio": 4....
from django import template from django import forms from django.http import HttpResponse, HttpResponseRedirect from django.utils import simplejson from pirate_messages.models import Notification, Message from django.db import transaction from django.middleware import csrf from django.contrib.contenttypes.models import...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_messages/templatetags/notificationtags.py", "copies": "1", "size": "3561", "license": "bsd-3-clause", "hash": 8955500789021115000, "line_mean": 25.3777777778, "line_max": 80, "alpha_frac": 0.6795843864, "autogenerated": false...
from django import template from django import forms from django.http import HttpResponse, HttpResponseRedirect from django.utils import simplejson from django.shortcuts import get_object_or_404 from django.contrib.contenttypes.models import ContentType from pirate_topics.models import MyGroup from django.db.models ...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_consensus/templatetags/consensustags.py", "copies": "1", "size": "17638", "license": "bsd-3-clause", "hash": 8462960159316622000, "line_mean": 30, "line_max": 242, "alpha_frac": 0.5779566844, "autogenerated": false, "ratio"...
from django import template from django import forms from django.http import HttpResponseRedirect from django.contrib.contenttypes.models import ContentType from pirate_sources.models import IMGSource, URLSource from pirate_core.views import HttpRedirectException, namespace_get from django.template import Library from ...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_sources/templatetags/sourcetags.py", "copies": "1", "size": "16685", "license": "bsd-3-clause", "hash": 5073692845427542000, "line_mean": 30.5406427221, "line_max": 253, "alpha_frac": 0.6069523524, "autogenerated": false, "...
from django import template from django import forms from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 import datetime from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from pirate_core import HttpRedirectException, namespace...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_permissions/templatetags/cani.py", "copies": "1", "size": "1937", "license": "bsd-3-clause", "hash": 9041711520189734000, "line_mean": 32.3965517241, "line_max": 90, "alpha_frac": 0.6979865772, "autogenerated": false, "rati...
from django import template from django import forms from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 import datetime from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from pirate_core import HttpRedirectException, namespac...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_login/templatetags/logintags.py", "copies": "1", "size": "14667", "license": "bsd-3-clause", "hash": 2390439807166610400, "line_mean": 39.5165745856, "line_max": 200, "alpha_frac": 0.5429194791, "autogenerated": false, "rat...
from django import template from django import forms from django.http import HttpResponseRedirect import datetime from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from pirate_core import HttpRedirectException, namespace_get, FormMixin from pirate_social.models impor...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_social/templatetags/subscriptiontags.py", "copies": "1", "size": "7680", "license": "bsd-3-clause", "hash": 5073682310766637000, "line_mean": 31.8205128205, "line_max": 134, "alpha_frac": 0.634375, "autogenerated": false, "...
from django import template from django import forms from django.http import HttpResponseRedirect import datetime from django.contrib.auth.models import User from pirate_badges.models import Badge, BadgeDimension, test_badge, BadgeType from pirate_core import HttpRedirectException, namespace_get, FormMixin from pirate_...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_badges/templatetags/badgetags.py", "copies": "1", "size": "2980", "license": "bsd-3-clause", "hash": -5789402043293468000, "line_mean": 30.3684210526, "line_max": 111, "alpha_frac": 0.6889261745, "autogenerated": false, "ra...
from django import template from django import forms from django.http import HttpResponseRedirect import datetime from django.contrib.contenttypes.models import ContentType from pirate_deliberation.models import Argument, Stance, get_argument_list from pirate_consensus.models import Consensus, UpDownVote from pirate_re...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_deliberation/templatetags/argumenttags.py", "copies": "1", "size": "6234", "license": "bsd-3-clause", "hash": 8205685876345666000, "line_mean": 35.4561403509, "line_max": 191, "alpha_frac": 0.6392364453, "autogenerated": fals...
from django import template from django import forms from django.http import HttpResponseRedirect import datetime from django.contrib.contenttypes.models import ContentType from tagging.models import Tag, TaggedItem from django.db.models import get_model from pirate_consensus.models import Consensus from settings impor...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_core/templatetags/tag_helpers.py", "copies": "1", "size": "16298", "license": "bsd-3-clause", "hash": 4333022090590092300, "line_mean": 26.4377104377, "line_max": 250, "alpha_frac": 0.5870658977, "autogenerated": false, "ra...
from django import template from django import forms from django.http import HttpResponseRedirect import datetime from django.contrib.contenttypes.models import ContentType from oa_verification.models import EmailVerification import datetime, random, sha from django.core.mail import send_mail from oa_verification.mod...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/oa_verification/templatetags/verificationtags.py", "copies": "1", "size": "19996", "license": "bsd-3-clause", "hash": 231036993541231100, "line_mean": 31.942339374, "line_max": 169, "alpha_frac": 0.5919183837, "autogenerated": false...
from django import template from django import forms from django.http import HttpResponseRedirect from pirate_forum.models import ForumDimension, DimensionTracker from search.core import search from oa_cache.models import ListCache from django.template import Context, Template import datetime import pytz from djang...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_forum/templatetags/blobtags.py", "copies": "1", "size": "26307", "license": "bsd-3-clause", "hash": 1221707574491872500, "line_mean": 32.641943734, "line_max": 191, "alpha_frac": 0.592541909, "autogenerated": false, "ratio"...
from django import template from django import forms from django.http import HttpResponseRedirect from pirate_social.models import Subscription,RelationshipEvent from pirate_core.views import HttpRedirectException, namespace_get from customtags.decorators import block_decorator register = template.Library() block = ...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_social/templatetags/feedtags.py", "copies": "1", "size": "2051", "license": "bsd-3-clause", "hash": 4337454710576483300, "line_mean": 33.1833333333, "line_max": 91, "alpha_frac": 0.6548025353, "autogenerated": false, "ratio...
from django import template from django import forms from django.template import Node, NodeList, Template, Context, resolve_variable from django.template.loader import get_template, render_to_string from django.conf import settings from django.utils.html import escape from multilingual.languages import (get_language_id...
{ "repo_name": "andriibekker/django-multilingual", "path": "multilingual/templatetags/multilingual_tags.py", "copies": "2", "size": "2861", "license": "mit", "hash": 1901750277774477000, "line_mean": 33.0595238095, "line_max": 90, "alpha_frac": 0.6543166725, "autogenerated": false, "ratio": 3.9191...
from django import template from django import forms import datetime import sys from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from pirate_reputation.models import Reputation, ReputationDimension, ReputationEvent, AbuseTicket, FeedbackTicket from pirate_consensus....
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_reputation/templatetags/reputationtags.py", "copies": "1", "size": "16322", "license": "bsd-3-clause", "hash": 1886762747012923100, "line_mean": 32.9334719335, "line_max": 158, "alpha_frac": 0.5935547114, "autogenerated": fal...
from django import template from django import forms from pirate_permissions.models import Permission, PermissionsGroup import re from django.contrib.contenttypes.models import ContentType from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from markitup.widgets import MarkItUpWidget from pirat...
{ "repo_name": "fragro/Open-Assembly", "path": "ver1_0/openassembly/pirate_topics/templatetags/topictags.py", "copies": "1", "size": "18200", "license": "bsd-3-clause", "hash": -5178411021638240000, "line_mean": 29.3839732888, "line_max": 169, "alpha_frac": 0.6208791209, "autogenerated": false, "r...
from django import template from django import http from django.conf import settings from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django_nova_syspanel.models import * def _reservations_to_instances(reservation_list): rv = [] for r in reservation...
{ "repo_name": "sleepsonthefloor/openstack-dashboard", "path": "django-nova-syspanel/src/django_nova_syspanel/views/instances.py", "copies": "1", "size": "3311", "license": "apache-2.0", "hash": 931557001996122500, "line_mean": 37.9529411765, "line_max": 79, "alpha_frac": 0.6581093325, "autogenerate...
from django import template from django import http from django.contrib import messages from django.core.exceptions import PermissionDenied from django.shortcuts import render_to_response from django.utils.encoding import force_unicode from django.utils.html import escape from django.utils.safestring import mark_safe f...
{ "repo_name": "lsbardel/django-amazoncloud", "path": "amazoncloud/actions.py", "copies": "1", "size": "6737", "license": "bsd-3-clause", "hash": 7226665320149992000, "line_mean": 37.4971428571, "line_max": 100, "alpha_frac": 0.5926970462, "autogenerated": false, "ratio": 4.452742894910774, "con...
from django import template from djangopress.blog.models import Entry, Blog, Category from django.utils import timezone register = template.Library() @register.inclusion_tag('blog/show_latest.html') def show_blog_latest(number=5, words=20, blog=None): blog = Blog.objects.get(slug=blog) try: number = i...
{ "repo_name": "codefisher/djangopress", "path": "djangopress/blog/templatetags/blog_tags.py", "copies": "1", "size": "1398", "license": "mit", "hash": 1025074733053043000, "line_mean": 27.5510204082, "line_max": 71, "alpha_frac": 0.6466380544, "autogenerated": false, "ratio": 3.612403100775194, ...
from django import template from djangopress.menus.menu import register as menu_register from djangopress.menus.models import Menu, MenuItem from django.conf import settings register = template.Library() @register.simple_tag(takes_context=True) def display_menu(context, menu_name, renderer=None): try: men...
{ "repo_name": "codefisher/djangopress", "path": "djangopress/menus/templatetags/display_menu.py", "copies": "1", "size": "1371", "license": "mit", "hash": -8770184043461073000, "line_mean": 40.5757575758, "line_max": 125, "alpha_frac": 0.7177242888, "autogenerated": false, "ratio": 3.685483870967...
from django import template from django.shortcuts import get_object_or_404, Http404 from utama.models import Personil register = template.Library() @register.filter(name='ambil_peran_tertentu') def ambil_peran_tertentu(value, args=None): try: org, keg = value except ValueError: org = value ...
{ "repo_name": "akbarpn136/perek-dj", "path": "tugas/templatetags/peran_terkait.py", "copies": "1", "size": "3215", "license": "cc0-1.0", "hash": 2300294238910091000, "line_mean": 26.9565217391, "line_max": 100, "alpha_frac": 0.4603421462, "autogenerated": false, "ratio": 3.3281573498964803, "co...
from django import template from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from django.utils.safestring import mark_safe from issues.models import Proposal, ProposalVote, VoteResult, ProposalVoteArgument, ProposalVoteArgumentRanking from meetings.models import Meeting from u...
{ "repo_name": "yaniv14/OpenCommunity", "path": "src/issues/templatetags/voting_tags.py", "copies": "1", "size": "5000", "license": "bsd-3-clause", "hash": -2016375718197810000, "line_mean": 33.2465753425, "line_max": 116, "alpha_frac": 0.6616, "autogenerated": false, "ratio": 3.4223134839151266, ...
from django import template from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from issues.models import Proposal, ProposalVote, VoteResult, ProposalVoteArgument, ProposalVoteArgumentRanking from meetings.models import Meeting from users.models import OCUser register = template...
{ "repo_name": "nonZero/OpenCommunity", "path": "src/issues/templatetags/voting_tags.py", "copies": "1", "size": "4921", "license": "bsd-3-clause", "hash": 1440940364575055000, "line_mean": 32.9379310345, "line_max": 116, "alpha_frac": 0.6594188173, "autogenerated": false, "ratio": 3.4149895905621...
from django import template from django.shortcuts import get_object_or_404 from server.models import * from datetime import datetime import time import dateutil.parser from django.template.defaultfilters import date from django.utils.timezone import utc import pytz from django.conf import settings from distutils.versio...
{ "repo_name": "erikng/sal", "path": "server/templatetags/dashboard_extras.py", "copies": "1", "size": "2684", "license": "apache-2.0", "hash": -9192235434772476000, "line_mean": 28.1739130435, "line_max": 108, "alpha_frac": 0.6687779434, "autogenerated": false, "ratio": 3.7486033519553073, "con...
from django import template from django.shortcuts import get_object_or_404 from person.models import Patient from register.forms import (AccountingForm, RadiographyForm, detailAprossForm, detailBenefitForm) from register.models import (Apross, Benefit, DetailApross, DetailBenefit, ...
{ "repo_name": "nanomolina/JP", "path": "src/odontology/register/templatetags/register_extras.py", "copies": "1", "size": "2298", "license": "apache-2.0", "hash": 3344999969157762600, "line_mean": 29.64, "line_max": 87, "alpha_frac": 0.6653611836, "autogenerated": false, "ratio": 3.209497206703910...
from django import template from django.shortcuts import redirect, render from django.core.exceptions import ImproperlyConfigured from trackmaniawars.models import War register = template.Library() @register.simple_tag(takes_context=True) def trackmaniawars_upcoming(context): """Render upcoming wars, adding None...
{ "repo_name": "jokey2k/ShockGsite", "path": "trackmaniawars/templatetags/trackmaniawars_extras.py", "copies": "1", "size": "1405", "license": "bsd-3-clause", "hash": 1904170003104906500, "line_mean": 35.0256410256, "line_max": 97, "alpha_frac": 0.6982206406, "autogenerated": false, "ratio": 3.707...
from django import template from django.shortcuts import render_to_response import json register = template.Library() @register.filter def get_excerpt(page): result = render_to_response('core/tags/include_content.html', context={ "self": page, "embed": True}) return result.content @register...
{ "repo_name": "parksandwildlife/oim-cms", "path": "core/templatetags/core_tags.py", "copies": "3", "size": "5742", "license": "apache-2.0", "hash": 5568010175316101000, "line_mean": 33.8, "line_max": 82, "alpha_frac": 0.6722396378, "autogenerated": false, "ratio": 3.8928813559322033, "config_te...
from django import template from django.shortcuts import render_to_response import re import json register = template.Library() @register.filter def get_excerpt(page): result = render_to_response('core/tags/include_content.html', context={ "self":page, "embed":True}) return result.content @...
{ "repo_name": "rockychen-dpaw/oim-cms", "path": "core/templatetags/core_tags.py", "copies": "1", "size": "5703", "license": "apache-2.0", "hash": -5431155179087570000, "line_mean": 34.64375, "line_max": 82, "alpha_frac": 0.6750832895, "autogenerated": false, "ratio": 3.887525562372188, "config_...
from django import template from django.shortcuts import resolve_url from django.template.defaulttags import token_kwargs from django.template.loader import render_to_string from django.utils.encoding import force_str from django.utils.html import conditional_escape from wagtail import VERSION, __version__ from wagtai...
{ "repo_name": "wagtail/wagtail", "path": "wagtail/core/templatetags/wagtailcore_tags.py", "copies": "5", "size": "5951", "license": "bsd-3-clause", "hash": -7871739963067023000, "line_mean": 30.8235294118, "line_max": 129, "alpha_frac": 0.6556881196, "autogenerated": false, "ratio": 4.01551956815...
from django import template from django.shortcuts import resolve_url from glitter.pages.models import Page register = template.Library() @register.assignment_tag def get_active_page(current_url): try: return Page.objects.get(url=resolve_url(current_url)) except Page.DoesNotExist: pass r...
{ "repo_name": "blancltd/django-glitter", "path": "glitter/pages/templatetags/glitter_navigation.py", "copies": "2", "size": "2617", "license": "bsd-3-clause", "hash": -6781100182483939000, "line_mean": 25.4343434343, "line_max": 94, "alpha_frac": 0.6549484142, "autogenerated": false, "ratio": 3.7...
from django import template from django.shortcuts import resolve_url from ..models import Page register = template.Library() @register.filter def show_nav(pages): if pages: pages = [x for x in pages if x.show_in_navigation] return pages @register.assignment_tag def get_active_page(current_page): ...
{ "repo_name": "blancltd/blanc-basic-pages", "path": "blanc_basic_pages/templatetags/page_tags.py", "copies": "1", "size": "2701", "license": "bsd-3-clause", "hash": -2989065069530556400, "line_mean": 24.9711538462, "line_max": 94, "alpha_frac": 0.6542021474, "autogenerated": false, "ratio": 3.767...
from django import template from django.shortcuts import reverse from django.template.defaulttags import token_kwargs from django.template.loader import render_to_string from django.utils.encoding import force_str from wagtail import VERSION, __version__ from wagtail.core.models import Page, Site from wagtail.core.ric...
{ "repo_name": "kaedroho/wagtail", "path": "wagtail/core/templatetags/wagtailcore_tags.py", "copies": "2", "size": "5772", "license": "bsd-3-clause", "hash": 5409575615464771000, "line_mean": 30.8895027624, "line_max": 129, "alpha_frac": 0.6566181566, "autogenerated": false, "ratio": 3.99446366782...
from django import template from django.shortcuts import reverse from django.template.defaulttags import token_kwargs from django.utils.encoding import force_str from django.utils.safestring import mark_safe from wagtail import VERSION, __version__ from wagtail.core.models import Page from wagtail.core.rich_text impor...
{ "repo_name": "mixxorz/wagtail", "path": "wagtail/core/templatetags/wagtailcore_tags.py", "copies": "4", "size": "5412", "license": "bsd-3-clause", "hash": 8457052123245087000, "line_mean": 31.6024096386, "line_max": 129, "alpha_frac": 0.6563192905, "autogenerated": false, "ratio": 3.991150442477...
from django import template from django.shortcuts import reverse from django.template.defaulttags import token_kwargs from django.utils.encoding import force_text from django.utils.safestring import mark_safe from wagtail import VERSION, __version__ from wagtail.core.models import Page from wagtail.core.rich_text impo...
{ "repo_name": "nealtodd/wagtail", "path": "wagtail/core/templatetags/wagtailcore_tags.py", "copies": "3", "size": "5249", "license": "bsd-3-clause", "hash": 6748149451466400000, "line_mean": 31.80625, "line_max": 129, "alpha_frac": 0.6586016384, "autogenerated": false, "ratio": 3.9886018237082066...
from django import template from django_simple_forum.models import ForumCategory, Tags, Badge, UserTopics, UserProfile from django.db.models import Count try: from django.contrib.auth import get_user_model User = get_user_model() except ImportError: from django.contrib.auth.models import User register = te...
{ "repo_name": "MicroPyramid/django-simple-forum", "path": "django_simple_forum/templatetags/forum_tags.py", "copies": "1", "size": "1896", "license": "mit", "hash": 6287044738418004000, "line_mean": 25.3333333333, "line_max": 130, "alpha_frac": 0.6851265823, "autogenerated": false, "ratio": 3.391...
from django import template from django.template.base import FilterExpression from django.template.loader import get_template from django.conf import settings from ..exceptions import SiteMessageConfigurationError register = template.Library() @register.tag def sitemessage_prefs_table(parser, token): tokens = ...
{ "repo_name": "idlesign/django-sitemessage", "path": "sitemessage/templatetags/sitemessage.py", "copies": "1", "size": "2188", "license": "bsd-3-clause", "hash": -8927685770820914000, "line_mean": 29.8169014085, "line_max": 103, "alpha_frac": 0.657678245, "autogenerated": false, "ratio": 4.059369...
from django import template from django.template.base import FilterExpression from django.template.loader import get_template from ..sitetreeapp import get_sitetree register = template.Library() @register.tag def sitetree_tree(parser, token): """Parses sitetree tag parameters. Two notation types are possib...
{ "repo_name": "idlesign/django-sitetree", "path": "sitetree/templatetags/sitetree.py", "copies": "1", "size": "10598", "license": "bsd-3-clause", "hash": 2078048722970433000, "line_mean": 33.6339869281, "line_max": 121, "alpha_frac": 0.6556897528, "autogenerated": false, "ratio": 3.87637161667885...
from django import template from django.template.base import FilterExpression from django.template.loader import get_template register = template.Library() def _setup_macros_dict(parser): """ Metadata of each macro are stored in a new attribute of 'parser' class. That way we can access it later in th...
{ "repo_name": "springload/madewithwagtail", "path": "core/templatetags/macros.py", "copies": "1", "size": "4831", "license": "mit", "hash": -1217503598961017900, "line_mean": 30.9933774834, "line_max": 96, "alpha_frac": 0.6044297247, "autogenerated": false, "ratio": 4.009128630705394, "config_t...
from django import template from django.template.base import kwarg_re from django.template.defaulttags import Node from django.template.exceptions import TemplateSyntaxError from ..publisher import publish_html_from_source register = template.Library() class ReStructuredTextNode(Node): """Implement the actions...
{ "repo_name": "tony/django-docutils", "path": "django_docutils/lib/templatetags/rst.py", "copies": "1", "size": "2240", "license": "mit", "hash": 1086035138215740300, "line_mean": 28.8666666667, "line_max": 78, "alpha_frac": 0.6308035714, "autogenerated": false, "ratio": 4.17910447761194, "conf...
from django import template from django.template.base import Node from django.utils.encoding import iri_to_uri from django.utils.six.moves.urllib.parse import urljoin register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __in...
{ "repo_name": "oleksa-pavlenko/gae-django-project-template", "path": "django/templatetags/static.py", "copies": "227", "size": "4084", "license": "mit", "hash": -3830869332631053000, "line_mean": 24.8481012658, "line_max": 116, "alpha_frac": 0.5879040157, "autogenerated": false, "ratio": 4.167346...
from django import template from django.template.base import Node, NodeList from rights.utils import ModelWithRight from app.utils import get_current_unit, get_current_year import importlib register = template.Library() class IfHasRightNode(Node): def __init__(self, conditions_nodelists): self.condi...
{ "repo_name": "ArcaniteSolutions/truffe2", "path": "truffe2/rights/templatetags/rights_extras.py", "copies": "2", "size": "5458", "license": "bsd-2-clause", "hash": 4949769953583233000, "line_mean": 33.5443037975, "line_max": 190, "alpha_frac": 0.5934408208, "autogenerated": false, "ratio": 4.217...
from django import template from django.template.base import Node, Template, TemplateSyntaxError from django.conf import settings register = template.Library() class PlugItIncludeNode(Node): def __init__(self, action): self.action = action def render(self, context): action = self.action.resol...
{ "repo_name": "ebu/test-engine-ondemand", "path": "vendor/plugit-development-client/plugIt/templatetags/plugit_tags.py", "copies": "1", "size": "2174", "license": "bsd-3-clause", "hash": 7256263570525778000, "line_mean": 28.3783783784, "line_max": 145, "alpha_frac": 0.6361545538, "autogenerated": f...
from django import template from django.template.base import Node, Template, TemplateSyntaxError from django.conf import settings register = template.Library() class PlugItIncludeNode(Node): def __init__(self, action): self.action = action def render(self, context): action = self.action.reso...
{ "repo_name": "ebu/PlugIt", "path": "plugit_proxy/templatetags/plugit_tags.py", "copies": "1", "size": "2347", "license": "bsd-3-clause", "hash": -7476778395501772000, "line_mean": 27.6219512195, "line_max": 145, "alpha_frac": 0.6433745207, "autogenerated": false, "ratio": 3.9712351945854483, "...
from django import template from django.template.base import parse_bits, Variable, VariableDoesNotExist from django.template.defaulttags import ForNode from bulbs.promotion.models import PZone register = template.Library() class PZoneSequence(object): def __init__(self, pzone_name, slice_string=None, apply=Tr...
{ "repo_name": "theonion/django-bulbs", "path": "bulbs/promotion/templatetags/promotion.py", "copies": "1", "size": "2769", "license": "mit", "hash": 4127519432532800000, "line_mean": 28.4574468085, "line_max": 88, "alpha_frac": 0.5724088118, "autogenerated": false, "ratio": 3.8835904628330997, ...
from django import template from django.template.base import Parser, Token, TOKEN_BLOCK from django.forms import ChoiceField from django.utils.safestring import mark_safe from .templatetags.sitetree import sitetree_tree from .utils import get_tree_model, get_tree_item_model MODEL_TREE_CLASS = get_tree_model() MODEL_...
{ "repo_name": "caktus/django-sitetree", "path": "sitetree/fields.py", "copies": "4", "size": "1940", "license": "bsd-3-clause", "hash": 598857080392958500, "line_mean": 36.3076923077, "line_max": 116, "alpha_frac": 0.6396907216, "autogenerated": false, "ratio": 3.8722554890219563, "config_test"...
from django import template from django.template.base import TagHelperNode, parse_bits from inspect import getargspec from ..template import get_graph # TODO use a namedtuple for the sparql result register = template.Library() def assignment_tag_with_cdata(library, func=None, takes_context=None, ...
{ "repo_name": "ericmoritz/hydra-python-client", "path": "hydraclient/contrib/django/hydraclient/templatetags/hydratags.py", "copies": "1", "size": "4486", "license": "bsd-3-clause", "hash": 6296045081738747000, "line_mean": 28.3202614379, "line_max": 77, "alpha_frac": 0.5394560856, "autogenerated":...
from django import template from django.template.base import Template from django.template.exceptions import TemplateDoesNotExist class Engine(template.Engine): def find_template(self, name, dirs=None, skip=None, app_label=None, model_name=None): """ Hard override accepts app_label ...
{ "repo_name": "altio/foundation", "path": "foundation/template/engine.py", "copies": "2", "size": "1790", "license": "mit", "hash": -5872257043972126000, "line_mean": 40.6279069767, "line_max": 77, "alpha_frac": 0.5558659218, "autogenerated": false, "ratio": 5.264705882352941, "config_test": fa...
from django import template from django.template.base import TemplateSyntaxError from django.utils.encoding import force_str from django.template.loader import render_to_string from tinycontent.models import TinyContent register = template.Library() class TinyContentNode(template.Node): def __init__(self, args,...
{ "repo_name": "ad-m/django-tinycontent", "path": "tinycontent/templatetags/tinycontent_tags.py", "copies": "2", "size": "2323", "license": "bsd-3-clause", "hash": -2968238554952374300, "line_mean": 29.1688311688, "line_max": 72, "alpha_frac": 0.5643564356, "autogenerated": false, "ratio": 4.58185...
from django import template from django.template.base import TemplateSyntaxError, TemplateDoesNotExist, Variable, FilterExpression from django.template.base import Library, Node, TextNode from django.template.defaulttags import token_kwargs from ..utils import canjs_urls register = template.Library() allowed_librarie...
{ "repo_name": "aljosa/django-canjs", "path": "canjs/templatetags/canjs.py", "copies": "1", "size": "1311", "license": "mit", "hash": -2945885803590880000, "line_mean": 33.5, "line_max": 102, "alpha_frac": 0.6323417239, "autogenerated": false, "ratio": 3.672268907563025, "config_test": false, ...
from django import template from django.template.base import Template, TemplateSyntaxError from lpp.settings import PLUGIT_APP_URL from plugIt.bridge.bridge import Bridge register = template.Library() class PlugItIncludeNode(template.Node): def __init__(self, action): self.action = action def rende...
{ "repo_name": "ebu/radiodns-plugit", "path": "LightweightPlugitProxy/plugIt/templatetags/plugit_tags.py", "copies": "1", "size": "1092", "license": "bsd-3-clause", "hash": -3232812441323062000, "line_mean": 25, "line_max": 105, "alpha_frac": 0.6877289377, "autogenerated": false, "ratio": 3.886120...
from django import template from django.template.base import VariableDoesNotExist from waffle import flag_is_active, sample_is_active, switch_is_active from waffle.views import _generate_waffle_js register = template.Library() class WaffleNode(template.Node): child_nodelists = ('nodelist_true', 'nodelist_false...
{ "repo_name": "webus/django-waffle", "path": "waffle/templatetags/waffle_tags.py", "copies": "2", "size": "2671", "license": "bsd-3-clause", "hash": 4657402748769691000, "line_mean": 29.3522727273, "line_max": 78, "alpha_frac": 0.6312242606, "autogenerated": false, "ratio": 3.9687964338781576, ...
from django import template from django.template.base import VariableDoesNotExist from waffle import flag_is_active, sample_is_active, switch_is_active register = template.Library() class WaffleNode(template.Node): child_nodelists = ('nodelist_true', 'nodelist_false') def __init__(self, nodelist_true, nod...
{ "repo_name": "styleseat/django-waffle", "path": "waffle/templatetags/waffle_tags.py", "copies": "1", "size": "2402", "license": "bsd-3-clause", "hash": -5711158367365163000, "line_mean": 30.1948051948, "line_max": 78, "alpha_frac": 0.6190674438, "autogenerated": false, "ratio": 4.071186440677966...
from django import template from django.template.context import Context from django.contrib.sites.models import Site from django.template.defaultfilters import slugify, yesno from django.template import loader from django.conf import settings from django.core.mail import EmailMessage register = template.Library() cla...
{ "repo_name": "digi604/django-dbforms", "path": "dbforms/templatetags/dbform_tags.py", "copies": "1", "size": "4274", "license": "bsd-3-clause", "hash": 4813604027289887000, "line_mean": 45.4565217391, "line_max": 149, "alpha_frac": 0.5430510061, "autogenerated": false, "ratio": 4.527542372881355...