text
stringlengths
0
1.05M
meta
dict
from django.template import Library, Node, TemplateSyntaxError, TemplateDoesNotExist from activity_stream.models import ActivityFollower, ActivityStreamItem, get_people_i_follow, get_my_followers from django.template import Variable, resolve_variable from django.template import loader from django.db.models import get_m...
{ "repo_name": "philippWassibauer/django-activity-stream", "path": "activity_stream/templatetags/activity_stream_tags.py", "copies": "1", "size": "4512", "license": "bsd-3-clause", "hash": 2108057773689166300, "line_mean": 33.7076923077, "line_max": 110, "alpha_frac": 0.681072695, "autogenerated": f...
from django.template import Library, Node, TemplateSyntaxError, Variable from django.core.exceptions import ImproperlyConfigured from xml.etree import ElementTree as ET import urllib2 try: import readernaut except ImportError: raise ImproperlyConfigured("djangonaut depends on the pyreadernaut library") def p...
{ "repo_name": "oscarduignan/django-readernaut", "path": "djangonaut/templatetags/djangonaut.py", "copies": "1", "size": "2381", "license": "bsd-3-clause", "hash": -1260977986508637200, "line_mean": 32.0694444444, "line_max": 80, "alpha_frac": 0.6173876522, "autogenerated": false, "ratio": 3.83413...
from django.template import Library, Node, TemplateSyntaxError, Variable from django.urls import NoReverseMatch, resolve, reverse from django.urls.utils import get_callable register = Library() class ViewNode(Node): def __init__(self, view_name, args, kwargs): self.view_name = view_name self.args...
{ "repo_name": "utapyngo/django-render-partial", "path": "django_render_partial/templatetags/render_partial.py", "copies": "1", "size": "2644", "license": "bsd-3-clause", "hash": -8834852985290692000, "line_mean": 32.05, "line_max": 78, "alpha_frac": 0.5771558245, "autogenerated": false, "ratio": ...
from django.template import Library, Node, TemplateSyntaxError, Variable from ..models import Grain register = Library() class GrainNode(Node): def __init__(self, nodelist, key, content_type): self.nodelist = nodelist self.key = Variable(key) self.content_type = Variable(content_type) ...
{ "repo_name": "2general/django-grains", "path": "grains/templatetags/grains_tags.py", "copies": "1", "size": "1354", "license": "bsd-3-clause", "hash": 3140444494298255400, "line_mean": 33.7179487179, "line_max": 72, "alpha_frac": 0.6344165436, "autogenerated": false, "ratio": 3.8908045977011496,...
from django.template import Library, Node, TemplateSyntaxError, Variable from ..registry import registry register = Library() class WidgetNode(Node): """Django template node to render a single widget""" def __init__(self, name, opt_var): self.name = name self.opt_var = opt_var def render...
{ "repo_name": "cfpb/django-widgeter", "path": "widgeter/templatetags/widgeter.py", "copies": "1", "size": "2168", "license": "cc0-1.0", "hash": 4300959658528536600, "line_mean": 31.3582089552, "line_max": 111, "alpha_frac": 0.6203874539, "autogenerated": false, "ratio": 3.6745762711864405, "con...
from django.template import Library, Node, TemplateSyntaxError, Variable register = Library() class DisplayPageRangeNode(Node): def __init__(self, paginator, page_number, context_var): self.paginator = Variable(paginator) self.page_number = Variable(page_number) self.context_var = context_...
{ "repo_name": "encorehu/django-pagebar", "path": "templatetags/pagebar_tags.py", "copies": "1", "size": "1568", "license": "mit", "hash": 4967401422950460000, "line_mean": 35.4651162791, "line_max": 103, "alpha_frac": 0.6403061224, "autogenerated": false, "ratio": 3.655011655011655, "config_tes...
from django.template import Library, Node, TemplateSyntaxError, Variable register = Library() @register.tag def mongoid(parser, token): """ Print mongo's _id attribute or store it in variable. Usage: {% mongoid <variable> %} {% mongoid <variable> as <variable_id> %} Example: ...
{ "repo_name": "centrumholdings/cthulhubot", "path": "cthulhubot/templatetags/mongo.py", "copies": "1", "size": "1356", "license": "bsd-3-clause", "hash": -3302098287232016000, "line_mean": 24.1111111111, "line_max": 84, "alpha_frac": 0.5907079646, "autogenerated": false, "ratio": 3.86324786324786...
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django import template from django.template import resolve_variable from django.core.cache import cache from django.utils.hashcompat import md5_constructor from django.db.models import Model from django.conf import setti...
{ "repo_name": "smn/django-nginx-ssi", "path": "src/ssi/templatetags/nginxssi_tags.py", "copies": "1", "size": "2208", "license": "bsd-3-clause", "hash": -7439104551586673000, "line_mean": 39.8888888889, "line_max": 94, "alpha_frac": 0.6707427536, "autogenerated": false, "ratio": 3.72972972972973,...
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django.template import resolve_variable from django.core.cache import cache from django.utils.encoding import force_unicode from django.utils.http import urlquote from django.utils.hashcompat import md5_constructor regi...
{ "repo_name": "CollabQ/CollabQ", "path": "vendor/django/templatetags/cache.py", "copies": "8", "size": "2407", "license": "apache-2.0", "hash": 7398184578434573000, "line_mean": 37.2063492063, "line_max": 109, "alpha_frac": 0.6468633153, "autogenerated": false, "ratio": 4.0385906040268456, "con...
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django.template import resolve_variable from django.core.cache import cache from django.utils.hashcompat import md5_constructor from django.db.models import Model from django.conf import settings from cachesweeper.utils ...
{ "repo_name": "smn/django-cache-sweeper", "path": "src/cachesweeper/templatetags/cachesweeper_tags.py", "copies": "1", "size": "2616", "license": "bsd-3-clause", "hash": 6506630305735464000, "line_mean": 41.2096774194, "line_max": 130, "alpha_frac": 0.6624617737, "autogenerated": false, "ratio": ...
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django.template.loader import render_to_string from django.utils.encoding import force_unicode from wikify.diff_utils import side_by_side_diff, context_diff register = Library() class ContextualDiffNode(Node): def...
{ "repo_name": "cburgmer/django-wikify", "path": "src/wikify/templatetags/diff.py", "copies": "1", "size": "2236", "license": "bsd-3-clause", "hash": 4348233851960236500, "line_mean": 35.6557377049, "line_max": 94, "alpha_frac": 0.595706619, "autogenerated": false, "ratio": 4.095238095238095, "c...
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django.template import resolve_variable from django.core.cache import cache from django.utils.encoding import force_unicode from django.utils.http import urlquote from django.utils.hashcompat import md5_constructor ...
{ "repo_name": "greggian/TapdIn", "path": "django/templatetags/cache.py", "copies": "1", "size": "2470", "license": "apache-2.0", "hash": -5318457118406157000, "line_mean": 37.2063492063, "line_max": 109, "alpha_frac": 0.6303643725, "autogenerated": false, "ratio": 4.10981697171381, "config_test...
from django.template import Library, Node, Variable from attachments.forms import AttachmentForm from attachments.views import add_url_for_obj from django.core.urlresolvers import reverse from attachments.models import Attachment from attachments import MEGABYTE register = Library() @register.inclusion_tag('attachmen...
{ "repo_name": "panosl/django-attachments", "path": "attachments/templatetags/attachments_tags.py", "copies": "1", "size": "4352", "license": "bsd-3-clause", "hash": -6174900346019169000, "line_mean": 31.9696969697, "line_max": 95, "alpha_frac": 0.6238511029, "autogenerated": false, "ratio": 3.927...
from django.template import Library, Node, Variable from django.utils.encoding import smart_str from django.core.urlresolvers import reverse from pdb import set_trace register = Library() class CallNode(Node): def __init__(self, args, kwargs, asvar, func_name=None, obj_name=None, method_name=None): self....
{ "repo_name": "svetlyak40wt/django-dzenlog", "path": "django_dzenlog/templatetags/dzenlog_tags.py", "copies": "1", "size": "2525", "license": "bsd-3-clause", "hash": 985012986528586800, "line_mean": 30.1728395062, "line_max": 93, "alpha_frac": 0.5386138614, "autogenerated": false, "ratio": 3.9763...
from django.template import Library, Node, Variable, \ VariableDoesNotExist, TemplateSyntaxError import time register = Library() def get_var(v, context): try: return v.resolve(context) except VariableDoesNotExist: return v.var class MungeTime(Node): def __init__(self, t, old, new...
{ "repo_name": "carthagecollege/django-djtools", "path": "djtools/templatetags/string_time.py", "copies": "1", "size": "1211", "license": "unlicense", "hash": -6366646173944954000, "line_mean": 22.2884615385, "line_max": 80, "alpha_frac": 0.5483071841, "autogenerated": false, "ratio": 3.784375, ...
from django.template import Library, Node, Variable from django.template.defaultfilters import urlencode from django.utils.safestring import mark_safe from courant.core.sharethis.models import SocialNetwork register = Library() class ShareThisNode(Node): def __init__(self, name, values, varname): ...
{ "repo_name": "maxcutler/Courant-News", "path": "courant/core/sharethis/templatetags/sharethis.py", "copies": "1", "size": "1598", "license": "bsd-3-clause", "hash": -5669091937312583000, "line_mean": 32.7391304348, "line_max": 104, "alpha_frac": 0.6107634543, "autogenerated": false, "ratio": 3.9...
from django.template import Library, Node, Variable, TemplateSyntaxError from djangovoice.compat import gravatar_for_user from djangovoice.models import Type, Status register = Library() class TypeListNode(Node): def render(self, context): context['type_list'] = Type.objects.all() return '' def...
{ "repo_name": "UPDDI/mps-database-server", "path": "djangovoice/templatetags/djangovoice_tags.py", "copies": "2", "size": "1880", "license": "mit", "hash": 118746072068207490, "line_mean": 23.4155844156, "line_max": 75, "alpha_frac": 0.6372340426, "autogenerated": false, "ratio": 3.58095238095238...
from django.template import Library, Node, Variable, TemplateSyntaxError from django.conf import settings from courant.core.utils.text import split_contents from courant.core.menus.models import MenuLocation, Menu, MenuItem register = Library() class GetMenuNode(Node): def __init__(self, location_name, ...
{ "repo_name": "maxcutler/Courant-News", "path": "courant/core/menus/templatetags/menus.py", "copies": "1", "size": "1603", "license": "bsd-3-clause", "hash": 7039420565006476000, "line_mean": 30.7551020408, "line_max": 95, "alpha_frac": 0.5826575172, "autogenerated": false, "ratio": 3.93857493857...
from django.template import Library, Node, Variable, TemplateSyntaxError from django.contrib.contenttypes.models import ContentType from backlinks.models import InboundLinkback register = Library() class BacklinkListObject(Node): def __init__(self, target_object_name, template_var_name=None): self...
{ "repo_name": "liorsion/django-backlinks", "path": "src/backlinks/templatetags/backlinks_tags.py", "copies": "1", "size": "1477", "license": "bsd-3-clause", "hash": 5226813225564663000, "line_mean": 36.8684210526, "line_max": 105, "alpha_frac": 0.6337169939, "autogenerated": false, "ratio": 3.897...
from django.template import Library, Node, Variable, TemplateSyntaxError, VariableDoesNotExist from django.template.loader import get_template from django.conf import settings from django.db.models.loading import get_model from django.db.models.fields.related import ManyToManyRel from django.db.models import Count...
{ "repo_name": "maxcutler/Courant-News", "path": "courant/core/utils/templatetags/common_tags.py", "copies": "1", "size": "7725", "license": "bsd-3-clause", "hash": -4512761000031533000, "line_mean": 31.3060344828, "line_max": 136, "alpha_frac": 0.6064724919, "autogenerated": false, "ratio": 4.164...
from django.template import Library, Node, Variable, VariableDoesNotExist from django.core.urlresolvers import reverse from job_board.views import job_list_by_tag register = Library() def do_populate_tags(parser,token): """ render a list of tags, with it's link. the token is tag. Arguments: - `pa...
{ "repo_name": "jpartogi/django-job-board", "path": "job_board/templatetags/tag_list.py", "copies": "1", "size": "1058", "license": "bsd-3-clause", "hash": -4036336355213661000, "line_mean": 29.2571428571, "line_max": 134, "alpha_frac": 0.6143667297, "autogenerated": false, "ratio": 3.491749174917...
from django.template import Library, Node, Variable, VariableDoesNotExist from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from simple_blog.views import entry_list register = Library() def do_populate_tags(parser,token): """ render a list of tags, with it's link...
{ "repo_name": "jpartogi/django-simple-blog", "path": "simple_blog/templatetags/entry_tags.py", "copies": "1", "size": "1100", "license": "bsd-3-clause", "hash": -2040344272794643200, "line_mean": 29.5833333333, "line_max": 134, "alpha_frac": 0.6254545455, "autogenerated": false, "ratio": 3.594771...
from django.template import Library, Node, Variable, VariableDoesNotExist, TemplateSyntaxError from django.contrib.contenttypes.models import ContentType from tagging.models import Tag from courant.core.news.models import Article from datetime import date, timedelta register = Library() class CountThi...
{ "repo_name": "maxcutler/Courant-News", "path": "courant/core/countthis/templatetags/countthis.py", "copies": "1", "size": "6492", "license": "bsd-3-clause", "hash": 9057184568928989000, "line_mean": 35.0971428571, "line_max": 179, "alpha_frac": 0.626771411, "autogenerated": false, "ratio": 3.968...
from django.template import Library, RequestContext from django.conf import settings from satchmo_store.contact.models import Contact from livesettings import config_value import sys register = Library() def show_tracker(context, secure=False): """ Output the google tracker code. """ return ({"GOOGLE_...
{ "repo_name": "jordotech/satchmofork", "path": "satchmo/apps/satchmo_store/shop/templatetags/satchmo_google.py", "copies": "6", "size": "3086", "license": "bsd-3-clause", "hash": 827285043967626600, "line_mean": 33.2888888889, "line_max": 183, "alpha_frac": 0.6688269605, "autogenerated": false, "...
from django.template import Library #from django.conf import settings from goflow.apptools.models import ImageButton register = Library() def form_ext(form): ''' This will insert a form, in a bit more sophisticated way than {{ form }}. Required and optional fields are displayed differently. For...
{ "repo_name": "junfenggood/goflow", "path": "goflow/apptools/templatetags/apptools_lib.py", "copies": "9", "size": "3012", "license": "bsd-3-clause", "hash": -5649523397971323000, "line_mean": 29.0515463918, "line_max": 111, "alpha_frac": 0.6401062417, "autogenerated": false, "ratio": 4.148760330...
from django.template import Library from django.conf import settings import flags.loaders.app_directories import flags.loaders.filesystem register = Library() def flags_form(context): ''' This will insert a form made of a list of flags. The template *flags/flags_form.html* is used for render...
{ "repo_name": "sirmmo/GoGoFlow", "path": "sampleproject/flags/templatetags/flags_lib.py", "copies": "2", "size": "2393", "license": "bsd-3-clause", "hash": -4478903329931223600, "line_mean": 30.3378378378, "line_max": 92, "alpha_frac": 0.5679063936, "autogenerated": false, "ratio": 4.327305605786...
from django.template import Library from goflow.runtime.models import WorkItem register = Library() def mywork(user): ''' Display the worklist of a user as a table. The template *goflow/workitems.html* is used for rendering. Usage:: {% mywork user %} settings required:...
{ "repo_name": "AMHZR/goflow", "path": "goflow/runtime/templatetags/work_lib.py", "copies": "9", "size": "1129", "license": "bsd-3-clause", "hash": -6514036711251429000, "line_mean": 25.5365853659, "line_max": 75, "alpha_frac": 0.5837023915, "autogenerated": false, "ratio": 4.309160305343512, "c...
from django.template import Library, TemplateSyntaxError, InvalidTemplateLibrary, get_templatetags_modules, import_library def load(parser, lib, tag='*', name=None, namespace=None, app=None): """ Determine and load tags into parser. If only a parser and lib are provided, it will behave just like Django's ...
{ "repo_name": "codysoyland/django-smart-load-tag", "path": "smart_load_tag/utils.py", "copies": "1", "size": "3325", "license": "bsd-3-clause", "hash": -4524410862489742300, "line_mean": 35.5384615385, "line_max": 122, "alpha_frac": 0.5951879699, "autogenerated": false, "ratio": 4.03030303030303,...
from django.template import Library, TemplateSyntaxError from django.template.defaultfilters import stringfilter from .. import logger register = Library() @register.filter @stringfilter def resize_iframe(value, new_width): if not value: return value try: from lxml.html import fromstring, t...
{ "repo_name": "armstrong/armstrong.apps.embeds", "path": "armstrong/apps/embeds/templatetags/embed_helpers.py", "copies": "1", "size": "1428", "license": "apache-2.0", "hash": 1717213897640632300, "line_mean": 28.75, "line_max": 79, "alpha_frac": 0.6015406162, "autogenerated": false, "ratio": 4.4...
from django.template import Library, TemplateSyntaxError from django.template.defaulttags import kwarg_re, SsiNode, URLNode register = Library() @register.tag def ssi(parser, token): """ Outputs the contents of a given file into the page. Like a simple "include" tag, the ``ssi`` tag includes the contents...
{ "repo_name": "disqus/django-old", "path": "django/templatetags/future.py", "copies": "2", "size": "4149", "license": "bsd-3-clause", "hash": -7025354027598629000, "line_mean": 32.4596774194, "line_max": 79, "alpha_frac": 0.6165341046, "autogenerated": false, "ratio": 4.120158887785501, "config...
from django.template import Library, TemplateSyntaxError from fluent_contents import rendering from fluent_contents.plugins.sharedcontent.models import SharedContent from tag_parser import template_tag from tag_parser.basetags import BaseNode register = Library() @template_tag(register, 'sharedcontent') class Shared...
{ "repo_name": "pombredanne/django-fluent-contents", "path": "fluent_contents/plugins/sharedcontent/templatetags/sharedcontent_tags.py", "copies": "1", "size": "1880", "license": "apache-2.0", "hash": 8819861705883840000, "line_mean": 31.4137931034, "line_max": 144, "alpha_frac": 0.6595744681, "auto...
from django.template import Library, TemplateSyntaxError from filebrowser.templatetags.fb_versions import VersionNode from filebrowser.settings import VERSIONS register = Library() class VersionObjectThumbnailNode(VersionNode): def render(self, context): result = super(VersionObjectThumbnailNode, self)....
{ "repo_name": "RevSquare/red-filebrowser-extensions", "path": "crop_filebrowser/templatetags/crop_filebrowser.py", "copies": "1", "size": "1585", "license": "mit", "hash": -2045215709342184400, "line_mean": 36.7380952381, "line_max": 78, "alpha_frac": 0.6561514196, "autogenerated": false, "ratio"...
from django.template import Library, TemplateSyntaxError from model_nodes import ModelDetailNode, ModelListNode register = Library() @register.tag def detail_block(parser, token): """ Template tag that takes a model instance and returns the given instance as a template-formatted block. Inserts two obje...
{ "repo_name": "mjumbewu/django-model-filters", "path": "model_filters/templatetags/model_tags.py", "copies": "1", "size": "3035", "license": "bsd-3-clause", "hash": -4665833322135682000, "line_mean": 41.1527777778, "line_max": 87, "alpha_frac": 0.6635914333, "autogenerated": false, "ratio": 4.411...
from django.template import Library, TemplateSyntaxError from model_nodes import ModelDetailNode, ModelTeaserNode, ModelListNode register = Library() @register.tag def detail_block(parser, token): """ Template tag that takes a model instance and returns the given instance as a template-formatted block. ...
{ "repo_name": "mjumbewu/django-model-blocks", "path": "model_blocks/templatetags/model_tags.py", "copies": "1", "size": "4476", "license": "bsd-3-clause", "hash": -9074226243270276000, "line_mean": 42.0384615385, "line_max": 94, "alpha_frac": 0.6642091153, "autogenerated": false, "ratio": 4.33720...
from django.template import Library, TemplateSyntaxError, Node from redis import Redis from proclaim import Proclaim register = template.Library() class ProclaimNode(Node): def __init__(self, feature_string, nodelist): self.feature_string = feature_string self.nodelist = nodelist # We ex...
{ "repo_name": "asenchi/django-proclaim", "path": "templatetags/proclaim.py", "copies": "1", "size": "1767", "license": "mit", "hash": -5652241518945825000, "line_mean": 29.4655172414, "line_max": 78, "alpha_frac": 0.6253537068, "autogenerated": false, "ratio": 3.9618834080717487, "config_test":...
from django.template import Library, TemplateSyntaxError, Variable, Node from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db.models import Count from codrspace.models import Post register = Library() class RandomBlogNode(Node): def render(self, context): ...
{ "repo_name": "durden/dash", "path": "apps/codrspace/templatetags/codrspace_tags.py", "copies": "1", "size": "1588", "license": "mit", "hash": 5628554737077769000, "line_mean": 26.3793103448, "line_max": 75, "alpha_frac": 0.6618387909, "autogenerated": false, "ratio": 3.5927601809954752, "confi...
from django.template import Library, Template, TemplateSyntaxError, Node, Variable from courant.core.news.models import * from courant.core.utils.text import split_contents from datetime import timedelta, datetime register = Library() class WeeksIssuesNode(Node): def __init__(self, issue, varname): self...
{ "repo_name": "maxcutler/Courant-News", "path": "courant/core/news/templatetags/issues.py", "copies": "1", "size": "1501", "license": "bsd-3-clause", "hash": -46382732813931890, "line_mean": 33.9302325581, "line_max": 90, "alpha_frac": 0.5829447035, "autogenerated": false, "ratio": 4.157894736842...
from django.template import Library, Template, TemplateSyntaxError, Node, Variable from django.contrib.contenttypes.models import ContentType from courant.contrib.shorturls.models import ShorturlMedium, Shorturl register = Library() class ShorturlNode(Node): def __init__(self, obj, medium, varname=None): ...
{ "repo_name": "maxcutler/Courant-News", "path": "courant/contrib/shorturls/templatetags/shorturls.py", "copies": "1", "size": "1897", "license": "bsd-3-clause", "hash": -6398088500257779000, "line_mean": 35.2352941176, "line_max": 111, "alpha_frac": 0.5556141276, "autogenerated": false, "ratio": ...
from django.template import Library, Variable register = Library() # This requires that any list we send to this templatetag has objects with a # cycle attribute and a get_absolute_url --which seems reasonable. def get_cycle_details(object): return {'cycle':object.cycle, 'url':object.get_absolute_url()} @regi...
{ "repo_name": "sunlightlabs/read_FEC", "path": "fecreader/summary_data/templatetags/cycle_selector.py", "copies": "1", "size": "1072", "license": "bsd-3-clause", "hash": 4096324488875106000, "line_mean": 38.7407407407, "line_max": 128, "alpha_frac": 0.6996268657, "autogenerated": false, "ratio": ...
from django.template import loader, base, Template from tc.rules import registered_rules class TemplateChecker(object): def check_template(self, template): """ Checks the given template for badness. """ if not isinstance(template, Template): try: te...
{ "repo_name": "craigds/django-tc", "path": "tc/checker.py", "copies": "1", "size": "1641", "license": "mit", "hash": -5075510043997018000, "line_mean": 34.6739130435, "line_max": 76, "alpha_frac": 0.5478366849, "autogenerated": false, "ratio": 5.176656151419558, "config_test": false, "has_no_...
from django.template import loader, Context from django.core.urlresolvers import reverse, NoReverseMatch from ..node_types import to_markup_id from regulations.generator.section_url import SectionUrl class InternalCitationLayer(): shorthand = 'internal' def __init__(self, layer): self.layer = layer ...
{ "repo_name": "ascott1/regulations-site", "path": "regulations/generator/layers/internal_citation.py", "copies": "7", "size": "1518", "license": "cc0-1.0", "hash": -5772823833350471000, "line_mean": 36.0243902439, "line_max": 79, "alpha_frac": 0.5974967062, "autogenerated": false, "ratio": 4.0158...
from django.template import loader, Context from django.http import HttpResponse, Http404, HttpResponseRedirect from blog.models import BlogPost from blog.forms import BlogPostForm from django.shortcuts import render_to_response from django.views.decorators.csrf import csrf_exempt from datetime import datetime import m...
{ "repo_name": "alogfans/yaoj", "path": "main/blog/views.py", "copies": "1", "size": "2591", "license": "mit", "hash": -308535692542655360, "line_mean": 34.0135135135, "line_max": 87, "alpha_frac": 0.6229255114, "autogenerated": false, "ratio": 3.849925705794948, "config_test": false, "has_no_...
from django.template import loader, Context from django.http import HttpResponse from django.utils import timezone from rest_framework.views import APIView, Response from rest_framework import generics from common.views import AuditableDetailViewMixin from common.models import Ward, County, Constituency from ..model...
{ "repo_name": "urandu/mfl_api", "path": "facilities/views/facility_views.py", "copies": "1", "size": "17626", "license": "mit", "hash": 4546065593855580000, "line_mean": 31.9457943925, "line_max": 79, "alpha_frac": 0.7317031658, "autogenerated": false, "ratio": 4.261605415860735, "config_test":...
from django.template import loader, Context from django.utils import timezone from django.views.decorators.cache import never_cache from rest_framework import generics from common.views import AuditableDetailViewMixin, DownloadPDFMixin from common.models import UserConstituency, UserCounty, UserSubCounty from .models i...
{ "repo_name": "MasterFacilityList/mfl_api", "path": "chul/views.py", "copies": "1", "size": "10825", "license": "mit", "hash": 8495715806558477000, "line_mean": 31.2172619048, "line_max": 78, "alpha_frac": 0.6979214781, "autogenerated": false, "ratio": 4.502911813643927, "config_test": false, ...
from django.template import loader, Context import django import tumblr from django.conf import settings def render(posts): """ Use Django templates to render the output HTML. """ settings.configure( DEBUG=True, TEMPLATE_DEBUG=True, TEMPLATE_DIRS=('/vagrant/code/social-aggregator/templates',)) ...
{ "repo_name": "khandelwal/social-aggregator", "path": "write.py", "copies": "1", "size": "1134", "license": "cc0-1.0", "hash": -6888832294670946000, "line_mean": 32.3529411765, "line_max": 73, "alpha_frac": 0.6111111111, "autogenerated": false, "ratio": 3.623003194888179, "config_test": false, ...
from django.template import loader, Context from django.utils import timezone from django.views.decorators.cache import never_cache from rest_framework import generics from common.views import AuditableDetailViewMixin, DownloadPDFMixin from common.utilities import CustomRetrieveUpdateDestroyView from chul.models imp...
{ "repo_name": "Nyto035/Konza_backend", "path": "facilities/views/facility_special_workflow_views.py", "copies": "2", "size": "10352", "license": "mit", "hash": -5639840062921998000, "line_mean": 29.8095238095, "line_max": 79, "alpha_frac": 0.7157071097, "autogenerated": false, "ratio": 4.53438458...
from django.template import loader, Context from regulations.generator.layers.base import InlineLayer from regulations.generator.section_url import SectionUrl class InternalCitationLayer(InlineLayer): shorthand = 'internal' data_source = 'internal-citations' def __init__(self, layer): self.layer...
{ "repo_name": "tadhg-ohiggins/regulations-site", "path": "regulations/generator/layers/internal_citation.py", "copies": "2", "size": "1158", "license": "cc0-1.0", "hash": 1396163625141329200, "line_mean": 35.1875, "line_max": 79, "alpha_frac": 0.6303972366, "autogenerated": false, "ratio": 3.9793...
from django.template import loader, Context from regulations.generator.layers.base import LayerBase # Does not extend InlineLayer as this retrieves its data in a different way class DefinedLayer(LayerBase): shorthand = 'defined' data_source = 'terms' layer_type = LayerBase.INLINE def __init__(self, ...
{ "repo_name": "tadhg-ohiggins/regulations-site", "path": "regulations/generator/layers/defined.py", "copies": "2", "size": "1080", "license": "cc0-1.0", "hash": 3247061395497532000, "line_mean": 37.5714285714, "line_max": 79, "alpha_frac": 0.6259259259, "autogenerated": false, "ratio": 4.37246963...
from django.template import loader, Context from regulations.generator.layers.base import SearchReplaceLayer class FormattingLayer(SearchReplaceLayer): shorthand = 'formatting' data_source = 'formatting' DATA_TYPES = ('table', 'fence', 'subscript', 'dash', 'footnote', 'superscript') ...
{ "repo_name": "tadhg-ohiggins/regulations-site", "path": "regulations/generator/layers/formatting.py", "copies": "2", "size": "2701", "license": "cc0-1.0", "hash": 7317459600144889000, "line_mean": 37.5857142857, "line_max": 78, "alpha_frac": 0.5653461681, "autogenerated": false, "ratio": 4.10486...
from django.template import loader, Context from regulations.generator.layers.utils import convert_to_python def fetch_all(api_client): """Pull down all known notices from the API""" notices = [] for notice in api_client.notices()['results']: notices.append(api_client.notice(notice['document_numb...
{ "repo_name": "adderall/regulations-site", "path": "regulations/generator/notices.py", "copies": "3", "size": "2660", "license": "cc0-1.0", "hash": -4156421266792169500, "line_mean": 31.0481927711, "line_max": 78, "alpha_frac": 0.6571428571, "autogenerated": false, "ratio": 3.5231788079470197, ...
from django.template import loader, Context from regulations.generator.layers.utils import convert_to_python def fetch_all(api_client, part): """Pull down all known notices from the API""" notices = [] for notice in api_client.notices()['results']: notices.append(api_client.notice(notice['documen...
{ "repo_name": "ascott1/regulations-site", "path": "regulations/generator/notices.py", "copies": "4", "size": "2678", "license": "cc0-1.0", "hash": 2359622743167524000, "line_mean": 31.265060241, "line_max": 78, "alpha_frac": 0.6572068708, "autogenerated": false, "ratio": 3.519053876478318, "con...
from django.template import loader, Context from regulations.generator.section_url import SectionUrl from ..node_types import to_markup_id import utils class DefinitionsLayer(object): shorthand = 'terms' def __init__(self, layer): self.layer = layer self.template = loader.get_template( ...
{ "repo_name": "EricSchles/regulations-site", "path": "regulations/generator/layers/definitions.py", "copies": "7", "size": "2171", "license": "cc0-1.0", "hash": 8783307389840017000, "line_mean": 39.9622641509, "line_max": 78, "alpha_frac": 0.5624136343, "autogenerated": false, "ratio": 4.43967280...
from django.template import loader, Context, RequestContext import stomp import json def push_with_template(template, context, destination): ''' Pushes content through stomp / morbidQ to comet listeners. This drives a lot of the "live" content on our site. ''' t = loader.get_template(template) #Pro...
{ "repo_name": "SlashRoot/WHAT", "path": "what_apps/push/functions.py", "copies": "1", "size": "1398", "license": "mit", "hash": 605740548242561700, "line_mean": 37.8611111111, "line_max": 163, "alpha_frac": 0.7074391989, "autogenerated": false, "ratio": 3.905027932960894, "config_test": false, ...
from django.template import loader from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden from django.db.models.base import ModelBase from django.contrib.contenttypes.models import ContentType from secretballot.models import Vot...
{ "repo_name": "jamesturk/django-secretballot", "path": "secretballot/views.py", "copies": "1", "size": "3146", "license": "bsd-2-clause", "hash": -8540467780735086000, "line_mean": 41.5135135135, "line_max": 97, "alpha_frac": 0.6379529561, "autogenerated": false, "ratio": 4.101694915254237, "co...
from django.template import loader from django.db.models import * from django.contrib.auth.models import User from django.contrib import admin from django.core.urlresolvers import reverse from settings import MEDIA_URL btn_tpl = "<div class='%s' id='%s_%s'><img class='btn' src='%simg/admin/icon-%s.gif' /></div>" nam...
{ "repo_name": "pythonbyexample/PBE", "path": "dbe/todo/models.py", "copies": "1", "size": "2978", "license": "bsd-3-clause", "hash": 1220421534937142500, "line_mean": 32.0888888889, "line_max": 95, "alpha_frac": 0.6366689053, "autogenerated": false, "ratio": 3.5242603550295857, "config_test": f...
from django.template import loader from django.forms import models as model_forms from wizard import Wizard from wizard import signals from sample import models def pre_save_callback(**kwargs): print "Pre Save Signal!!" def post_save_callback(**kwargs): print "Post Save Signal!!" def pre_display_callback(...
{ "repo_name": "imtapps/django-wizard", "path": "example/sample/views.py", "copies": "1", "size": "2363", "license": "bsd-2-clause", "hash": 3679102552381645300, "line_mean": 22.64, "line_max": 64, "alpha_frac": 0.6622936945, "autogenerated": false, "ratio": 3.646604938271605, "config_test": fal...
from django.template import loader from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseNotModified from django.template import Template, Context, TemplateDoesNotExist import mimetypes import os import posixpath import re import rfc822 import stat import urllib def serve(request, path, docu...
{ "repo_name": "jonaustin/advisoryscan", "path": "django/django/views/static.py", "copies": "33", "size": "4521", "license": "mit", "hash": 170446002207216030, "line_mean": 35.168, "line_max": 121, "alpha_frac": 0.6284007963, "autogenerated": false, "ratio": 3.874035989717224, "config_test": fal...
from django.template import loader from django.http import HttpResponse from django.utils.encoding import smart_bytes from openpyxl import load_workbook from openpyxl.writer.excel import save_virtual_workbook from io import BytesIO import csv def create_workbook(workbook, template, data, filename, delimiter): wb...
{ "repo_name": "carthagecollege/django-djtools", "path": "djtools/utils/spreadsheet.py", "copies": "1", "size": "1368", "license": "unlicense", "hash": 2546379558566004700, "line_mean": 35, "line_max": 77, "alpha_frac": 0.7097953216, "autogenerated": false, "ratio": 4.071428571428571, "config_te...
from django.template import loader from django import template register = template.Library() @register.filter() def get_value(value): return ('{{i.id}}') @register.filter(name='file_input') def field_type(field): name = get_field_type(field) if name == 'ClearableFileInput' or name == 'FileInput': ...
{ "repo_name": "yoowillns/django-materialize", "path": "materialize/templatetags/utils_forms.py", "copies": "1", "size": "1562", "license": "mit", "hash": 676099185124002300, "line_mean": 24.6229508197, "line_max": 74, "alpha_frac": 0.6350832266, "autogenerated": false, "ratio": 3.4179431072210065...
from django.template import loader from django.template.backends.django import Template as DjangoTemplate try: from django.template.backends.jinja2 import Template as Jinja2Template except ImportError: # Most likely Jinja2 isn't installed, in that case just create a class since # we always want it to be fal...
{ "repo_name": "clokep/django-render-block", "path": "render_block/base.py", "copies": "1", "size": "1622", "license": "isc", "hash": 856944609085974000, "line_mean": 35.0444444444, "line_max": 82, "alpha_frac": 0.7022194821, "autogenerated": false, "ratio": 4.3138297872340425, "config_test": fa...
from django.template import loader from django.template.backends.django import Template from django.template.response import SimpleTemplateResponse import jingo # We monkeypatch SimpleTemplateResponse.rendered_content to use our jinja # rendering pipeline (most of the time). The exception is the admin app, where # we...
{ "repo_name": "ingenioustechie/zamboni", "path": "mkt/zadmin/__init__.py", "copies": "1", "size": "1521", "license": "bsd-3-clause", "hash": 5747388317298790000, "line_mean": 40.1081081081, "line_max": 79, "alpha_frac": 0.7041420118, "autogenerated": false, "ratio": 4.155737704918033, "config_t...
from django.template import loader from django.template.response import SimpleTemplateResponse import jingo def jinja_for_django(template_name, context=None, **kw): """ If you want to use some built in logic (or a contrib app) but need to override the templates to work with Jinja, replace the object's ...
{ "repo_name": "Joergen/zamboni", "path": "apps/zadmin/__init__.py", "copies": "4", "size": "1659", "license": "bsd-3-clause", "hash": 8125235894447416000, "line_mean": 37.5813953488, "line_max": 78, "alpha_frac": 0.7142857143, "autogenerated": false, "ratio": 4.056234718826406, "config_test": f...
from django.template import loader from django.template.response import SimpleTemplateResponse import jingo # We monkeypatch SimpleTemplateResponse.rendered_content to use our jinja # rendering pipeline (most of the time). The exception is the admin app, where # we render their Django templates and pipe the result t...
{ "repo_name": "shahbaz17/zamboni", "path": "mkt/zadmin/__init__.py", "copies": "14", "size": "1212", "license": "bsd-3-clause", "hash": -3620116928573412000, "line_mean": 39.4, "line_max": 79, "alpha_frac": 0.7260726073, "autogenerated": false, "ratio": 4.094594594594595, "config_test": false, ...
from django.template import loader from django.utils.datastructures import MultiValueDict from django.utils.encoding import smart_str from django.db.models import Model from django.core.cache import cache from django.conf import settings from django.contrib.contenttypes.models import ContentType from ella.core.cache.u...
{ "repo_name": "ella/ella", "path": "ella/core/box.py", "copies": "6", "size": "5861", "license": "bsd-3-clause", "hash": -1153131132880842500, "line_mean": 33.8869047619, "line_max": 122, "alpha_frac": 0.5620201331, "autogenerated": false, "ratio": 3.8407601572739187, "config_test": false, "h...
from django.template import loader from django.utils.translation import ugettext import jinja2 from django_jinja import library from olympia.addons.templatetags.jinja_helpers import new_context from olympia.amo.urlresolvers import reverse from olympia.amo.utils import chunked @library.global_function @library.rend...
{ "repo_name": "atiqueahmedziad/addons-server", "path": "src/olympia/bandwagon/templatetags/jinja_helpers.py", "copies": "1", "size": "3177", "license": "bsd-3-clause", "hash": 6689458853446765000, "line_mean": 33.1612903226, "line_max": 76, "alpha_frac": 0.6887000315, "autogenerated": false, "rat...
from django.template import loader from floppyforms import Widget class AddWrapper(Widget): template_name = 'floppyforms/addwrapper.html' def __init__(self, widget, riff): self.widget = widget self.riff = riff super(AddWrapper, self).__init__() def get_context(self, name, value, ...
{ "repo_name": "django-djam/django-djam", "path": "djam/widgets.py", "copies": "1", "size": "1062", "license": "bsd-2-clause", "hash": 1510992649431696000, "line_mean": 31.1818181818, "line_max": 73, "alpha_frac": 0.6129943503, "autogenerated": false, "ratio": 3.806451612903226, "config_test": f...
from django.template import loader from .models import Question, Choice, Faq from django.shortcuts import get_object_or_404, render, redirect from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.utils import timezone from re import findall from random impor...
{ "repo_name": "kura-pl/fast_polls", "path": "polls/views.py", "copies": "1", "size": "4059", "license": "mit", "hash": -552311638591165250, "line_mean": 29.7272727273, "line_max": 91, "alpha_frac": 0.6369913687, "autogenerated": false, "ratio": 3.6012433392539966, "config_test": false, "has_n...
from django.template import loader import os import PyPDF2 from io import BytesIO from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import letter, landscape from reportlab.lib.colors import black, red from wye.profiles.models import Profile from wye.base.emailer_html import send_email_to_id def send_ma...
{ "repo_name": "pythonindia/wye", "path": "wye/workshops/utils.py", "copies": "1", "size": "3745", "license": "mit", "hash": 6380156589346892000, "line_mean": 34.3301886792, "line_max": 73, "alpha_frac": 0.6656875834, "autogenerated": false, "ratio": 3.4294871794871793, "config_test": false, "...
from django.template import loader from .base import AutocompleteBase class AutocompleteTemplate(AutocompleteBase): """ This extension of :py:class:`~.base.AutocompleteBase` supports two new attributes: .. py:attribute:: choice_template Name of the template to use to render a choice in the ...
{ "repo_name": "dsanders11/django-autocomplete-light", "path": "autocomplete_light/autocomplete/template.py", "copies": "2", "size": "2398", "license": "mit", "hash": -894988147581127200, "line_mean": 32.7746478873, "line_max": 79, "alpha_frac": 0.6125938282, "autogenerated": false, "ratio": 4.4, ...
from django.template import loader from regulations.generator.layers.base import InlineLayer from regulations.generator.section_url import SectionUrl from regulations.generator.layers import utils from ..node_types import to_markup_id class DefinitionsLayer(InlineLayer): shorthand = 'terms' data_source = 'te...
{ "repo_name": "tadhg-ohiggins/regulations-site", "path": "regulations/generator/layers/definitions.py", "copies": "4", "size": "1632", "license": "cc0-1.0", "hash": -2420987185401916000, "line_mean": 38.8048780488, "line_max": 78, "alpha_frac": 0.6084558824, "autogenerated": false, "ratio": 4.375...
from django.template import loader from regulations.generator.layers.base import InlineLayer from regulations.generator.section_url import SectionUrl class InternalCitationLayer(InlineLayer): shorthand = 'internal' data_source = 'internal-citations' def __init__(self, layer): self.layer = layer ...
{ "repo_name": "18F/regulations-site", "path": "regulations/generator/layers/internal_citation.py", "copies": "2", "size": "1169", "license": "cc0-1.0", "hash": -9223285672082694000, "line_mean": 33.3823529412, "line_max": 78, "alpha_frac": 0.6124893071, "autogenerated": false, "ratio": 4.03103448...
from django.template import loader from regulations.generator.layers.base import SearchReplaceLayer class FormattingLayer(SearchReplaceLayer): shorthand = 'formatting' data_source = 'formatting' DATA_TYPES = ('table', 'fence', 'subscript', 'dash', 'footnote', 'superscript') def __i...
{ "repo_name": "18F/regulations-site", "path": "regulations/generator/layers/formatting.py", "copies": "2", "size": "2613", "license": "cc0-1.0", "hash": 5851133261421753000, "line_mean": 37.4264705882, "line_max": 78, "alpha_frac": 0.5629544585, "autogenerated": false, "ratio": 4.0828125, "conf...
from django.template import loader import jinja2 from django_jinja import library from olympia import amo from olympia.access import acl from olympia.addons.models import Addon from olympia.bandwagon.models import Collection @library.global_function @jinja2.contextfunction def report_menu(context, request, report,...
{ "repo_name": "lavish205/olympia", "path": "src/olympia/stats/templatetags/jinja_helpers.py", "copies": "2", "size": "1237", "license": "bsd-3-clause", "hash": -2000444777239160000, "line_mean": 31.5526315789, "line_max": 78, "alpha_frac": 0.6054971706, "autogenerated": false, "ratio": 3.93949044...
from django.template import loader class BaseRenderer: def generate_body(self, intermediate): body = [] for item in intermediate: for key, values in item.items(): body.append(self.render_item(key, values).strip()) return '\n'.join(body) def render_item(sel...
{ "repo_name": "theonion/django-bulbs", "path": "bulbs/instant_articles/renderer.py", "copies": "1", "size": "2106", "license": "mit", "hash": -3454984022411355000, "line_mean": 38, "line_max": 78, "alpha_frac": 0.6305792972, "autogenerated": false, "ratio": 3.5877342419080067, "config_test": fa...
from django.template import loader, RequestContext, Context, Template from django.contrib.admin.views.decorators import staff_member_required from django.http import HttpResponse, Http404, HttpResponseRedirect from django.shortcuts import render_to_response from django.utils.safestring import mark_safe from django.core...
{ "repo_name": "Royce/GammaJS", "path": "support/web/cwf/views/__init__.py", "copies": "1", "size": "7213", "license": "mit", "hash": -4656974957149464000, "line_mean": 28.805785124, "line_max": 113, "alpha_frac": 0.5083876334, "autogenerated": false, "ratio": 4.285799168152109, "config_test": f...
from django.template import loader, RequestContext from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden from django.db.models.base import ModelBase from django.contrib.contenttypes.models import ContentType from django.utils.s...
{ "repo_name": "eugena/django-secretballot", "path": "secretballot/views.py", "copies": "1", "size": "3157", "license": "bsd-2-clause", "hash": 1395412912605996300, "line_mean": 42.8472222222, "line_max": 101, "alpha_frac": 0.6347798543, "autogenerated": false, "ratio": 4.209333333333333, "confi...
from django.template import loader, RequestContext from django.core.exceptions import ImproperlyConfigured from django.http import (HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden) from django.db.models import get_model from django.db.models.base import ModelBase from django....
{ "repo_name": "scast/django-secretballot", "path": "secretballot/views.py", "copies": "1", "size": "3409", "license": "bsd-3-clause", "hash": 3299607495875434500, "line_mean": 41.6125, "line_max": 134, "alpha_frac": 0.6286300968, "autogenerated": false, "ratio": 4.219059405940594, "config_test"...
from django.template import loader, RequestContext from django.core.exceptions import ImproperlyConfigured from django.http import (HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden) from django.db.models import get_model from django.db.models.base import ModelBase from django...
{ "repo_name": "redsolution/django-secretballot", "path": "secretballot/views.py", "copies": "6", "size": "3117", "license": "bsd-3-clause", "hash": 1691753376497218800, "line_mean": 41.1216216216, "line_max": 134, "alpha_frac": 0.6300930382, "autogenerated": false, "ratio": 4.235054347826087, "...
from django.template import loader, RequestContext from django.core.xheaders import populate_xheaders from django.http import Http404, HttpResponse from django.core.paginator import Paginator, InvalidPage # GAE: added imports from django.views.generic.create_update import lookup_object from copy import copy def objec...
{ "repo_name": "certik/chess", "path": "common/appenginepatch/appenginepatcher/generic_views/list_detail.py", "copies": "1", "size": "5261", "license": "mit", "hash": -1839991961290919400, "line_mean": 36.0492957746, "line_max": 102, "alpha_frac": 0.592282836, "autogenerated": false, "ratio": 4.06...
from django.template import loader, RequestContext from django.http import Http404, HttpResponse from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist import warnings warnings.warn( 'Function-based generic views have been deprecated; use class-based views in...
{ "repo_name": "dokterbob/django-deprecated-fbv", "path": "deprecated_fbv/list_detail.py", "copies": "1", "size": "5498", "license": "bsd-3-clause", "hash": 4407199423177229300, "line_mean": 35.6533333333, "line_max": 113, "alpha_frac": 0.5947617315, "autogenerated": false, "ratio": 4.121439280359...
from django.template import loader, RequestContext from django.http import Http404, HttpResponse from django.core.xheaders import populate_xheaders from django.core.paginator import ObjectPaginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist def object_list(request, queryset, paginate_by=None, p...
{ "repo_name": "dvliman/jaikuengine", "path": ".google_appengine/lib/django-0.96/django/views/generic/list_detail.py", "copies": "33", "size": "4865", "license": "apache-2.0", "hash": -2124940504080893000, "line_mean": 36.1374045802, "line_max": 113, "alpha_frac": 0.5975334018, "autogenerated": fals...
from django.template import loader, RequestContext from django.http import Http404, HttpResponse from django.core.xheaders import populate_xheaders from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist import warnings warnings.warn( 'Function-based generic v...
{ "repo_name": "dsaraujo/circulante", "path": "django/views/generic/list_detail.py", "copies": "229", "size": "5577", "license": "bsd-3-clause", "hash": 8408781141478945000, "line_mean": 35.6907894737, "line_max": 113, "alpha_frac": 0.5981710597, "autogenerated": false, "ratio": 4.131111111111111,...
from django.template import loader, RequestContext from django.http import Http404, HttpResponse from django.core.xheaders import populate_xheaders from django.core.paginator import QuerySetPaginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist def object_list(request, queryset, paginate_by=None,...
{ "repo_name": "diofeher/django-nfa", "path": "django/views/generic/list_detail.py", "copies": "5", "size": "5439", "license": "bsd-3-clause", "hash": 380561555098183900, "line_mean": 36.5103448276, "line_max": 113, "alpha_frac": 0.5944107373, "autogenerated": false, "ratio": 4.114220877458396, ...
from django.template import loader, RequestContext from django.http import Http404, HttpResponse from math import ceil class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pass class Paginator(object): def __init__(self, object_list, per_page, or...
{ "repo_name": "ACECentre/SpeechBubblev1", "path": "speechbubble/speechbubble/compat.py", "copies": "1", "size": "7574", "license": "bsd-3-clause", "hash": -563867043032665200, "line_mean": 33.2760180995, "line_max": 100, "alpha_frac": 0.5763137048, "autogenerated": false, "ratio": 4.1320240043644...
from django.template import loader, RequestContext from django.http import HttpResponseForbidden from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import ge...
{ "repo_name": "ella/esus", "path": "esus/phorum/views.py", "copies": "1", "size": "8204", "license": "bsd-3-clause", "hash": 7467866848747344000, "line_mean": 35.625, "line_max": 99, "alpha_frac": 0.5841053145, "autogenerated": false, "ratio": 4.261818181818182, "config_test": false, "has_no_...
from django.template import loader, RequestContext from django.http import HttpResponse, HttpResponsePermanentRedirect, HttpResponseGone def direct_to_template(request, template, extra_context=None, mimetype=None, **kwargs): """ Render a given template with any extra URL parameters in the context as ``{{ p...
{ "repo_name": "dcramer/django-compositepks", "path": "django/views/generic/simple.py", "copies": "24", "size": "1395", "license": "bsd-3-clause", "hash": 619428257867284700, "line_mean": 36.7027027027, "line_max": 104, "alpha_frac": 0.6480286738, "autogenerated": false, "ratio": 4.151785714285714...
from django.template import loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone from django.utils.log import getLogger import warnings warnings.warn( 'Function-based generic views have been deprecated; use class-based views instead.', ...
{ "repo_name": "DANCEcollaborative/forum-xblock", "path": "XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/django/views/generic/simple.py", "copies": "81", "size": "2354", "license": "mit", "hash": -3083602439412390400, "line_mean": 33.6176470588, "line_max": 107, "alpha_frac": 0...
from django.template import loader, RequestContext from django.shortcuts import get_object_or_404, render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings from django.core.xheaders import populate_xheaders from django.utils.safestring import mark_safe from django.v...
{ "repo_name": "sv1jsb/pCMS", "path": "pCMS/fpg/views.py", "copies": "1", "size": "2766", "license": "bsd-3-clause", "hash": 3897319594280414000, "line_mean": 37.9577464789, "line_max": 102, "alpha_frac": 0.7140274765, "autogenerated": false, "ratio": 4.079646017699115, "config_test": false, "...
from django.template import loader, RequestContext from django.template.backends.django import Template from django.template.response import SimpleTemplateResponse import jingo # We monkeypatch SimpleTemplateResponse.rendered_content to use our jinja # rendering pipeline (most of the time). The exception is the admin...
{ "repo_name": "jasonthomas/zamboni", "path": "mkt/zadmin/__init__.py", "copies": "4", "size": "1581", "license": "bsd-3-clause", "hash": 3964939559559654000, "line_mean": 40.6052631579, "line_max": 79, "alpha_frac": 0.7020872865, "autogenerated": false, "ratio": 4.216, "config_test": false, "...
from django.template import loader, RequestContext from helpers import render_to from webmoney.forms import * from webmoney.models import Invoice, Purse @render_to('wm_sample/simple_payment.html') def simple_payment(request): response = {} initial = { 'LMI_PAYEE_PURSE': Purse.objects.all()[0], ...
{ "repo_name": "gotlium/django-payment-webmoney", "path": "wm_sample/views.py", "copies": "3", "size": "1627", "license": "mit", "hash": 998790263886735200, "line_mean": 30.9019607843, "line_max": 79, "alpha_frac": 0.6324523663, "autogenerated": false, "ratio": 3.403765690376569, "config_test": ...
from django.template import loader, RequestContext from django.http import Http404, HttpResponse, HttpResponseBadRequest from django.core.xheaders import populate_xheaders from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist def object_list(request, query...
{ "repo_name": "wooyek/nuntio", "path": "web/plebe/generic.py", "copies": "1", "size": "1665", "license": "mit", "hash": -8173544698821843000, "line_mean": 46.9705882353, "line_max": 95, "alpha_frac": 0.6048048048, "autogenerated": false, "ratio": 4.247448979591836, "config_test": false, "has_...
from django.template import loader, RequestContext from django.http import Http404, HttpResponse from django.core.xheaders import populate_xheaders from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist def object_list(request, queryset, paginate_by=None, p...
{ "repo_name": "greggian/TapdIn", "path": "django/views/generic/list_detail.py", "copies": "1", "size": "5568", "license": "apache-2.0", "hash": 3850142995229256700, "line_mean": 36.4, "line_max": 113, "alpha_frac": 0.5777658046, "autogenerated": false, "ratio": 4.205438066465256, "config_test":...
from django.template import loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone from django.utils.log import getLogger import warnings warnings.warn( 'Function-based generic views have been deprecated; use class-based views instea...
{ "repo_name": "bernardokyotoku/skillplant", "path": "django/views/generic/simple.py", "copies": "12", "size": "2383", "license": "bsd-3-clause", "hash": 5870756842648231000, "line_mean": 35.234375, "line_max": 107, "alpha_frac": 0.62736047, "autogenerated": false, "ratio": 4.404805914972274, "c...
from django.template import loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone def direct_to_template(request, template, extra_context=None, mimetype=None, **kwargs): """ Render a given template with any extra URL parameters i...
{ "repo_name": "greggian/TapdIn", "path": "django/views/generic/simple.py", "copies": "1", "size": "1675", "license": "apache-2.0", "hash": 7128553338973660000, "line_mean": 38.8536585366, "line_max": 107, "alpha_frac": 0.6459701493, "autogenerated": false, "ratio": 4.384816753926701, "config_te...
from django.template import loader from django.http import HttpResponse from django.core.mail import send_mail from django.db import transaction from django.db import IntegrityError from django.core.exceptions import ObjectDoesNotExist from WebStoreObjects import GameWithKeys from models import Game from models...
{ "repo_name": "sonictt1/material_game_store", "path": "views.py", "copies": "1", "size": "13540", "license": "apache-2.0", "hash": -8342021363878319000, "line_mean": 38.5389221557, "line_max": 135, "alpha_frac": 0.6117429838, "autogenerated": false, "ratio": 3.8752146536920433, "config_test": f...
from django.template import loader from servermachine.models import ServerMachine def nicedict(vl,name,value): '''vl is a list. Add a dictionary {name:value} if value is available''' if value is not None: vl.append({'name':name, 'value':value}) def renderpannel(request, ...
{ "repo_name": "pombredanne/unuk", "path": "src/unuk/libs/django-servermachine/servermachine/utils.py", "copies": "1", "size": "1718", "license": "bsd-3-clause", "hash": -153893614817534240, "line_mean": 31.6862745098, "line_max": 80, "alpha_frac": 0.4994179278, "autogenerated": false, "ratio": 4....
from django.template import loader, Template, Context from django.http import HttpResponse from django.shortcuts import render from django.shortcuts import render_to_response from django.contrib.auth import authenticate, login import datetime def index(request): template = loader.get_template('index.html') r...
{ "repo_name": "vorquel/yard-sale-mapper", "path": "views.py", "copies": "1", "size": "1448", "license": "mit", "hash": 2124786000766999300, "line_mean": 31.9318181818, "line_max": 84, "alpha_frac": 0.6726519337, "autogenerated": false, "ratio": 4.24633431085044, "config_test": false, "has_no_...
from django.template import loader, TemplateDoesNotExist from cms.utils import get_template_from_request from django.template.context import RequestContext from django.contrib.auth.models import AnonymousUser from django.contrib.sites.models import Site import re def get_placeholders(request, template_name): """ ...
{ "repo_name": "jjanssen/django-cms-patches", "path": "cms/admin/utils.py", "copies": "1", "size": "1429", "license": "bsd-3-clause", "hash": -273759626262530530, "line_mean": 32.2558139535, "line_max": 85, "alpha_frac": 0.6487053884, "autogenerated": false, "ratio": 4.178362573099415, "config_t...
from django.template import loader, TemplateDoesNotExist from django.http import HttpResponse, Http404 from django.shortcuts import render from django.conf import settings import os TEMPLATES_DIR = os.path.join(settings.BASE_DIR, 'templates') def template_list(request): tree = os.walk(TEMPLATES_DIR) ignore_d...
{ "repo_name": "redisca/django-redisca", "path": "redisca/frontend/views.py", "copies": "1", "size": "1335", "license": "mit", "hash": -6298616524736114000, "line_mean": 30.7857142857, "line_max": 83, "alpha_frac": 0.6217228464, "autogenerated": false, "ratio": 4.405940594059406, "config_test": ...
from django.template import ( Context as DjangoContext, add_to_builtins as django_add_to_builtins, import_library, ) from jinja2 import Template as _Jinja2Template # Merge with ``django.template``. from django.template import __all__ from django.template import * from django.template import Origin from dja...
{ "repo_name": "rossowl/coffin", "path": "coffin/template/__init__.py", "copies": "2", "size": "3824", "license": "bsd-3-clause", "hash": 4001892977775000000, "line_mean": 35.0754716981, "line_max": 92, "alpha_frac": 0.6942991632, "autogenerated": false, "ratio": 4.32579185520362, "config_test":...