text stringlengths 0 1.05M | meta dict |
|---|---|
from django import template
from django.template import Node
register = template.Library()
LABEL_STR_FORMAT = '<label for="{field.auto_id}" {attr}>{field.label}</label>'
@register.tag(name="render_label")
def render_label(parser, token):
try:
bits = token.split_contents()
except ValueError:
... | {
"repo_name": "c-bata/django-label-tag-attr",
"path": "label_tag_attr/templatetags/label_tag_attr.py",
"copies": "1",
"size": "1053",
"license": "mit",
"hash": -2590155927028223500,
"line_mean": 32.9677419355,
"line_max": 78,
"alpha_frac": 0.6476733143,
"autogenerated": false,
"ratio": 3.76071428... |
from django import template
from django.template import Node, NodeList, Template, Context, Variable, VariableDoesNotExist
from django.template.defaulttags import IfEqualNode
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.template.loader import rend... | {
"repo_name": "stripathi669/django-reputation",
"path": "django_reputation/templatetags/django_reputation_tags.py",
"copies": "1",
"size": "1113",
"license": "mit",
"hash": 5940434643877212000,
"line_mean": 34.935483871,
"line_max": 103,
"alpha_frac": 0.7385444744,
"autogenerated": false,
"ratio"... |
from django import template
from django.template import Node, NodeList, Template, Context, Variable, VariableDoesNotExist
from django.template.defaulttags import IfEqualNode
from django.template.loader import render_to_string
from django.core.exceptions import ObjectDoesNotExist
from django.template.context import Cont... | {
"repo_name": "stripathi669/django-reputation",
"path": "django_reputation/templatetags/reputation_access_control.py",
"copies": "1",
"size": "2603",
"license": "mit",
"hash": -6025900313800038000,
"line_mean": 36.7246376812,
"line_max": 154,
"alpha_frac": 0.6911256243,
"autogenerated": false,
"r... |
from django import template
from django.template import Node, TemplateSyntaxError
from django.template.base import Token
from django.template import resolve_variable
from django.template.defaultfilters import stringfilter
from django.templatetags import future
from localeurl import utils
register = template.Library()... | {
"repo_name": "extertioner/django-localeurl",
"path": "localeurl/templatetags/localeurl_tags.py",
"copies": "1",
"size": "2346",
"license": "mit",
"hash": 4037932391662461400,
"line_mean": 28.6962025316,
"line_max": 79,
"alpha_frac": 0.6611253197,
"autogenerated": false,
"ratio": 3.82084690553745... |
from django import template
from django.template import Node, TemplateSyntaxError, Variable
from django.template.base import render_value_in_context
from django.utils import six
from django.utils.safestring import SafeData, mark_safe
from wagtailsystemtext.utils import systemtext
from wagtailsystemtext.models import S... | {
"repo_name": "Frojd/wagtail-systemtext",
"path": "wagtailsystemtext/templatetags/systemtext.py",
"copies": "1",
"size": "3174",
"license": "mit",
"hash": -6584815194606653000,
"line_mean": 34.6629213483,
"line_max": 93,
"alpha_frac": 0.5979836169,
"autogenerated": false,
"ratio": 4.4022191400832... |
from django import template
from django.template import Node, Token, TemplateSyntaxError
from django.template import resolve_variable, defaulttags
from django.template.defaultfilters import stringfilter
from django.utils.functional import wraps
from localeurl import utils
register = template.Library()
def chlocale... | {
"repo_name": "simonluijk/django-localeurl",
"path": "localeurl/templatetags/localeurl_tags.py",
"copies": "3",
"size": "2531",
"license": "mit",
"hash": -6040001691587818000,
"line_mean": 28.091954023,
"line_max": 79,
"alpha_frac": 0.6661398657,
"autogenerated": false,
"ratio": 3.749629629629629... |
from django import template
from django.template import Node, Token, TemplateSyntaxError
from django.template import resolve_variable
from django.template.defaultfilters import stringfilter
from django.templatetags import future
from localeurlcustom import utils
register = template.Library()
def chlocale(url, loca... | {
"repo_name": "pyconjp/pyconjp-website",
"path": "localeurlcustom/templatetags/localeurl_tags.py",
"copies": "1",
"size": "2320",
"license": "bsd-3-clause",
"hash": 7021867027925811000,
"line_mean": 28.7435897436,
"line_max": 79,
"alpha_frac": 0.6590517241,
"autogenerated": false,
"ratio": 3.8157... |
from django import template
from django.template import Node, Variable
from django.template.base import TemplateSyntaxError
from itertools import cycle as itertools_cycle
"""{% safe_cycle %}
This tag is equivalent to {% cycle %} but resets when we exit the
containing loop.
See Django ticket "Cycle tag should reset a... | {
"repo_name": "sunlightlabs/tcamp",
"path": "tcamp/sked/templatetags/sked_tags.py",
"copies": "1",
"size": "4285",
"license": "bsd-3-clause",
"hash": -7250101853051524000,
"line_mean": 33.0079365079,
"line_max": 88,
"alpha_frac": 0.6254375729,
"autogenerated": false,
"ratio": 4.057765151515151,
... |
from django import template
from django.template import Node, Variable
from django.template import TemplateSyntaxError
from livesettings import config_value
from product.models import Product
from product.queries import bestsellers
from satchmo_utils.templatetags import get_filter_args
import keyedcache
register = tem... | {
"repo_name": "jordotech/sherri_satchmo",
"path": "satchmo/apps/product/templatetags/satchmo_product.py",
"copies": "11",
"size": "4003",
"license": "bsd-3-clause",
"hash": -4257407211097982500,
"line_mean": 26.4178082192,
"line_max": 95,
"alpha_frac": 0.6555083687,
"autogenerated": false,
"ratio... |
from django import template
from django.template import (Node, Variable, TemplateSyntaxError, Library)
from django.template.base import Parser as TokenParser
from phrase.compat import TOKEN_TEXT, TOKEN_VAR
from django.template.defaulttags import token_kwargs
from django.conf import settings
from django.utils import tra... | {
"repo_name": "phrase/django-phrase",
"path": "phrase/templatetags/phrase_i18n.py",
"copies": "1",
"size": "7582",
"license": "mit",
"hash": 6245314241592630000,
"line_mean": 37.6836734694,
"line_max": 121,
"alpha_frac": 0.6212081245,
"autogenerated": false,
"ratio": 4.325156873930405,
"config_... |
from django import template
from django.template import RequestContext
from OctaHomeCore.OctaFiles.menus.base import *
from django.template.loader import render_to_string
register = template.Library()
@register.filter
def replaceUnderscores(value):
return value.replace("_", " ")
@register.filter
def getClassName(v... | {
"repo_name": "Tomcuzz/OctaHomeAutomation",
"path": "OctaHomeCore/templatetags/my_filters.py",
"copies": "1",
"size": "1290",
"license": "mit",
"hash": 797829097768866200,
"line_mean": 28.3409090909,
"line_max": 84,
"alpha_frac": 0.7658914729,
"autogenerated": false,
"ratio": 3.3419689119170983,
... |
from django import template
from django.template import resolve_variable
from django.conf import settings
from django.db.models import Q
from django.template.defaultfilters import filesizeformat, date as date_filter
from django.utils.html import strip_spaces_between_tags
from django.utils.text import smart_split
from d... | {
"repo_name": "itavor/itavor_lib",
"path": "itavor_lib/templatetags/media_helpers.py",
"copies": "1",
"size": "9754",
"license": "bsd-3-clause",
"hash": 5665457350766730000,
"line_mean": 27.2724637681,
"line_max": 157,
"alpha_frac": 0.5625384458,
"autogenerated": false,
"ratio": 3.492302184031507... |
from django import template
from django.template import resolve_variable
from django.contrib.auth.models import Group
register = template.Library()
@register.tag()
def ifusergroup(parser, token):
""" Check to see if the currently logged in user belongs to one or more groups
Requires the Django authentication ... | {
"repo_name": "Sult/daf",
"path": "apps/users/templatetags/usergroups.py",
"copies": "3",
"size": "2134",
"license": "mit",
"hash": 7728494012320102000,
"line_mean": 31.3333333333,
"line_max": 104,
"alpha_frac": 0.6082474227,
"autogenerated": false,
"ratio": 4.550106609808102,
"config_test": fa... |
from django import template
from django.template import resolve_variable
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group
register = template.Library()
@register.simple_tag(takes_context=True)
def course_menu_active(context, url):
if reverse(url, kwargs={'pk': context['cou... | {
"repo_name": "instituteofdesign/django-lms",
"path": "libs/templatetags/courses.py",
"copies": "1",
"size": "3319",
"license": "bsd-3-clause",
"hash": 794067978938295800,
"line_mean": 30.6095238095,
"line_max": 116,
"alpha_frac": 0.6553178668,
"autogenerated": false,
"ratio": 4.211928934010152,
... |
from django import template
from django.template import resolve_variable, NodeList
from django.contrib.auth.models import User, Group
from django.utils.timesince import timesince
import datetime
register = template.Library()
@register.simple_tag
def duration( duration ):
"""
Usage: {% duration seconds %} o... | {
"repo_name": "mfitzp/smrtr",
"path": "core/templatetags/core_tags.py",
"copies": "1",
"size": "2380",
"license": "bsd-3-clause",
"hash": 2284917290241947400,
"line_mean": 25.1538461538,
"line_max": 146,
"alpha_frac": 0.5697478992,
"autogenerated": false,
"ratio": 4.190140845070423,
"config_tes... |
from django import template
from django.template import resolve_variable
register = template.Library()
from django.template import Variable
from lingcod.geographic_report.models import GeographicReport
from django.contrib.gis.measure import Area
from django.utils import simplejson
import random
@register.tag(name="geo... | {
"repo_name": "underbluewaters/marinemap",
"path": "lingcod/geographic_report/templatetags/geographic_report.py",
"copies": "3",
"size": "2619",
"license": "bsd-3-clause",
"hash": -4522563959471691300,
"line_mean": 38.1044776119,
"line_max": 140,
"alpha_frac": 0.5517373043,
"autogenerated": false,
... |
from django import template
from django.template import resolve_variable
register = template.Library()
from django.template import Variable
from madrona.geographic_report.models import GeographicReport
from django.contrib.gis.measure import Area
from django.utils import simplejson
import random
@register.tag(name="geo... | {
"repo_name": "Ecotrust/madrona_addons",
"path": "mlpa/geographic_report/templatetags/geographic_report.py",
"copies": "1",
"size": "2599",
"license": "bsd-3-clause",
"hash": 248904731566635800,
"line_mean": 37.7910447761,
"line_max": 140,
"alpha_frac": 0.5559830704,
"autogenerated": false,
"rati... |
from django import template
from django.template import resolve_variable
register = template.Library()
@register.tag(name="home_link")
def do_home_link(parser, token):
"""Provides a back button link to the home panel.
"""
tokens = token.split_contents()
print tokens
if len(tokens) == 1:
hre... | {
"repo_name": "Alwnikrotikz/marinemap",
"path": "lingcod/common/templatetags/layout_tags.py",
"copies": "3",
"size": "7545",
"license": "bsd-3-clause",
"hash": -3099925509111970300,
"line_mean": 33.6100917431,
"line_max": 160,
"alpha_frac": 0.5703114645,
"autogenerated": false,
"ratio": 3.9255983... |
from django import template
from django.template import TemplateSyntaxError
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.core.exceptions import MultipleObjectsReturned
from hitcount.models import HitCount
register = template.Library()
def get_ta... | {
"repo_name": "waaave/waaave-hitcount",
"path": "hitcount/templatetags/hitcount_tags.py",
"copies": "1",
"size": "6921",
"license": "mit",
"hash": -237400347108127330,
"line_mean": 33.605,
"line_max": 90,
"alpha_frac": 0.5650917497,
"autogenerated": false,
"ratio": 3.8991549295774646,
"config_t... |
from django import template
from django.template import TemplateSyntaxError
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from hitcount.models import HitCount
register = template.Library()
def get_target_ctype_pk(context, object_expr):
# I don't really u... | {
"repo_name": "zaebee/django-hitcount",
"path": "hitcount/templatetags/hitcount_tags.py",
"copies": "1",
"size": "6234",
"license": "mit",
"hash": -7646986462458705000,
"line_mean": 32.8804347826,
"line_max": 87,
"alpha_frac": 0.5635226179,
"autogenerated": false,
"ratio": 3.8410351201478745,
"... |
from django import template
from django.template import TemplateSyntaxError
from django.utils.safestring import mark_safe
from wagtail_personalisation.adapters import get_segment_adapter
from wagtail_personalisation.models import Segment
from wagtail_personalisation.utils import parse_tag
register = template.Library(... | {
"repo_name": "LabD/wagtail-personalisation",
"path": "src/wagtail_personalisation/templatetags/wagtail_personalisation_tags.py",
"copies": "1",
"size": "1804",
"license": "mit",
"hash": 1143585303228490800,
"line_mean": 30.1034482759,
"line_max": 71,
"alpha_frac": 0.671286031,
"autogenerated": fal... |
from django import template
from django.template import TemplateSyntaxError
from moneyed import Money
from ..models.fields import MoneyPatched
register = template.Library()
class MoneyLocalizeNode(template.Node):
def __repr__(self):
return "<MoneyLocalizeNode %r>" % self.money
def __init__(self, m... | {
"repo_name": "recklessromeo/django-money",
"path": "djmoney/templatetags/djmoney.py",
"copies": "5",
"size": "3616",
"license": "bsd-3-clause",
"hash": -2514109647041794600,
"line_mean": 28.8842975207,
"line_max": 84,
"alpha_frac": 0.560840708,
"autogenerated": false,
"ratio": 4.049272116461366,... |
from django import template
from django.template import TemplateSyntaxError
from django.utils.translation import ugettext as _
from urllib.request import urlopen
from django.core.cache import cache
register = template.Library()
class RemoteInclude(template.Node):
STALE_REFRESH = 1
STALE_CREATED = 2
ER... | {
"repo_name": "ocwc/directory",
"path": "directory/web/templatetags/remote_include.py",
"copies": "1",
"size": "2336",
"license": "apache-2.0",
"hash": -2408825894437277000,
"line_mean": 27.8395061728,
"line_max": 141,
"alpha_frac": 0.6095890411,
"autogenerated": false,
"ratio": 3.966044142614601... |
from django import template
from django.template import TemplateSyntaxError
from ella.core.models import Category
from ella.positions.models import Position
register = template.Library()
def _get_category_from_pars_var(template_var, context):
'''
get category from template variable or from tree_path
''... | {
"repo_name": "ella/ella",
"path": "ella/positions/templatetags/positions.py",
"copies": "5",
"size": "3908",
"license": "bsd-3-clause",
"hash": -6399553016671002000,
"line_mean": 30.5161290323,
"line_max": 113,
"alpha_frac": 0.6499488229,
"autogenerated": false,
"ratio": 3.908,
"config_test": ... |
from django import template
from django.template import TemplateSyntaxError
register = template.Library()
"""
The MacroRoot node (= %enablemacros% tag) functions quite similar to
the ExtendsNode from django.template.loader_tags. It will capture
everything that follows, and thus should be one of the firs... | {
"repo_name": "linkedin/indextank-service",
"path": "backoffice/templatetags/macros.py",
"copies": "2",
"size": "7293",
"license": "apache-2.0",
"hash": 7528423228109014000,
"line_mean": 42.1597633136,
"line_max": 124,
"alpha_frac": 0.6380090498,
"autogenerated": false,
"ratio": 4.341071428571428... |
from django import template
from django.template import TemplateSyntaxError, Node
from django.template.defaulttags import URLNode
from django.utils.translation import get_language
from django.core.urlresolvers import NoReverseMatch
from django.utils.encoding import smart_str
from django.conf import settings
register =... | {
"repo_name": "jjanssen/django-cms-patches",
"path": "cms/templatetags/mlurl.py",
"copies": "2",
"size": "3433",
"license": "bsd-3-clause",
"hash": 3188800964479783000,
"line_mean": 38.0113636364,
"line_max": 104,
"alpha_frac": 0.5345179144,
"autogenerated": false,
"ratio": 4.4934554973821985,
... |
from django import template
from django.template import TemplateSyntaxError, resolve_variable
register = template.Library()
def split_list(l, cols):
rows, r = divmod(len(l), cols)
rows += (r!=0)
splitted = []
for i in range(cols):
x = i*rows
y = x+rows
splitted.append(l[x:y])
... | {
"repo_name": "ella/mypage",
"path": "mypage/widgets/templatetags/splitobjectlist.py",
"copies": "1",
"size": "1549",
"license": "bsd-3-clause",
"hash": -6684723974389570000,
"line_mean": 29.3725490196,
"line_max": 131,
"alpha_frac": 0.5919948354,
"autogenerated": false,
"ratio": 3.53652968036529... |
from django import template
from django.template import Template, TemplateSyntaxError
from django.core.files.storage import FileSystemStorage
from django.forms import Widget, Textarea, ImageField, CharField
from django.conf import settings as global_settings
from django.utils.translation import ugettext_lazy as _
from ... | {
"repo_name": "google-code-export/django-page-cms",
"path": "pages/placeholders.py",
"copies": "5",
"size": "7222",
"license": "bsd-3-clause",
"hash": -4223765650593001000,
"line_mean": 35.8469387755,
"line_max": 84,
"alpha_frac": 0.5582941014,
"autogenerated": false,
"ratio": 4.635430038510911,
... |
from django import template
from django.template import Template, Variable, TemplateSyntaxError
from django.utils import timezone
from django.core.cache import cache
from itertools import chain
from pastes.models import Paste, PasteReport
from comments.models import Comment
import humanfriendly
import datetime
impo... | {
"repo_name": "Matoking/pastebin-django",
"path": "pastebin/templatetags/extra_tags.py",
"copies": "1",
"size": "6694",
"license": "unlicense",
"hash": -8427023367666680000,
"line_mean": 31.5,
"line_max": 136,
"alpha_frac": 0.6363907977,
"autogenerated": false,
"ratio": 4.266411727214787,
"conf... |
from django import template
from django.template import VariableDoesNotExist
from django.utils import six
from rollyourown.seo.base import get_metadata, get_linked_metadata
register = template.Library()
class MetadataNode(template.Node):
def __init__(self, metadata_name, variable_name, target, site, language):
... | {
"repo_name": "wx-ast/django-seo",
"path": "rollyourown/seo/templatetags/seo.py",
"copies": "1",
"size": "3995",
"license": "bsd-3-clause",
"hash": -1380598744746613500,
"line_mean": 34.990990991,
"line_max": 130,
"alpha_frac": 0.5817271589,
"autogenerated": false,
"ratio": 4.25,
"config_test":... |
from django import template
from django.template import Variable, TemplateSyntaxError
from django.template.loader import render_to_string
from ..mixins import CompositeTemplateHintProvider
register = template.Library()
class RenderComponentNode(template.Node):
'''
{% render_component %} template tag. It tak... | {
"repo_name": "team23/django_mc",
"path": "django_mc/templatetags/django_mc_component_tags.py",
"copies": "1",
"size": "3438",
"license": "bsd-3-clause",
"hash": -4677077912936554000,
"line_mean": 35.5744680851,
"line_max": 94,
"alpha_frac": 0.6553228621,
"autogenerated": false,
"ratio": 4.505897... |
from django import template
from django.template import Variable, VariableDoesNotExist
from django.utils.safestring import mark_safe
from news.models import Collection
register = template.Library()
class CollectionLatestNode(template.Node):
def __init__(self, url, limit, varname):
self.url = url
... | {
"repo_name": "caiges/populous",
"path": "populous/news/templatetags/collections.py",
"copies": "1",
"size": "2018",
"license": "bsd-3-clause",
"hash": 2766728254985106000,
"line_mean": 37.8076923077,
"line_max": 274,
"alpha_frac": 0.5941526264,
"autogenerated": false,
"ratio": 4.266384778012685,... |
from django import template
from django.template import Variable, VariableDoesNotExist
from django.utils.safestring import mark_safe
from topics.models import TopicCollection
register = template.Library()
class TopicCollectionNode(template.Node):
def __init__(self, num=None, varname='topic_collection'):
... | {
"repo_name": "caiges/populous",
"path": "populous/topics/templatetags/topic_tags.py",
"copies": "1",
"size": "1868",
"license": "bsd-3-clause",
"hash": -2885681651322770000,
"line_mean": 35.6274509804,
"line_max": 126,
"alpha_frac": 0.6204496788,
"autogenerated": false,
"ratio": 4.54501216545012... |
from django import template
from django.template.loader import get_template
from django.conf import settings
from ..models import NavigationTree, NavigationItem
register = template.Library()
class NavigationTreeNode(template.Node):
tree_name = None
user = None
def __init__(self, tree_name, user):
... | {
"repo_name": "LimpidTech/django-navigen",
"path": "navigen/templatetags/nav.py",
"copies": "1",
"size": "2829",
"license": "mit",
"hash": 5774778369005517000,
"line_mean": 27.29,
"line_max": 113,
"alpha_frac": 0.6076352068,
"autogenerated": false,
"ratio": 4.024182076813656,
"config_test": fal... |
from django import template
from django.template.loader import get_template
from django.conf import settings
import tokenize
import StringIO
register = template.Library()
class CallNode(template.Node):
def __init__(self, template_name, *args, **kwargs):
self.template_name = template_name
self.args =... | {
"repo_name": "makiwara/ensography",
"path": "ensography/utils/templatetags/includes.py",
"copies": "2",
"size": "2051",
"license": "mit",
"hash": -7378432842101854000,
"line_mean": 28.7391304348,
"line_max": 99,
"alpha_frac": 0.5436372501,
"autogenerated": false,
"ratio": 3.9748062015503876,
"... |
from django import template
from django.template.loader import get_template
from django.core.files.storage import get_storage_class
from .. import settings
register = template.Library()
@register.simple_tag
def get_favicons(prefix=None):
"""
Generate HTML to include in headers for get all favicons url.
... | {
"repo_name": "ryankaiser/django-super-favicon",
"path": "favicon/templatetags/favicon.py",
"copies": "1",
"size": "1040",
"license": "bsd-3-clause",
"hash": 2955340356292771000,
"line_mean": 25,
"line_max": 77,
"alpha_frac": 0.6798076923,
"autogenerated": false,
"ratio": 3.9245283018867925,
"c... |
from django import template
from django.template.loader import get_template
from django.core.urlresolvers import reverse
from xcblog.models import BlogCategory, BlogPost
register = template.Library()
class BlogCategoryList(template.Node):
def render(self, context):
categories = BlogCategory.objects.all()... | {
"repo_name": "zigoni/xcblog",
"path": "templatetags/siderbar.py",
"copies": "1",
"size": "1063",
"license": "bsd-2-clause",
"hash": 3470736482949049000,
"line_mean": 33.2903225806,
"line_max": 108,
"alpha_frac": 0.6989651929,
"autogenerated": false,
"ratio": 3.9080882352941178,
"config_test": ... |
from django import template
from django.template.loader import get_template
from django.template.base import FilterExpression
from ..sitetreeapp import get_sitetree
register = template.Library()
# All utility methods are implemented in SiteTree class
sitetree = get_sitetree()
@register.tag
def sitetree_tree(parser,... | {
"repo_name": "ikresoft/django-sitetree",
"path": "sitetree/templatetags/sitetree.py",
"copies": "1",
"size": "10685",
"license": "bsd-3-clause",
"hash": 6238557674001475000,
"line_mean": 34.7357859532,
"line_max": 179,
"alpha_frac": 0.6643893308,
"autogenerated": false,
"ratio": 3.85600866113316... |
from django import template
from django.template.loader import get_template
from django.template.base import FilterExpression
from ..sitetreeapp import get_sitetree
register = template.Library()
# All utility methods are implemented in SiteTree class
sitetree = get_sitetree()
@register.tag
def sitetree_tree(parser... | {
"repo_name": "RamezIssac/django-sitetree",
"path": "sitetree/templatetags/sitetree.py",
"copies": "3",
"size": "10842",
"license": "bsd-3-clause",
"hash": -4599901398827104000,
"line_mean": 33.75,
"line_max": 116,
"alpha_frac": 0.6569821066,
"autogenerated": false,
"ratio": 3.8624866405415035,
... |
from django import template
from django.template.loader import get_template
from django.template.base import VariableDoesNotExist
register = template.Library()
#
# Nodes
#
def templatePath(name):
return "datable/templatetags/%s.html" % name
def widgetTemplatePath(name):
return "datable/templatetags/widget... | {
"repo_name": "ehudmagal/robotqcapp",
"path": "datable/templatetags/datable_tags.py",
"copies": "1",
"size": "6650",
"license": "bsd-3-clause",
"hash": -8566171323549393000,
"line_mean": 27.6637931034,
"line_max": 79,
"alpha_frac": 0.6332330827,
"autogenerated": false,
"ratio": 3.937240970988751,... |
from django import template
from django.template.loader import get_template
from django.template import Library, loader, Context
register = template.Library()
from qpage.models import *
from qmaterial.models import *
from qcms.models import *
HTML_LIST = {
'文章': 'article.html',
'图片': 'media.html',
'轮播': ... | {
"repo_name": "gzqichang/wa",
"path": "qsite/qsite/templatetags/widgets_tag.py",
"copies": "1",
"size": "1407",
"license": "mit",
"hash": 4436221784831646700,
"line_mean": 28.5106382979,
"line_max": 74,
"alpha_frac": 0.6575342466,
"autogenerated": false,
"ratio": 3.342168674698795,
"config_test... |
from django import template
from django.template.loader import get_template
from django.utils.translation import ugettext_lazy as _
from waldur_mastermind.marketplace import plugins
from .. import models
register = template.Library()
@register.simple_tag
def get_invoice_item_component_amount(item, component):
... | {
"repo_name": "opennode/waldur-mastermind",
"path": "src/waldur_mastermind/marketplace/templatetags/waldur_marketplace.py",
"copies": "1",
"size": "1987",
"license": "mit",
"hash": 970760259456123600,
"line_mean": 31.0483870968,
"line_max": 87,
"alpha_frac": 0.6618017111,
"autogenerated": false,
... |
from django import template
from django.template.loader import get_template
from kc_user.config import KC_MANAGED_APPS
register = template.Library()
class KcUserManagementLoader(template.Node):
def render(self, context):
u = context['user']
output = ''
for app_name in KC_MANAGED_APPS:
... | {
"repo_name": "zigoni/KanColle.tv",
"path": "kc/kc_user/templatetags/KcUserTags.py",
"copies": "1",
"size": "1035",
"license": "mit",
"hash": 8408885927386868000,
"line_mean": 25.5641025641,
"line_max": 63,
"alpha_frac": 0.6202898551,
"autogenerated": false,
"ratio": 3.5689655172413794,
"config... |
from django import template
from django.template.loader import get_template
import itertools
register = template.Library()
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return itertools.izip_longest(fillvalue=fillvalue, *args)
@registe... | {
"repo_name": "alixedi/django_reform",
"path": "reform/templatetags/reform.py",
"copies": "1",
"size": "1627",
"license": "bsd-3-clause",
"hash": -1983321310183687000,
"line_mean": 33.6170212766,
"line_max": 74,
"alpha_frac": 0.6459741856,
"autogenerated": false,
"ratio": 3.8372641509433962,
"c... |
from django import template
from django.template.loader import get_template
from molly.maps import map_from_point
register = template.Library()
class MapDisplayNode(template.Node):
"""
Node to display a more complex map from a @C{molly.maps.Map} object
"""
def __init__(self, map, force_static):
... | {
"repo_name": "mollyproject/mollyproject",
"path": "molly/maps/templatetags/molly_maps.py",
"copies": "1",
"size": "3124",
"license": "apache-2.0",
"hash": 463529140415231800,
"line_mean": 29.6274509804,
"line_max": 80,
"alpha_frac": 0.5864276569,
"autogenerated": false,
"ratio": 4.27945205479452... |
from django import template
from django.template.loader import get_template
from wagtail.wagtailimages.models import Image
from menu.models import Menu, MainFooterText, SecondaryFooterText
from home.models import HomePage
register = template.Library()
def logo():
image = Image.objects.filter(tags__name__in=["na... | {
"repo_name": "Ecotrust/F2S-MOI",
"path": "moi/menu/templatetags/menu_tag.py",
"copies": "1",
"size": "1087",
"license": "apache-2.0",
"hash": -6951897567824688000,
"line_mean": 24.3023255814,
"line_max": 67,
"alpha_frac": 0.7010119595,
"autogenerated": false,
"ratio": 3.54071661237785,
"config... |
from django import template
from django.template.loader import get_template
from widget_tweaks.templatetags.widget_tweaks import append_attr
from geelweb.django.twitter_bootstrap_form import settings
register = template.Library()
@register.filter
def twitter_bootstrap(element, args=""):
"""
valid layouts ar... | {
"repo_name": "geelweb/django-twitter-bootstrap-form",
"path": "src/geelweb/django/twitter_bootstrap_form/templatetags/twitter_bootstrap.py",
"copies": "1",
"size": "2354",
"license": "mit",
"hash": -906671517519287300,
"line_mean": 30.3866666667,
"line_max": 83,
"alpha_frac": 0.6236193713,
"autoge... |
from django import template
from django.template.loader import get_template
register = template.Library()
@register.inclusion_tag("skin/nav_item.html", takes_context=True)
def navitem(context, slug, url, text):
return {
'url': url,
'text': text,
'active': slug in context['nav'] if 'nav' i... | {
"repo_name": "Kvoti/ditto",
"path": "ditto/skin/templatetags/skin.py",
"copies": "1",
"size": "2334",
"license": "bsd-3-clause",
"hash": 3105539108118585000,
"line_mean": 29.3116883117,
"line_max": 75,
"alpha_frac": 0.619108826,
"autogenerated": false,
"ratio": 4.066202090592334,
"config_test"... |
from django import template
from django.template.loader import render_to_string
from commitment.models import Commitment
from commitment.forms import CommitmentForm
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from etc.view_helpers import url_with_qs
from djang... | {
"repo_name": "jumoconnect/openjumo",
"path": "jumodjango/commitment/templatetags/commitment_tags.py",
"copies": "1",
"size": "2203",
"license": "mit",
"hash": 4115741149716303400,
"line_mean": 49.0681818182,
"line_max": 154,
"alpha_frac": 0.660463005,
"autogenerated": false,
"ratio": 3.605564648... |
from django import template
from django.template.loader import render_to_string
from django_comments.templatetags.comments import BaseCommentNode
from gamernews.vendor import django_comments as comments
from ..util import annotate_tree_properties, fill_tree as real_fill_tree
register = template.Library()
class BaseT... | {
"repo_name": "underlost/GamerNews",
"path": "gamernews/apps/threadedcomments/templatetags/threadedcomments_tags.py",
"copies": "1",
"size": "13506",
"license": "mit",
"hash": -4108084356458824000,
"line_mean": 34.171875,
"line_max": 124,
"alpha_frac": 0.5737450022,
"autogenerated": false,
"ratio... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib import comments
from django.utils.encoding import smart_text
register = template.Library()
class BaseCommentNode(template.Node... | {
"repo_name": "bocaaust/FreshLife",
"path": "django_project/env/lib/python2.7/site-packages/django/contrib/comments/templatetags/comments.py",
"copies": "104",
"size": "11719",
"license": "apache-2.0",
"hash": 1812529219525739000,
"line_mean": 34.2981927711,
"line_max": 127,
"alpha_frac": 0.611485621... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.shortcuts import get_current_site
from django.utils.encoding import smart_text
import django_comments
register = templat... | {
"repo_name": "steventimberman/masterDebater",
"path": "venv/lib/python2.7/site-packages/django_comments/templatetags/comments.py",
"copies": "1",
"size": "12167",
"license": "mit",
"hash": -2025014977993293000,
"line_mean": 33.3700564972,
"line_max": 119,
"alpha_frac": 0.6132160763,
"autogenerated... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import HttpResponse, Http404
from django.template import RequestContext
from django.utils.encoding import smart_text
from django.ut... | {
"repo_name": "radiantflow/django-comments",
"path": "comments/templatetags/comments_tags.py",
"copies": "1",
"size": "13632",
"license": "bsd-3-clause",
"hash": 5952954236640658000,
"line_mean": 33.7755102041,
"line_max": 137,
"alpha_frac": 0.6141431925,
"autogenerated": false,
"ratio": 4.137177... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import smart_text
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
import ... | {
"repo_name": "citizenline/citizenline",
"path": "bettertexts/templatetags/bettertexts.py",
"copies": "1",
"size": "1712",
"license": "mit",
"hash": -5396766184472592000,
"line_mean": 30.7037037037,
"line_max": 111,
"alpha_frac": 0.6939252336,
"autogenerated": false,
"ratio": 3.935632183908046,
... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
import comments
from django.utils.encoding import smart_unicode
from comments.util import annotate_tree_properties, fill_tree
register = template.L... | {
"repo_name": "vosi/django-xcomments",
"path": "comments/templatetags/comments_tags.py",
"copies": "1",
"size": "11825",
"license": "bsd-3-clause",
"hash": 2337173674964894700,
"line_mean": 36.5396825397,
"line_max": 133,
"alpha_frac": 0.56794926,
"autogenerated": false,
"ratio": 4.08745247148289... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
import crowdsource
from crowdsource.models import CrowdSourcedEntry
register = template.Library()
class CrowdSourcedEntryFormNode(template.Node):... | {
"repo_name": "rmanocha/django-crowdsource",
"path": "crowdsource/templatetags/crowdsource_tags.py",
"copies": "1",
"size": "5724",
"license": "bsd-3-clause",
"hash": -4840482716748418000,
"line_mean": 38.75,
"line_max": 137,
"alpha_frac": 0.6221174004,
"autogenerated": false,
"ratio": 3.88858695... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.http import Http404
from classytags.core import Options
from classytags.arguments import Argument
from classytags.helpers import InclusionTag
from pulpo_forms.models import Form
from pulpo_form... | {
"repo_name": "pulpocoders/pulpo-forms-django",
"path": "templatetags/visor_tag.py",
"copies": "2",
"size": "1597",
"license": "apache-2.0",
"hash": -4677301294417025000,
"line_mean": 29.1320754717,
"line_max": 72,
"alpha_frac": 0.6299311209,
"autogenerated": false,
"ratio": 4.0636132315521625,
... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from ietf.community.models import CommunityList
from ietf.group.models import Role
register = template.Library()
@register.assignment_tag
def get_user_managed_lists(user):
if not (user and hasattr(us... | {
"repo_name": "wpjesus/codematch",
"path": "ietf/community/templatetags/community_tags.py",
"copies": "1",
"size": "1661",
"license": "bsd-3-clause",
"hash": 2346154630091669000,
"line_mean": 35.9111111111,
"line_max": 178,
"alpha_frac": 0.6465984347,
"autogenerated": false,
"ratio": 3.5567451820... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from ..utils import get_tag_id, set_lazy_tag_data
register = template.Library()
@register.simple_tag
def lazy_tag(tag, *args, **kwargs):
"""
Lazily loads a template tag after the page has loaded... | {
"repo_name": "grantmcconnaughey/django-lazy-tags",
"path": "lazy_tags/templatetags/lazy_tags.py",
"copies": "1",
"size": "2029",
"license": "mit",
"hash": -5348873240118263000,
"line_mean": 27.5774647887,
"line_max": 77,
"alpha_frac": 0.6416954165,
"autogenerated": false,
"ratio": 3.629695885509... |
from django import template
from django.template.loader import render_to_string
from django.contrib.admin.views.main import ALL_VAR, PAGE_VAR, SEARCH_VAR
register = template.Library()
def paginator_number(cl, i):
if i == cl.page_num:
classname = "active"
else:
classname = "inactive"
return... | {
"repo_name": "bennylope/django-mobileadmin",
"path": "mobileadmin/templatetags/mobile_admin_list.py",
"copies": "2",
"size": "3027",
"license": "bsd-3-clause",
"hash": -5556238634950060000,
"line_mean": 36.8375,
"line_max": 111,
"alpha_frac": 0.603567889,
"autogenerated": false,
"ratio": 3.41647... |
from django import template
from django.template.loader import render_to_string
from django.contrib.comments.templatetags.comments import BaseCommentNode
from django.contrib import comments
from threadedcomments.util import annotate_tree_properties, fill_tree as real_fill_tree
register = template.Library()
class Base... | {
"repo_name": "PolicyStat/django-threadedcomments",
"path": "threadedcomments/templatetags/threadedcomments_tags.py",
"copies": "3",
"size": "13508",
"license": "bsd-3-clause",
"hash": -3594772989752099000,
"line_mean": 34.2689295039,
"line_max": 124,
"alpha_frac": 0.5740302043,
"autogenerated": fa... |
from django import template
from django.template.loader import render_to_string
from django.contrib.comments.templatetags.comments import BaseCommentNode
from django.contrib import comments
register = template.Library()
class BaseThreadedCommentNode(BaseCommentNode):
def __init__(self, parent=None, **kwargs):
... | {
"repo_name": "theju/django-comments-apps",
"path": "threaded_comments/templatetags/threaded_comments.py",
"copies": "1",
"size": "8747",
"license": "mit",
"hash": 8215808644488988000,
"line_mean": 41.0528846154,
"line_max": 133,
"alpha_frac": 0.5756259289,
"autogenerated": false,
"ratio": 4.1298... |
from django import template
from django.template.loader import render_to_string
from django.contrib.contenttypes.models import ContentType as CT
from django.core.urlresolvers import reverse
from valuate.models import Valuation, ValuationType as VT
from valuate.forms import ValuationForm
register = template.Library()
V... | {
"repo_name": "crodjer/django-valuate",
"path": "valuate/templatetags/valuation.py",
"copies": "1",
"size": "8004",
"license": "bsd-3-clause",
"hash": 579933960492248600,
"line_mean": 38.043902439,
"line_max": 170,
"alpha_frac": 0.5842078961,
"autogenerated": false,
"ratio": 4.282504012841091,
... |
from django import template
from django.template.loader import render_to_string
from django.contrib.contenttypes.models import ContentType
from favorite.models import Favorite
register = template.Library()
@register.simple_tag(takes_context=True)
def favorite_button(context, target):
user = context['request'].us... | {
"repo_name": "s1n4/django-favorite",
"path": "favorite/templatetags/favorite_tags.py",
"copies": "1",
"size": "1167",
"license": "mit",
"hash": 740653171713096600,
"line_mean": 39.2413793103,
"line_max": 96,
"alpha_frac": 0.6520994002,
"autogenerated": false,
"ratio": 3.9965753424657535,
"conf... |
from django import template
from django.template.loader import render_to_string
from django.contrib.contenttypes.models import ContentType
from portal.updates.models import Update
register = template.Library()
class BaseUpdateNode(template.Node):
"""
Base helper class (abstract) for handling the get_update_*... | {
"repo_name": "brunogamacatao/portalsaladeaula",
"path": "portal/updates/templatetags/updates.py",
"copies": "1",
"size": "8076",
"license": "bsd-3-clause",
"hash": -4711227779869503000,
"line_mean": 34.7389380531,
"line_max": 126,
"alpha_frac": 0.607850421,
"autogenerated": false,
"ratio": 4.068... |
from django import template
from django.template.loader import render_to_string
from django.contrib.contenttypes.models import ContentType
import logging
register = template.Library()
logger = logging.getLogger(__name__)
class RenderComments(template.Node):
def __init__(self, object_expr, template):
se... | {
"repo_name": "dpetzold/django-yacapp",
"path": "yacapp/templatetags/yacapp_tags.py",
"copies": "1",
"size": "2089",
"license": "bsd-3-clause",
"hash": -7821592533356199000,
"line_mean": 29.7205882353,
"line_max": 110,
"alpha_frac": 0.5974150311,
"autogenerated": false,
"ratio": 4.379454926624738... |
from django import template
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
import jinja2
from ..forms import AttachmentForm
from ..models import Attachment
from ..views import add_url_for_obj
register = template.Library()
@register.tag(name="active_link_class")
de... | {
"repo_name": "phani00/tovp",
"path": "tovp/attachments/templatetags/attachments_tags.py",
"copies": "2",
"size": "2151",
"license": "mit",
"hash": -6277613967665925000,
"line_mean": 31.5909090909,
"line_max": 77,
"alpha_frac": 0.6759646676,
"autogenerated": false,
"ratio": 4.0356472795497185,
... |
from django import template
from django.template.loader import render_to_string
from djangopress.pages.models import PageBlock
register = template.Library()
def do_placeholder(parser, token):
args = token.split_contents()
nodelist = None
if len(args) < 2:
raise template.TemplateSyntaxError("not eno... | {
"repo_name": "codefisher/djangopress",
"path": "djangopress/pages/templatetags/pages_tags.py",
"copies": "1",
"size": "1775",
"license": "mit",
"hash": 994395627087855600,
"line_mean": 35.2244897959,
"line_max": 99,
"alpha_frac": 0.6129577465,
"autogenerated": false,
"ratio": 4.216152019002375,
... |
from django import template
from django.template.loader import render_to_string
from django.template.base import TemplateSyntaxError
from django.utils.encoding import force_text
from tinycontent.models import TinyContent
register = template.Library()
class TinyContentNode(template.Node):
def __init__(self, args,... | {
"repo_name": "watchdogpolska/django-tinycontent",
"path": "tinycontent/templatetags/tinycontent_tags.py",
"copies": "1",
"size": "2083",
"license": "bsd-3-clause",
"hash": 7825132044029068000,
"line_mean": 33.1475409836,
"line_max": 72,
"alpha_frac": 0.5924147864,
"autogenerated": false,
"ratio"... |
from django import template
from django.template.loader import render_to_string
from django.template.defaultfilters import slugify
from basic.tools.templatetags.utils import parse_ttag
register = template.Library()
class RenderTemplateNode(template.Node):
def __init__(self, object_name, template_dir):
s... | {
"repo_name": "TheFrameworkGame/blog-python-django-basic",
"path": "basic/tools/templatetags/objectutils.py",
"copies": "11",
"size": "1680",
"license": "bsd-3-clause",
"hash": 4708574252238470000,
"line_mean": 32.6,
"line_max": 93,
"alpha_frac": 0.6196428571,
"autogenerated": false,
"ratio": 4.0... |
from django import template
from django.template.loader import render_to_string
from django.template.defaultfilters import stringfilter
from django.db.models import Model
from django.utils.safestring import mark_safe
register = template.Library()
BASE_PATH = 'render'
class RenderObjectNode(template.Node):
def __... | {
"repo_name": "Nomadblue/django-nomad-activity-feed",
"path": "feeds/templatetags/feed_tags.py",
"copies": "1",
"size": "4916",
"license": "bsd-3-clause",
"hash": 7149604382059127000,
"line_mean": 38.328,
"line_max": 89,
"alpha_frac": 0.6381204231,
"autogenerated": false,
"ratio": 4.2897033158813... |
from django import template
from django.template.loader import render_to_string
from django.template.defaultfilters import stringfilter
from django.utils.translation import gettext_lazy
register = template.Library()
@register.simple_tag
def devilry_student_shortgrade(feedback):
"""
Takes a :class:`devilry.ap... | {
"repo_name": "devilry/devilry-django",
"path": "devilry/devilry_student/templatetags/devilry_student_tags.py",
"copies": "1",
"size": "1471",
"license": "bsd-3-clause",
"hash": 7938270446269612000,
"line_mean": 36.7179487179,
"line_max": 91,
"alpha_frac": 0.7104010877,
"autogenerated": false,
"r... |
from django import template
from django.template.loader import render_to_string
from django.template import RequestContext
from wheelcms_axle.access import has_access
from wheelcms_axle.utils import get_active_language
from wheelcms_comments.models import CommentForm, Comment
register = template.Library()
@register... | {
"repo_name": "wheelcms/wheelcms_comments",
"path": "wheelcms_comments/templatetags/wheel_comments.py",
"copies": "1",
"size": "2070",
"license": "bsd-2-clause",
"hash": -61448685587906160,
"line_mean": 33.5,
"line_max": 75,
"alpha_frac": 0.6164251208,
"autogenerated": false,
"ratio": 4.470842332... |
from django import template
from django.template.loader import render_to_string
from django.templatetags.static import static
from classytags.helpers import InclusionTag
from pulpo_forms.fieldtypes import FieldFactory
register = template.Library()
class fields_assets_block(InclusionTag):
template = 'asset_bloc... | {
"repo_name": "octobot-dev/pulpo-forms-django",
"path": "templatetags/load_fields_assets.py",
"copies": "2",
"size": "1900",
"license": "apache-2.0",
"hash": 7791100102227162000,
"line_mean": 34.8490566038,
"line_max": 79,
"alpha_frac": 0.6168421053,
"autogenerated": false,
"ratio": 3.98322851153... |
from django import template
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from corehq.apps.domain.models import Domain
import corehq.apps.style.utils as style_utils
import corehq
from corehq.apps.hqwebapp.models import Mainte... | {
"repo_name": "benrudolph/commcare-hq",
"path": "corehq/apps/hqwebapp/templatetags/menu_tags.py",
"copies": "1",
"size": "5738",
"license": "bsd-3-clause",
"hash": 4445758548892424000,
"line_mean": 34.4197530864,
"line_max": 102,
"alpha_frac": 0.5670965493,
"autogenerated": false,
"ratio": 4.1310... |
from django import template
from django.template.loader import render_to_string
from django.utils import six
from django.utils.html import mark_safe
import re
register = template.Library()
@register.filter
def form_style_horizontal(form):
c = {}
c['form'] = form
return render_to_string('tag-form-horizon... | {
"repo_name": "nirvaris/nirvaris-theme-default",
"path": "themedefault/templatetags/theme_form_tags.py",
"copies": "1",
"size": "1733",
"license": "mit",
"hash": -4140872060715978000,
"line_mean": 23.0694444444,
"line_max": 92,
"alpha_frac": 0.6376226197,
"autogenerated": false,
"ratio": 3.173992... |
from django import template
from django.template.loader import render_to_string
from django.utils import translation
from wagtail.admin.userbar import (
AddPageItem, AdminItem, ApproveModerationEditPageItem, EditPageItem, ExplorePageItem,
RejectModerationEditPageItem)
from wagtail.core import hooks
from wagtai... | {
"repo_name": "wagtail/wagtail",
"path": "wagtail/admin/templatetags/wagtailuserbar.py",
"copies": "7",
"size": "3167",
"license": "bsd-3-clause",
"hash": 3921862963703883300,
"line_mean": 32.6914893617,
"line_max": 92,
"alpha_frac": 0.6113040733,
"autogenerated": false,
"ratio": 4.39861111111111... |
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from boxes.models import Box
register = template.Library()
class BoxNode(template.Node):
@classmethod
def handle_token(cls, parser, token):
bits = token.split_contents(... | {
"repo_name": "mitsuhiko/pycon",
"path": "pycon_project/apps/boxes/templatetags/boxes_tags.py",
"copies": "1",
"size": "1505",
"license": "bsd-3-clause",
"hash": 8044960332128349000,
"line_mean": 26.8703703704,
"line_max": 65,
"alpha_frac": 0.5634551495,
"autogenerated": false,
"ratio": 4.1120218... |
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from corehq.apps.domain.models import Domain
import corehq.apps.style.utils as style_utils
import corehq
register = template.Library()
class MainMenuNode(template.Node):
def render(self,... | {
"repo_name": "SEL-Columbia/commcare-hq",
"path": "corehq/apps/hqwebapp/templatetags/menu_tags.py",
"copies": "1",
"size": "5156",
"license": "bsd-3-clause",
"hash": 2900269954249088000,
"line_mean": 34.5586206897,
"line_max": 85,
"alpha_frac": 0.564197052,
"autogenerated": false,
"ratio": 4.1380... |
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from corehq.apps.domain.models import Domain
import corehq
register = template.Library()
class MainMenuNode(template.Node):
def render(self, context):
request = context['request'... | {
"repo_name": "gmimano/commcaretest",
"path": "corehq/apps/hqwebapp/templatetags/menu_tags.py",
"copies": "1",
"size": "4522",
"license": "bsd-3-clause",
"hash": -3160269463501931500,
"line_mean": 34.328125,
"line_max": 85,
"alpha_frac": 0.5643520566,
"autogenerated": false,
"ratio": 4.2065116279... |
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from corehq.tabs.config import MENU_TABS
from corehq.tabs.exceptions import TabClassError, TabClassErrorSummary
from corehq.tabs.utils import path_starts_with_url
register = template.Library(... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/tabs/templatetags/menu_tags.py",
"copies": "1",
"size": "4329",
"license": "bsd-3-clause",
"hash": 8224445408648840000,
"line_mean": 31.3059701493,
"line_max": 88,
"alpha_frac": 0.5825825826,
"autogenerated": false,
"ratio": 4.1505273250239... |
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from ..settings import DJTEMPLATEFORMS_DEFAULT_TEMPLATE as DEFAULT_TEMPLATE
register = template.Library()
@register.simple_tag
def form(form_class, **field_extras):
"""Renderiza un form ... | {
"repo_name": "snicoper/snicoper.com",
"path": "src/apps/djtemplateforms/templatetags/djtemplateforms_tags.py",
"copies": "1",
"size": "3310",
"license": "mit",
"hash": 1682500199318827800,
"line_mean": 33.4479166667,
"line_max": 89,
"alpha_frac": 0.661929241,
"autogenerated": false,
"ratio": 3.6... |
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag
def attr_list(obj):
'''
In templates
{% load utility_tags %}
{% attr_list object_to_inspect %}
'''
html = ''
for item in dir(obj):
... | {
"repo_name": "JacekKarnasiewicz/HomePage",
"path": "HomePage/templatetags/utility_tags.py",
"copies": "1",
"size": "1403",
"license": "mit",
"hash": -79598494849970540,
"line_mean": 24.9814814815,
"line_max": 76,
"alpha_frac": 0.6664290805,
"autogenerated": false,
"ratio": 3.036796536796537,
"... |
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag(takes_context=True)
def template_snippet(context, identifier, page, editing_type='inline'):
content = page._snippets.get(identifier, '')... | {
"repo_name": "allink/allink-frontend-editor",
"path": "allink_frontend_editor/templatetags/frontend_editor_tags.py",
"copies": "1",
"size": "1092",
"license": "bsd-3-clause",
"hash": -1340787560058947800,
"line_mean": 38,
"line_max": 254,
"alpha_frac": 0.6886446886,
"autogenerated": false,
"rati... |
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
register = template.Library()
@register.tag
def insert_activity(parser, token):
try:
tag_name, activity = token.split_contents()
except ValueError:
raise template.Templ... | {
"repo_name": "aspc/mainsite",
"path": "aspc/activityfeed/templatetags/activityfeed.py",
"copies": "1",
"size": "2105",
"license": "mit",
"hash": -6008224437831259000,
"line_mean": 38,
"line_max": 122,
"alpha_frac": 0.6370546318,
"autogenerated": false,
"ratio": 3.6355785837651124,
"config_test... |
from django import template
from django.template.loader import render_to_string
from feincms import settings as feincms_settings
from feincms import utils
register = template.Library()
def _render_content(content, **kwargs):
# Track current render level and abort if we nest too deep. Avoids
# crashing in r... | {
"repo_name": "hgrimelid/feincms",
"path": "feincms/templatetags/feincms_tags.py",
"copies": "1",
"size": "4251",
"license": "bsd-3-clause",
"hash": -2390337145707695000,
"line_mean": 31.4503816794,
"line_max": 108,
"alpha_frac": 0.6607856975,
"autogenerated": false,
"ratio": 3.7652790079716563,
... |
from django import template
from django.template.loader import render_to_string
from livesettings import config_value
from satchmo_ext.productratings.utils import get_product_rating_string, get_product_rating
import logging
log = logging.getLogger('shop.templatetags')
register = template.Library()
def product_rating... | {
"repo_name": "russellmayhew/satchmo",
"path": "satchmo/apps/satchmo_ext/productratings/templatetags/satchmo_ratings.py",
"copies": "6",
"size": "1491",
"license": "bsd-3-clause",
"hash": -167568495366453120,
"line_mean": 35.3658536585,
"line_max": 106,
"alpha_frac": 0.7350771294,
"autogenerated": ... |
from django import template
from django.template.loader import render_to_string
from reporting import helpers
from django.core.urlresolvers import reverse
from django.conf import settings
register = template.Library()
class RenderNode(template.Node):
def __init__(self, obj):
self.obj = template.Variable(... | {
"repo_name": "praekelt/ummeli",
"path": "ummeli/vlive/templatetags/opportunities_tags.py",
"copies": "1",
"size": "2498",
"license": "bsd-3-clause",
"hash": -4466801328010466300,
"line_mean": 36.8484848485,
"line_max": 108,
"alpha_frac": 0.7113690953,
"autogenerated": false,
"ratio": 3.646715328... |
from django import template
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':
from django.contrib.comments.te... | {
"repo_name": "nikolas/django-threadedcomments",
"path": "threadedcomments/templatetags/threadedcomments_tags.py",
"copies": "2",
"size": "14077",
"license": "bsd-3-clause",
"hash": 6709846489973205000,
"line_mean": 34.1925,
"line_max": 124,
"alpha_frac": 0.5774667898,
"autogenerated": false,
"ra... |
from django import template
from django.template.loader import render_to_string
from django.conf import settings
from ..favourites.models import Collection
from ..favourites.utils import get_shortcut
register = template.Library()
def _render_item(item, custom_template):
template = [custom_template % {"app_label... | {
"repo_name": "gregplaysguitar/glamkit",
"path": "glamkit/incubated/favourites/templatetags/favourites.py",
"copies": "1",
"size": "3473",
"license": "bsd-3-clause",
"hash": -7755940920098509000,
"line_mean": 35.1770833333,
"line_max": 150,
"alpha_frac": 0.6582205586,
"autogenerated": false,
"rat... |
from django import template
from django.template.loader import render_to_string
from google.appengine.api import datastore_errors
from feedback.models import Feedback, Vote
from feedback.forms import FeedbackForm
from feedback.views import get_already_voted
register = template.Library()
@register.simple_tag
def fe... | {
"repo_name": "jcrocholl/nxdom",
"path": "feedback/templatetags/feedback_tags.py",
"copies": "1",
"size": "1757",
"license": "mit",
"hash": -3423570319640017400,
"line_mean": 26.8888888889,
"line_max": 69,
"alpha_frac": 0.6789982925,
"autogenerated": false,
"ratio": 3.714587737843552,
"config_t... |
from django import template
from django.template.loader import render_to_string
from helpers.templatetags.frontend_extras import glyphicon, octicon
register = template.Library()
@register.simple_tag
def bs_field(field, icon=None, icon_type='octicon'):
if icon:
if icon_type == 'glyphicon':
ic... | {
"repo_name": "Kromey/fbxnano",
"path": "helpers/templatetags/form_extras.py",
"copies": "2",
"size": "1115",
"license": "mit",
"hash": -1214802550011446000,
"line_mean": 27.5897435897,
"line_max": 79,
"alpha_frac": 0.6116591928,
"autogenerated": false,
"ratio": 3.8850174216027873,
"config_test... |
from django import template
from django.template.loader import render_to_string
from ietf.community.models import CommunityList
from ietf.group.models import Role
register = template.Library()
class CommunityListNode(template.Node):
def __init__(self, user, var_name):
self.user = user
self... | {
"repo_name": "mcr/ietfdb",
"path": "ietf/community/templatetags/community_tags.py",
"copies": "1",
"size": "2896",
"license": "bsd-3-clause",
"hash": -2265550518702921500,
"line_mean": 35.2,
"line_max": 141,
"alpha_frac": 0.6115331492,
"autogenerated": false,
"ratio": 3.761038961038961,
"confi... |
from django import template
from django.template.loader import render_to_string
from impacts_world.core.models import HeaderSettings
register = template.Library()
@register.simple_tag(takes_context=True)
def header(context, *args, **kwargs):
request = context['request']
settings = HeaderSettings.for_site(req... | {
"repo_name": "bruecksen/impacts-world",
"path": "impacts_world/core/templatetags/header.py",
"copies": "1",
"size": "1504",
"license": "mit",
"hash": 7143184009496404000,
"line_mean": 31.6956521739,
"line_max": 88,
"alpha_frac": 0.6203457447,
"autogenerated": false,
"ratio": 4,
"config_test": ... |
from django import template
from django.template.loader import render_to_string
from isi_mip.core.models import HeaderLinks
register = template.Library()
@register.simple_tag(takes_context=True)
def header(context, **kwargs):
request = context['request']
settings = HeaderLinks.for_site(request.site)
pag... | {
"repo_name": "bruecksen/isimip",
"path": "isi_mip/core/templatetags/header.py",
"copies": "1",
"size": "1453",
"license": "mit",
"hash": -8658926087870981000,
"line_mean": 36.2564102564,
"line_max": 128,
"alpha_frac": 0.6111493462,
"autogenerated": false,
"ratio": 3.948369565217391,
"config_te... |
from django import template
from django.template.loader import render_to_string
from lfluxproject.lqa.forms import QuestionCreateForm
register = template.Library()
class RenderQuestionFormNode(template.Node):
@classmethod
def handle_token(cls, parser, token):
tokens = token.contents.split()
... | {
"repo_name": "luminousflux/lflux",
"path": "lfluxproject/lqa/templatetags/lqa.py",
"copies": "1",
"size": "1039",
"license": "mit",
"hash": -3076350388988285400,
"line_mean": 33.6333333333,
"line_max": 116,
"alpha_frac": 0.6804619827,
"autogenerated": false,
"ratio": 3.906015037593985,
"config... |
from django import template
from django.template.loader import render_to_string
from lfs.catalog.models import Category
from lfs.manufacturer.models import Manufacturer
register = template.Library()
@register.inclusion_tag('manage/category/category_filter.html', takes_context=True)
def category_filter(context, css_... | {
"repo_name": "diefenbach/django-lfs",
"path": "lfs/manage/templatetags/lfs_manage_tags.py",
"copies": "1",
"size": "2866",
"license": "bsd-3-clause",
"hash": 310020387319601660,
"line_mean": 37.2133333333,
"line_max": 105,
"alpha_frac": 0.6636427076,
"autogenerated": false,
"ratio": 4.2147058823... |
from django import template
from django.template.loader import render_to_string
from primer.utils import get_request
from primer.comments.forms import CommentForm, StatusForm, TimelineForm, get_comment_form
from primer.comments.utils import get_content_types_hash, get_content_types_list
register = template.Library()
... | {
"repo_name": "jamesmfriedman/django-primer",
"path": "primer/comments/templatetags/primer_comment_tags.py",
"copies": "1",
"size": "4584",
"license": "apache-2.0",
"hash": -1496575086178685700,
"line_mean": 34.5348837209,
"line_max": 201,
"alpha_frac": 0.6657940663,
"autogenerated": false,
"rati... |
from django import template
from django.template.loader import render_to_string
from skins import get_skin
register = template.Library()
class RelatedLinksGroupNode(template.Node):
def __init__(self, related_links):
self.related_links = related_links
self.skin = get_skin()
def render(self, ... | {
"repo_name": "Mause/pyalp",
"path": "pyalp/custom_template_tags/templatetags/relatedlinks.py",
"copies": "1",
"size": "1409",
"license": "mit",
"hash": -8822456882815773000,
"line_mean": 24.1607142857,
"line_max": 72,
"alpha_frac": 0.6061036196,
"autogenerated": false,
"ratio": 4.430817610062893... |
from django import template
from django.template.loader import render_to_string
from src.basic.tools.templatetags.utils import parse_ttag
register = template.Library()
class RenderTemplateNode(template.Node):
def __init__(self, object_name, template_dir):
self.object_name = object_name
self.temp... | {
"repo_name": "hittu123/ruhive",
"path": "src/basic/tools/templatetags/objectutils.py",
"copies": "1",
"size": "1633",
"license": "mit",
"hash": -1783015216138536200,
"line_mean": 32.3265306122,
"line_max": 93,
"alpha_frac": 0.6117575015,
"autogenerated": false,
"ratio": 4.022167487684729,
"con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.