text stringlengths 0 1.05M | meta dict |
|---|---|
from django.shortcuts import get_object_or_404
from django.http import Http404
from .rest import RESTView
from .models import Zone, Record
from .record_types import RECORD_TYPES
class ZonesView(RESTView):
def get(self, request, response):
zones = [z.export() for z in Zone.objects.all()]
return {... | {
"repo_name": "NaPs/restdns",
"path": "restdns/views.py",
"copies": "1",
"size": "2511",
"license": "mit",
"hash": -5443518696439666000,
"line_mean": 28.1976744186,
"line_max": 86,
"alpha_frac": 0.6168857029,
"autogenerated": false,
"ratio": 3.628612716763006,
"config_test": false,
"has_no_ke... |
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, Http404
from django.template.loader import select_template
from django.utils.translation import ugettext_lazy as _
from django.views.generic import DetailView, ListView
from .models import Category
def category_detail(request, path,... | {
"repo_name": "epicserve/django-categories",
"path": "categories/views.py",
"copies": "2",
"size": "5552",
"license": "apache-2.0",
"hash": -4729226602312108000,
"line_mean": 37.2896551724,
"line_max": 102,
"alpha_frac": 0.5767291066,
"autogenerated": false,
"ratio": 4.070381231671554,
"config_... |
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseNotAllowed
from kratos import models
from github.models import Repo
import json
from django.contrib.auth import get_user_model
User = get_user_model()
def team_members(req, team_name, perm_name, use... | {
"repo_name": "imuchnik/devdash",
"path": "devdash/kratos/views.py",
"copies": "5",
"size": "3250",
"license": "cc0-1.0",
"hash": 8023676568115886000,
"line_mean": 41.7631578947,
"line_max": 206,
"alpha_frac": 0.6415384615,
"autogenerated": false,
"ratio": 3.5211267605633805,
"config_test": fal... |
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from django.contrib import messages
from datetime import date # Import was missing?
from .models import Veranstaltung, ArtDerVeranstaltung, Studiumdings
from Grundgeruest.views import Liste... | {
"repo_name": "valuehack/scholarium.at",
"path": "Veranstaltungen/views.py",
"copies": "1",
"size": "7577",
"license": "mit",
"hash": -7463837540230705000,
"line_mean": 39.2553191489,
"line_max": 116,
"alpha_frac": 0.6248678647,
"autogenerated": false,
"ratio": 3.2,
"config_test": false,
"has... |
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect, Http404
from django.core.urlresolvers import reverse
from src.basic.groups.models import Group, GroupMember
def membership_required(function=None):
"""
Decorator for views that require user to be a member of a group,... | {
"repo_name": "hittu123/ruhive",
"path": "src/basic/groups/decorators.py",
"copies": "1",
"size": "1914",
"license": "mit",
"hash": 6788118302340624000,
"line_mean": 36.5490196078,
"line_max": 83,
"alpha_frac": 0.6677115987,
"autogenerated": false,
"ratio": 4.320541760722348,
"config_test": fal... |
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from contact.forms import ContactForm
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib import messages
from django.core.cache import cache
from django.conf import set... | {
"repo_name": "platypus-creation/django-contact",
"path": "contact/views.py",
"copies": "1",
"size": "2302",
"license": "mit",
"hash": 7772132231928044000,
"line_mean": 50.1555555556,
"line_max": 175,
"alpha_frac": 0.664639444,
"autogenerated": false,
"ratio": 4.310861423220974,
"config_test": ... |
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from micro_admin.models import User
from django.contrib.auth.mixins import LoginRequiredMixin
class UserPermissionRequiredMixin(LoginRequiredMixin):
def dispatch(self, request,... | {
"repo_name": "MicroPyramid/micro-finance",
"path": "micro_admin/mixins.py",
"copies": "2",
"size": "2596",
"license": "mit",
"hash": 8108767217913957000,
"line_mean": 32.7142857143,
"line_max": 73,
"alpha_frac": 0.6186440678,
"autogenerated": false,
"ratio": 4.46815834767642,
"config_test": fa... |
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from django.http import HttpResponseForbidden
from django.http import Http404
from django.shortcuts import render_to_response
from .decorators import dps_result_view
from .models import Transaction
@dps_result_view
def transa... | {
"repo_name": "takeflight/django-dps",
"path": "dps/views.py",
"copies": "1",
"size": "3144",
"license": "bsd-2-clause",
"hash": 2238386144222471700,
"line_mean": 37.8148148148,
"line_max": 76,
"alpha_frac": 0.6517175573,
"autogenerated": false,
"ratio": 4.75642965204236,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django import forms
from django.forms import Form, ModelForm, ModelChoiceField, ChoiceField
from django.contrib.auth.models import User, Group
from django.db.models import Count
from django.utils.translation import ugettext_lazy as _
from django.db.models.fields impor... | {
"repo_name": "laurenor/SchoolIdolAPI",
"path": "web/forms.py",
"copies": "1",
"size": "9732",
"license": "apache-2.0",
"hash": 1260047476842911000,
"line_mean": 42.6412556054,
"line_max": 273,
"alpha_frac": 0.6777640773,
"autogenerated": false,
"ratio": 3.7838258164852254,
"config_test": false... |
from django.shortcuts import get_object_or_404
from django_rest_logger import log
from knox.auth import TokenAuthentication
from knox.models import AuthToken
from rest_framework import status
from rest_framework.authentication import BasicAuthentication
from rest_framework.decorators import api_view
from rest_framework... | {
"repo_name": "CRUDNS/CRUDNS",
"path": "src/accounts/views.py",
"copies": "1",
"size": "2858",
"license": "mit",
"hash": 3303807082877203000,
"line_mean": 33.8536585366,
"line_max": 93,
"alpha_frac": 0.7169349195,
"autogenerated": false,
"ratio": 4.5007874015748035,
"config_test": false,
"has... |
from django.shortcuts import get_object_or_404
from django_rest_logger import log
from rest_framework import status, parsers, renderers
from rest_framework.generics import GenericAPIView
from rest_framework.mixins import CreateModelMixin
from rest_framework.response import Response
from rest_framework.views import APIV... | {
"repo_name": "polylow/authentication-in-react-and-django",
"path": "core/views.py",
"copies": "1",
"size": "3941",
"license": "mit",
"hash": -611198011085655300,
"line_mean": 33.5701754386,
"line_max": 113,
"alpha_frac": 0.717076884,
"autogenerated": false,
"ratio": 4.408277404921701,
"config_... |
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
from django.shortcuts import render
from django.core.mail import send_mail
from django.utils.translation import ugettext as _
from courses.forms import MailListForm
from courses.forms import StudentForm
from courses.models import Cou... | {
"repo_name": "sonic182/portfolio3",
"path": "courses/views.py",
"copies": "1",
"size": "3088",
"license": "mit",
"hash": -775736875005855000,
"line_mean": 33.6966292135,
"line_max": 79,
"alpha_frac": 0.5757772021,
"autogenerated": false,
"ratio": 3.9287531806615776,
"config_test": false,
"ha... |
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest
# from django.core.files.uploadedfile import UploadedFile
from django.views.decorators.csrf import csrf_exempt
from models import DropzoneImage
import json
def dropzone(req... | {
"repo_name": "zene/django-dropzone",
"path": "dropzone/dropzone_test/views.py",
"copies": "1",
"size": "1666",
"license": "mit",
"hash": 6532855735537829000,
"line_mean": 27.2372881356,
"line_max": 90,
"alpha_frac": 0.6512605042,
"autogenerated": false,
"ratio": 3.769230769230769,
"config_test... |
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from .models import Question
from .models import Choice
# Create your views here.
class IndexView(generic.ListView):
te... | {
"repo_name": "seantcanavan/docker-django",
"path": "myapp/polls/views.py",
"copies": "1",
"size": "1524",
"license": "unlicense",
"hash": -1663137861965259300,
"line_mean": 29.48,
"line_max": 82,
"alpha_frac": 0.6909448819,
"autogenerated": false,
"ratio": 4.186813186813187,
"config_test": fal... |
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from core.network.models import Network
from core.network.utils import calc_networks
from core.network.forms import NetworkForm
from core.views import (CoreDeleteView, CoreListView, CoreUpdateView,
CoreCreateVie... | {
"repo_name": "mozilla/inventory",
"path": "core/network/views.py",
"copies": "2",
"size": "1289",
"license": "bsd-3-clause",
"hash": -3778310846323995600,
"line_mean": 26.4255319149,
"line_max": 69,
"alpha_frac": 0.7090768037,
"autogenerated": false,
"ratio": 3.8477611940298506,
"config_test":... |
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from core.site.models import Site
from core.site.forms import SiteForm
from core.site.utils import get_vlans
from core.views import CoreDeleteView, CoreListView
from core.views import CoreCreateView, CoreUpdateView
class SiteView(obj... | {
"repo_name": "rtucker-mozilla/mozilla_inventory",
"path": "core/site/views.py",
"copies": "1",
"size": "1358",
"license": "bsd-3-clause",
"hash": 6632618017550799000,
"line_mean": 24.6226415094,
"line_max": 63,
"alpha_frac": 0.6988217968,
"autogenerated": false,
"ratio": 3.395,
"config_test": ... |
from django.shortcuts import get_object_or_404
from django.template.defaultfilters import slugify
from rest_framework.exceptions import NotFound
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.generics import (
CreateAPIView,
DestroyAPIView,
ListAP... | {
"repo_name": "kasper190/SPAforum",
"path": "forum/api/views.py",
"copies": "1",
"size": "2783",
"license": "mit",
"hash": 8256453859419358000,
"line_mean": 28.6170212766,
"line_max": 76,
"alpha_frac": 0.7380524614,
"autogenerated": false,
"ratio": 4.2039274924471295,
"config_test": false,
"h... |
from django.shortcuts import get_object_or_404
from django.template import Context, loader as template_loader
from django.conf import settings
from django.core.context_processors import csrf
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAP... | {
"repo_name": "takluyver/readthedocs.org",
"path": "readthedocs/restapi/views/footer_views.py",
"copies": "6",
"size": "4195",
"license": "mit",
"hash": 5000815453148028000,
"line_mean": 38.2056074766,
"line_max": 124,
"alpha_frac": 0.6517282479,
"autogenerated": false,
"ratio": 3.898698884758364... |
from django.shortcuts import get_object_or_404
from django.template import Context, loader as template_loader
from django.conf import settings
from rest_framework import decorators, permissions, viewsets, status
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer
from rest_framework.... | {
"repo_name": "nyergler/pythonslides",
"path": "readthedocs/restapi/views/footer_views.py",
"copies": "2",
"size": "1976",
"license": "mit",
"hash": -1017922198305330700,
"line_mean": 39.3265306122,
"line_max": 86,
"alpha_frac": 0.6938259109,
"autogenerated": false,
"ratio": 3.8518518518518516,
... |
from django.shortcuts import get_object_or_404
from django.template import loader as template_loader
from django.conf import settings
from django.core.context_processors import csrf
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer... | {
"repo_name": "SteveViss/readthedocs.org",
"path": "readthedocs/restapi/views/footer_views.py",
"copies": "4",
"size": "5496",
"license": "mit",
"hash": 2214877600726117400,
"line_mean": 39.7111111111,
"line_max": 98,
"alpha_frac": 0.6537481805,
"autogenerated": false,
"ratio": 3.8140180430256767... |
from django.shortcuts import get_object_or_404
from django.template import RequestContext, loader as template_loader
from django.conf import settings
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer
from rest_framework.response im... | {
"repo_name": "techtonik/readthedocs.org",
"path": "readthedocs/restapi/views/footer_views.py",
"copies": "1",
"size": "5521",
"license": "mit",
"hash": -4186373247111959000,
"line_mean": 39.8962962963,
"line_max": 98,
"alpha_frac": 0.65296142,
"autogenerated": false,
"ratio": 3.8287101248266295,... |
from django.shortcuts import get_object_or_404
from django.template import RequestContext, loader as template_loader
from django.conf import settings
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from rest_framework_js... | {
"repo_name": "tddv/readthedocs.org",
"path": "readthedocs/restapi/views/footer_views.py",
"copies": "1",
"size": "4965",
"license": "mit",
"hash": -971300886095451600,
"line_mean": 39.6967213115,
"line_max": 93,
"alpha_frac": 0.6590130916,
"autogenerated": false,
"ratio": 3.928006329113924,
"c... |
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.core.exceptions import SuspiciousOperation
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth.decorators import login_required
from django.u... | {
"repo_name": "drx/archfinch",
"path": "lists/views.py",
"copies": "1",
"size": "5975",
"license": "mit",
"hash": 2950671136977635000,
"line_mean": 34.5654761905,
"line_max": 147,
"alpha_frac": 0.649707113,
"autogenerated": false,
"ratio": 3.614640048396854,
"config_test": false,
"has_no_keyw... |
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.mail import EmailMessage
from django.conf import settings
from django.contrib.sites.models import Site... | {
"repo_name": "Keleir/django-basic-apps",
"path": "basic/invitations/views.py",
"copies": "9",
"size": "3193",
"license": "bsd-3-clause",
"hash": -4963595715280911000,
"line_mean": 32.6105263158,
"line_max": 103,
"alpha_frac": 0.6987159411,
"autogenerated": false,
"ratio": 3.99125,
"config_test... |
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.core.mail import EmailMessage
from django.conf import settings
import weasyprint
from io import BytesIO
from paypal.standard.models import ST_PP_COMPLETED
from paypal.standard.ipn.signals import valid_ipn_rece... | {
"repo_name": "delitamakanda/jobboard",
"path": "payment/signals.py",
"copies": "1",
"size": "1409",
"license": "mit",
"hash": 6589335199349677000,
"line_mean": 35.1282051282,
"line_max": 88,
"alpha_frac": 0.67920511,
"autogenerated": false,
"ratio": 3.7876344086021505,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from rest_framework import generics, views, status
from rest_framework.decorators import api_view
from rest_framework.exceptions import APIException
from rest_framework.response import Response
from rest_framework.parsers... | {
"repo_name": "ethanal/Nimbus",
"path": "nimbus/apps/api/views.py",
"copies": "1",
"size": "3130",
"license": "mit",
"hash": 2533072735367564300,
"line_mean": 32.6559139785,
"line_max": 133,
"alpha_frac": 0.6913738019,
"autogenerated": false,
"ratio": 3.845208845208845,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django.template.response import TemplateResponse
from django.views.generic import ListView
from payments.models import PAYMENT_STATUS_CHOICES
from ..views import (FilterByStatusMixin, StaffMemberOnlyMixin,
staff_member_required)
from ...order.mod... | {
"repo_name": "rchav/vinerack",
"path": "saleor/dashboard/payments/views.py",
"copies": "8",
"size": "1155",
"license": "bsd-3-clause",
"hash": -1549862513283555000,
"line_mean": 36.2580645161,
"line_max": 75,
"alpha_frac": 0.7021645022,
"autogenerated": false,
"ratio": 4.052631578947368,
"conf... |
from django.shortcuts import get_object_or_404
from django.template.response import TemplateResponse
from ...core.utils import get_paginator_items
from ..views import staff_member_required
from ...order.models import Payment
from ..order.forms import PaymentFilterForm
@staff_member_required
def payment_list(request)... | {
"repo_name": "car3oon/saleor",
"path": "saleor/dashboard/payments/views.py",
"copies": "1",
"size": "1161",
"license": "bsd-3-clause",
"hash": 7446658729493772000,
"line_mean": 34.1818181818,
"line_max": 73,
"alpha_frac": 0.6864771748,
"autogenerated": false,
"ratio": 3.962457337883959,
"confi... |
from django.shortcuts import get_object_or_404
from django.template.response import TemplateResponse
from ...product import signals
from . import models
def index(request, *args, **kwargs):
"""Show all sets"""
sets = models.ProductSet.objects.all()
return TemplateResponse(request, 'satchless/productset/in... | {
"repo_name": "fusionbox/satchless",
"path": "satchless/contrib/productset/views.py",
"copies": "1",
"size": "1120",
"license": "bsd-3-clause",
"hash": -8301683219275476000,
"line_mean": 32.9393939394,
"line_max": 75,
"alpha_frac": 0.6455357143,
"autogenerated": false,
"ratio": 4.3076923076923075... |
from django.shortcuts import get_object_or_404
from django.urls import path, include
from django.utils.translation import ugettext_lazy as _
from urllib.parse import urljoin
from touchtechnology.admin.base import AdminComponent
from touchtechnology.common.decorators import staff_login_required_m
from touchtechnology.n... | {
"repo_name": "goodtune/vitriolic",
"path": "touchtechnology/news/admin.py",
"copies": "1",
"size": "6244",
"license": "bsd-3-clause",
"hash": -223482753185751800,
"line_mean": 34.0786516854,
"line_max": 88,
"alpha_frac": 0.5757527226,
"autogenerated": false,
"ratio": 4.297315898141775,
"config... |
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.http import HttpResponse, HttpResponseForbidden
from django.contrib.auth.decorators import login_required, user_passes_test
from django.views.generic.base import View
from revuo.models import NewsItem, BlogI... | {
"repo_name": "Lasanha/revuo",
"path": "revuo/views/item_delete.py",
"copies": "1",
"size": "1024",
"license": "bsd-3-clause",
"hash": -2409575950249011700,
"line_mean": 36.9259259259,
"line_max": 80,
"alpha_frac": 0.69921875,
"autogenerated": false,
"ratio": 3.9536679536679538,
"config_test": ... |
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from pontoon.base.views import AjaxFormPostView
from pontoon.base.models import Project
from pontoon.base.utils import require_AJAX, permission_required
from .forms import LinkTagResourcesAdminForm
class ProjectTagAd... | {
"repo_name": "jotes/pontoon",
"path": "pontoon/tags/admin/views.py",
"copies": "1",
"size": "1053",
"license": "bsd-3-clause",
"hash": -6653035856092891000,
"line_mean": 36.6071428571,
"line_max": 82,
"alpha_frac": 0.7084520418,
"autogenerated": false,
"ratio": 3.734042553191489,
"config_test"... |
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import Atom1Feed
from django.utils.html import strip_tags, escape
from django.utils.translation import ugettext as _
from kitsune import forums as constants
from kitsune.kbforums.models import Thread
from kitsune.wiki.models import Document... | {
"repo_name": "anushbmx/kitsune",
"path": "kitsune/kbforums/feeds.py",
"copies": "1",
"size": "2180",
"license": "bsd-3-clause",
"hash": -2094838799383949000,
"line_mean": 28.8630136986,
"line_max": 70,
"alpha_frac": 0.6270642202,
"autogenerated": false,
"ratio": 4.082397003745318,
"config_test... |
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import DefaultFeed
from django.utils.translation import ugettext as _
from jingo.helpers import datetime
from olympia import amo
from olympia.amo.urlresolvers import reverse
from olympia.amo.helpers import absolutify, url
from olympia.amo.f... | {
"repo_name": "andymckay/addons-server",
"path": "src/olympia/versions/feeds.py",
"copies": "3",
"size": "3970",
"license": "bsd-3-clause",
"hash": 5875567981322682000,
"line_mean": 36.8095238095,
"line_max": 78,
"alpha_frac": 0.6302267003,
"autogenerated": false,
"ratio": 3.8026819923371646,
"... |
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import DefaultFeed
from django.utils.translation import ugettext
from jingo.helpers import datetime
from olympia import amo
from olympia.amo.urlresolvers import reverse
from olympia.amo.helpers import absolutify, url
from olympia.amo.feeds ... | {
"repo_name": "harikishen/addons-server",
"path": "src/olympia/versions/feeds.py",
"copies": "1",
"size": "3984",
"license": "bsd-3-clause",
"hash": -7950396394166443000,
"line_mean": 36.9428571429,
"line_max": 78,
"alpha_frac": 0.6325301205,
"autogenerated": false,
"ratio": 3.808795411089866,
... |
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import DefaultFeed
from django.utils.translation import ugettext
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo.feeds import BaseFeed
from olympia.amo.templatetags.jinja_helpers import absolutify, format_da... | {
"repo_name": "wagnerand/olympia",
"path": "src/olympia/versions/feeds.py",
"copies": "2",
"size": "3931",
"license": "bsd-3-clause",
"hash": 6284575521261435000,
"line_mean": 36.7980769231,
"line_max": 79,
"alpha_frac": 0.6301195625,
"autogenerated": false,
"ratio": 3.809108527131783,
"config_... |
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import DefaultFeed
from django.utils.translation import ugettext
from olympia import amo
from olympia.amo.urlresolvers import reverse
from olympia.amo.templatetags.jinja_helpers import (
absolutify, url, format_date)
from olympia.amo.fe... | {
"repo_name": "tsl143/addons-server",
"path": "src/olympia/versions/feeds.py",
"copies": "1",
"size": "3991",
"license": "bsd-3-clause",
"hash": -746168314050794200,
"line_mean": 37.0095238095,
"line_max": 78,
"alpha_frac": 0.6311701328,
"autogenerated": false,
"ratio": 3.797335870599429,
"conf... |
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import DefaultFeed
from jingo.helpers import datetime
from tower import ugettext as _
from olympia import amo
from olympia.amo.urlresolvers import reverse
from olympia.amo.helpers import absolutify, url
from olympia.amo.feeds import NonAto... | {
"repo_name": "jpetto/olympia",
"path": "src/olympia/versions/feeds.py",
"copies": "1",
"size": "3952",
"license": "bsd-3-clause",
"hash": 4983499970647271000,
"line_mean": 36.2830188679,
"line_max": 78,
"alpha_frac": 0.6287955466,
"autogenerated": false,
"ratio": 3.7963496637848224,
"config_te... |
from django.shortcuts import get_object_or_404
from django.utils.functional import SimpleLazyObject
from django_hosts.reverse import reverse_host
def get_site(request, *args, **kwargs):
if not hasattr(request, '_cached_site'): # pragma: no cover
from django.contrib.sites.models import Site
host ... | {
"repo_name": "cato-/django-hosts",
"path": "django_hosts/callbacks.py",
"copies": "2",
"size": "2397",
"license": "bsd-3-clause",
"hash": -4236693157368178000,
"line_mean": 40.3275862069,
"line_max": 79,
"alpha_frac": 0.6858573217,
"autogenerated": false,
"ratio": 4.042158516020236,
"config_te... |
from django.shortcuts import get_object_or_404
from django.utils.html import strip_tags
from django_socketio import events
from bootstrapit.models import Theme
@events.on_message(channel="theme")
def message(request, socket, context, message):
"""
Event handler for a room receiving a message. First validates a
j... | {
"repo_name": "h3/bootstrapit",
"path": "bootstrapit/events.py",
"copies": "1",
"size": "2094",
"license": "bsd-2-clause",
"hash": -7363660812920143000,
"line_mean": 31.71875,
"line_max": 73,
"alpha_frac": 0.5754536772,
"autogenerated": false,
"ratio": 3.870609981515712,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django.utils import timezone
from rest_framework import viewsets
from rest_framework import exceptions
from bughouse.models import (
Game,
Player,
PlayerRating,
)
from .serializers import (
GameSerializer,
PlayerSerializer,
PlayerRatingSeria... | {
"repo_name": "simpleenergy/bughouse-ranking",
"path": "bughouse/api/v1/views.py",
"copies": "1",
"size": "1182",
"license": "mit",
"hash": 5494234844161188000,
"line_mean": 26.488372093,
"line_max": 90,
"alpha_frac": 0.7216582064,
"autogenerated": false,
"ratio": 4.118466898954704,
"config_tes... |
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from django.views.generic import DetailView, ListView
from .models import BandC, Meeting, Document
class BandCList(ListView):
model = BandC
def get_queryset(self):
return super(BandCList, self).get_queryset().select... | {
"repo_name": "crccheck/atx-bandc",
"path": "bandc/apps/agenda/views.py",
"copies": "1",
"size": "1721",
"license": "bsd-3-clause",
"hash": -6403759614088849000,
"line_mean": 29.1929824561,
"line_max": 88,
"alpha_frac": 0.6066240558,
"autogenerated": false,
"ratio": 3.6931330472103006,
"config_... |
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext as _
from olympia import amo
from olympia.amo.feeds import NonAtomicFeed
from olympia.amo.urlresolvers import reverse
from olympia.amo.helpers import absolutify, url, page_name
from olympia.addons.models import Addon, Category... | {
"repo_name": "mstriemer/addons-server",
"path": "src/olympia/browse/feeds.py",
"copies": "6",
"size": "7036",
"license": "bsd-3-clause",
"hash": -5747786769836045000,
"line_mean": 32.5047619048,
"line_max": 79,
"alpha_frac": 0.5960773167,
"autogenerated": false,
"ratio": 4.041355542791499,
"co... |
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from oscar.apps.basket import signals
from oscar.core.loading import get_model, get_class
from rest_framework import status, generics, exceptions
from rest_framework.decorators import api_view
from rest_framework.re... | {
"repo_name": "regulusweb/django-oscar-api",
"path": "oscarapi/views/basket.py",
"copies": "1",
"size": "10832",
"license": "bsd-3-clause",
"hash": 712934921094188800,
"line_mean": 34.2833876221,
"line_max": 101,
"alpha_frac": 0.6231536189,
"autogenerated": false,
"ratio": 4.242851547199373,
"c... |
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext
from six.moves.urllib.parse import quote
from olympia.addons.models import Addon
from olympia.amo.feeds import BaseFeed
from olympia.amo.templatetags import jinja_helpers
from olympia.ratings.models import Rating
class Ratin... | {
"repo_name": "wagnerand/olympia",
"path": "src/olympia/ratings/feeds.py",
"copies": "2",
"size": "2417",
"license": "bsd-3-clause",
"hash": 6659742319928540000,
"line_mean": 34.5441176471,
"line_max": 76,
"alpha_frac": 0.636326024,
"autogenerated": false,
"ratio": 3.8487261146496814,
"config_t... |
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext
from olympia import amo
from olympia.amo.feeds import NonAtomicFeed
from olympia.amo.urlresolvers import reverse
from olympia.amo.helpers import absolutify, url, page_name
from olympia.addons.models import Addon, Category
fro... | {
"repo_name": "harikishen/addons-server",
"path": "src/olympia/browse/feeds.py",
"copies": "1",
"size": "7155",
"license": "bsd-3-clause",
"hash": -1306532800406335000,
"line_mean": 32.75,
"line_max": 79,
"alpha_frac": 0.6015373864,
"autogenerated": false,
"ratio": 4.072282299373933,
"config_te... |
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext, ugettext_lazy as _
from olympia import amo
from olympia.addons.models import Addon, Category
from olympia.amo.feeds import BaseFeed
from olympia.amo.templatetags.jinja_helpers import absolutify, page_name, url
from olympia.am... | {
"repo_name": "atiqueahmedziad/addons-server",
"path": "src/olympia/browse/feeds.py",
"copies": "1",
"size": "7159",
"license": "bsd-3-clause",
"hash": 3878918762575987700,
"line_mean": 33.0904761905,
"line_max": 79,
"alpha_frac": 0.6006425478,
"autogenerated": false,
"ratio": 4.0699260943718025,... |
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext, ugettext_lazy as _
from olympia import amo
from olympia.amo.feeds import NonAtomicFeed
from olympia.amo.urlresolvers import reverse
from olympia.amo.templatetags.jinja_helpers import absolutify, url, page_name
from olympia.ad... | {
"repo_name": "tsl143/addons-server",
"path": "src/olympia/browse/feeds.py",
"copies": "1",
"size": "7178",
"license": "bsd-3-clause",
"hash": 2746162860576543000,
"line_mean": 33.180952381,
"line_max": 79,
"alpha_frac": 0.6016996378,
"autogenerated": false,
"ratio": 4.064552661381653,
"config_... |
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext, ugettext_lazy as _
import six
from olympia import amo
from olympia.addons.models import Addon, Category
from olympia.amo.feeds import BaseFeed
from olympia.amo.templatetags.jinja_helpers import absolutify, page_name, url
fro... | {
"repo_name": "aviarypl/mozilla-l10n-addons-server",
"path": "src/olympia/browse/feeds.py",
"copies": "2",
"size": "7183",
"license": "bsd-3-clause",
"hash": 831841601464030500,
"line_mean": 32.8820754717,
"line_max": 79,
"alpha_frac": 0.6010023667,
"autogenerated": false,
"ratio": 4.055900621118... |
from django.shortcuts import get_object_or_404
from django.views.decorators.cache import cache_page
from django.conf import settings
from django.utils.decorators import method_decorator
from djgeojson.views import GeoJSONLayerView
from .models import City, RestrictedArea, RestrictedAreaType, District
class LandLayer... | {
"repo_name": "makinacorpus/Geotrek",
"path": "geotrek/zoning/views.py",
"copies": "2",
"size": "1317",
"license": "bsd-2-clause",
"hash": 8925787365806710000,
"line_mean": 31.1219512195,
"line_max": 98,
"alpha_frac": 0.7372817008,
"autogenerated": false,
"ratio": 3.668523676880223,
"config_tes... |
from django.shortcuts import get_object_or_404
from django.views.decorators.cache import cache_page
from canvas.models import get_mapping_id_from_short_id
from canvas.shortcuts import r2r_jinja
from canvas.view_guards import require_staff
from drawquest.apps.drawquest_auth.details_models import UserDetails
from drawqu... | {
"repo_name": "canvasnetworks/canvas",
"path": "website/drawquest/apps/quest_comments/views.py",
"copies": "1",
"size": "1032",
"license": "bsd-3-clause",
"hash": 8273374749401209000,
"line_mean": 32.2903225806,
"line_max": 68,
"alpha_frac": 0.7403100775,
"autogenerated": false,
"ratio": 3.474747... |
from django.shortcuts import get_object_or_404
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.models import User
from django.http import HttpResponse
import json
from random import randrange
from medic.forms import AuthForm, RegistrationForm, RequestForm, MessageForm
from medic.models im... | {
"repo_name": "boyombo/django-stations",
"path": "stations/medic/views.py",
"copies": "1",
"size": "8045",
"license": "mit",
"hash": 7812747234572885000,
"line_mean": 31.0517928287,
"line_max": 77,
"alpha_frac": 0.5482908639,
"autogenerated": false,
"ratio": 3.834604385128694,
"config_test": fa... |
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_http_methods
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from note.models.note import Note
from note.models.tag import Tag
import json
@require_http_methods(["GET"])
@log... | {
"repo_name": "MaximeRaynal/SimpleNote",
"path": "src/note/views.py",
"copies": "1",
"size": "2271",
"license": "mit",
"hash": -6291334935156368000,
"line_mean": 34.25,
"line_max": 99,
"alpha_frac": 0.6879432624,
"autogenerated": false,
"ratio": 3.514018691588785,
"config_test": false,
"has_n... |
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST, require_GET
from django.http import HttpResponse, HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from models import Draft
from django.contrib import messages
@require_POST
def save(reques... | {
"repo_name": "platypus-creation/django-draft",
"path": "draft/views.py",
"copies": "1",
"size": "1150",
"license": "mit",
"hash": 8336208549295416000,
"line_mean": 34.96875,
"line_max": 111,
"alpha_frac": 0.7217391304,
"autogenerated": false,
"ratio": 4.063604240282685,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django.views.generic.base import ContextMixin
from urllib.parse import urlencode
from .models import Tags
class TagMixin(ContextMixin):
"""
Class is for extending the context with selected_tags.
"""
class Tag:
"""
Class has three a... | {
"repo_name": "rudikovrf/django_blog",
"path": "tag/TagMixin.py",
"copies": "1",
"size": "2481",
"license": "mit",
"hash": 1388844246175001600,
"line_mean": 31.6447368421,
"line_max": 93,
"alpha_frac": 0.4937525191,
"autogenerated": false,
"ratio": 4.307291666666667,
"config_test": false,
"ha... |
from django.shortcuts import get_object_or_404
from django.views.generic.base import TemplateView
from rest_framework import parsers, renderers, generics, status
from rest_framework.authtoken.models import Token
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.permissions import ... | {
"repo_name": "manosim/django-rest-framework-docs",
"path": "demo/project/accounts/views.py",
"copies": "2",
"size": "2665",
"license": "bsd-2-clause",
"hash": 1904731673449788200,
"line_mean": 31.1084337349,
"line_max": 94,
"alpha_frac": 0.7208255159,
"autogenerated": false,
"ratio": 4.270833333... |
from django.shortcuts import get_object_or_404
from django.views.generic.base import TemplateView
from .models import Album
class AlbumsView(TemplateView):
template_name = 'albums/albums.html'
def get_context_data(self, **kwargs):
context = super(AlbumsView, self).get_context_data(**kwargs)
... | {
"repo_name": "lukasmatiasko/jakubcaprnka",
"path": "jakubcaprnka/albums/views.py",
"copies": "1",
"size": "1030",
"license": "mit",
"hash": -4822824570761117000,
"line_mean": 23.5238095238,
"line_max": 68,
"alpha_frac": 0.6194174757,
"autogenerated": false,
"ratio": 3.6917562724014337,
"config... |
from django.shortcuts import get_object_or_404
from django.views.generic.base import TemplateView
from .models import Category
from store.utils import make_page
class IndexView(TemplateView):
template_name = 'category/index.html'
def render_to_response(self, context, **response_kwargs):
# Set curren... | {
"repo_name": "sorz/isi",
"path": "store/category/views.py",
"copies": "1",
"size": "2093",
"license": "mit",
"hash": -7839692181647619000,
"line_mean": 34.4745762712,
"line_max": 102,
"alpha_frac": 0.6588628763,
"autogenerated": false,
"ratio": 3.986666666666667,
"config_test": false,
"has_n... |
from django.shortcuts import get_object_or_404
from django.views.generic.create_update import get_model_and_form_class
from django.views.generic.create_update import create_object
from django.http import HttpResponseRedirect
from django.shortcuts import render_... | {
"repo_name": "noelevans/sandpit",
"path": "poolratings/ratings/views.py",
"copies": "1",
"size": "1477",
"license": "mit",
"hash": -6617633020383601000,
"line_mean": 35.925,
"line_max": 71,
"alpha_frac": 0.615436696,
"autogenerated": false,
"ratio": 4.080110497237569,
"config_test": false,
"... |
from django.shortcuts import get_object_or_404
from django.views.generic.dates import YearArchiveView
from django.views.generic import DetailView
# from django.db.models import Count
from taggit.models import Tag
from endless_pagination.views import AjaxListView
from galleries.models import Image, Gallery
class Mon... | {
"repo_name": "dangerdak/apuniverse",
"path": "apuniverse/galleries/views.py",
"copies": "1",
"size": "3710",
"license": "mit",
"hash": 8540529208794782000,
"line_mean": 33.3518518519,
"line_max": 78,
"alpha_frac": 0.6188679245,
"autogenerated": false,
"ratio": 4.1268075639599555,
"config_test"... |
from django.shortcuts import get_object_or_404
from django.views.generic.detail import DetailView
from django.core.exceptions import ObjectDoesNotExist
from ..models import (
Novedad,
CarruselImagenes
)
class NovedadView(DetailView):
"""
Vista de detalle para la visualización de novedades
"""
... | {
"repo_name": "desarrollogt-frm-utn/reservas",
"path": "app_reservas/views/novedad.py",
"copies": "1",
"size": "1363",
"license": "mit",
"hash": -7864184530493720000,
"line_mean": 30.5348837209,
"line_max": 83,
"alpha_frac": 0.652398524,
"autogenerated": false,
"ratio": 3.4130982367758187,
"con... |
from django.shortcuts import get_object_or_404
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.edit import CreateView, UpdateView
from django.views.generic.list import ListView
from braces.views import LoginRequiredMixin, StaffuserRequiredMixin
from forum.forms import NodeForm
from ... | {
"repo_name": "chiehtu/kissaten",
"path": "forum/views/node.py",
"copies": "1",
"size": "1474",
"license": "mit",
"hash": 3872804087679132000,
"line_mean": 27.9019607843,
"line_max": 77,
"alpha_frac": 0.7143826323,
"autogenerated": false,
"ratio": 3.7794871794871794,
"config_test": false,
"ha... |
from django.shortcuts import get_object_or_404
from django.views.generic import (ArchiveIndexView, DateDetailView, DetailView,
YearArchiveView)
from django.views.generic.list import ListView
from longform.models import Article
from taggit.models import Tag
def _get_all_years():
"... | {
"repo_name": "martey/django-longform",
"path": "longform/views.py",
"copies": "1",
"size": "2170",
"license": "mit",
"hash": -7277142402373339000,
"line_mean": 28.7260273973,
"line_max": 79,
"alpha_frac": 0.6649769585,
"autogenerated": false,
"ratio": 4.033457249070632,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django.views.generic import dates
from newswall.models import Source, Story
try:
from towel import paginator
except ImportError:
from django.core import paginator
__all__ = (
'ArchiveIndexView', 'YearArchiveView', 'MonthArchiveView',
'DayArchiveVie... | {
"repo_name": "registerguard/django-newswall",
"path": "newswall/views.py",
"copies": "1",
"size": "3944",
"license": "bsd-3-clause",
"hash": -1897900191628728000,
"line_mean": 30.552,
"line_max": 169,
"alpha_frac": 0.6995436105,
"autogenerated": false,
"ratio": 3.82541222114452,
"config_test":... |
from django.shortcuts import get_object_or_404
from django.views.generic import DetailView, ListView
from braces.views import OrderableListMixin
from .models import Post, Tag
ORDER_FIELD = {'title': 'title'}
class PermissionMixin(object):
def get_queryset(self, *args, **kwargs):
qs = super(PermissionMix... | {
"repo_name": "ad-m/pru",
"path": "pru/blog/views.py",
"copies": "1",
"size": "1186",
"license": "bsd-3-clause",
"hash": 5241226816998893000,
"line_mean": 31.0540540541,
"line_max": 75,
"alpha_frac": 0.6635750422,
"autogenerated": false,
"ratio": 3.6048632218844983,
"config_test": false,
"has... |
from django.shortcuts import get_object_or_404
from django.views.generic import DetailView, ListView
from . import forms, models
class PostList(ListView):
template_name = 'posts/post-list.html'
queryset = models.Post.unhidden().order_by('-created_at')
paginate_by = 10
class PostDetail(DetailView):
... | {
"repo_name": "Afonasev/Blog",
"path": "backend/posts/views.py",
"copies": "1",
"size": "1354",
"license": "mit",
"hash": -2758957203712012300,
"line_mean": 28.4347826087,
"line_max": 76,
"alpha_frac": 0.646971935,
"autogenerated": false,
"ratio": 3.8140845070422533,
"config_test": false,
"ha... |
from django.shortcuts import get_object_or_404
from django.views.generic import DetailView, ListView, TemplateView
from haystack.generic_views import FacetedSearchView
from django.db.models import Max, Min
from .forms import PeriodicalsSearchForm
from .models import Article, Issue, Page, Publication
def _get_highligh... | {
"repo_name": "kingsdigitallab/mpol-django",
"path": "periodicals/views.py",
"copies": "1",
"size": "7096",
"license": "mit",
"hash": 3571579832776071700,
"line_mean": 32.4716981132,
"line_max": 79,
"alpha_frac": 0.6168263811,
"autogenerated": false,
"ratio": 4,
"config_test": false,
"has_no_... |
from django.shortcuts import get_object_or_404
from django.views.generic import DetailView
from django.views.generic import ListView
from stashboard.models import Announcement
from stashboard.models import Issue
from stashboard.models import Region
from stashboard.models import Status
from stashboard.models import Serv... | {
"repo_name": "kyleconroy/stashboard2",
"path": "stashboard/views.py",
"copies": "1",
"size": "3340",
"license": "mit",
"hash": 7008743749279785000,
"line_mean": 30.8095238095,
"line_max": 80,
"alpha_frac": 0.7104790419,
"autogenerated": false,
"ratio": 3.924794359576968,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django.views.generic import list_detail
from basic.people.models import *
def person_type_detail(request, slug, **kwargs):
return list_detail.object_detail(
request,
queryset = PersonType.objects.all(),
slug = slug,
**kwargs
)... | {
"repo_name": "thoas/django-basic-apps",
"path": "basic/people/views.py",
"copies": "1",
"size": "1939",
"license": "bsd-3-clause",
"hash": -2288602182710125300,
"line_mean": 27.5147058824,
"line_max": 110,
"alpha_frac": 0.6209386282,
"autogenerated": false,
"ratio": 3.6447368421052633,
"config... |
from django.shortcuts import get_object_or_404
from django.views.generic import list_detail
from src.basic.people.models import *
def person_type_detail(request, slug, **kwargs):
return list_detail.object_detail(
request,
queryset=PersonType.objects.all(),
slug=slug,
**kwargs
)... | {
"repo_name": "hittu123/ruhive",
"path": "src/basic/people/views.py",
"copies": "1",
"size": "1901",
"license": "mit",
"hash": -4000283904349909000,
"line_mean": 27.8181818182,
"line_max": 110,
"alpha_frac": 0.640189374,
"autogenerated": false,
"ratio": 3.553271028037383,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django.views.generic import list_detail
from libros.bookreader.models import Repository, Book
def browse(request, **kwargs):
kwargs.setdefault('template_object_name','repository')
kwargs.setdefault('queryset', Repository.objects.all())
return list_detail... | {
"repo_name": "Early-Modern-OCR/Cobre",
"path": "libros/bookreader/views/repository.py",
"copies": "1",
"size": "1306",
"license": "apache-2.0",
"hash": 2002687636894279700,
"line_mean": 39.84375,
"line_max": 89,
"alpha_frac": 0.7220520674,
"autogenerated": false,
"ratio": 4.043343653250774,
"c... |
from django.shortcuts import get_object_or_404
from django.views.generic import list_detail, simple
from project_utils import annotate, get_page
from site_preferences.utils import get_cached_site_prefs
from models import TumblelogEntry
from settings import BloggingSettings
from utils import get_cached_tumblelog_entr... | {
"repo_name": "mazelife/django-belleville",
"path": "belleville/blogging/tumblelog_views.py",
"copies": "1",
"size": "1163",
"license": "apache-2.0",
"hash": -1909179102063062500,
"line_mean": 36.5161290323,
"line_max": 76,
"alpha_frac": 0.7334479794,
"autogenerated": false,
"ratio": 3.3323782234... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from django.conf import settings
from builds.models import Build, Version
from builds.filters import BuildFilter
from projects.models import Project
from redis import Redis, ConnectionError
class BuildList(ListView)... | {
"repo_name": "cgourlay/readthedocs.org",
"path": "readthedocs/builds/views.py",
"copies": "12",
"size": "1939",
"license": "mit",
"hash": -6894549245790329000,
"line_mean": 29.7777777778,
"line_max": 98,
"alpha_frac": 0.6560082517,
"autogenerated": false,
"ratio": 4.178879310344827,
"config_te... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from django.conf import settings
from readthedocs.builds.models import Build, Version
from readthedocs.builds.filters import BuildFilter
from readthedocs.projects.models import Project
from redis import Redis, Connect... | {
"repo_name": "kdkeyser/readthedocs.org",
"path": "readthedocs/builds/views.py",
"copies": "4",
"size": "1975",
"license": "mit",
"hash": 1330803977830510800,
"line_mean": 30.3492063492,
"line_max": 98,
"alpha_frac": 0.6607594937,
"autogenerated": false,
"ratio": 4.175475687103594,
"config_test... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from django.http import HttpResponsePermanentRedirect
from django.conf import settings
from django.core.urlresolvers import reverse
from readthedocs.builds.models import Build, Version
from readthedocs.builds.filters ... | {
"repo_name": "singingwolfboy/readthedocs.org",
"path": "readthedocs/builds/views.py",
"copies": "3",
"size": "2369",
"license": "mit",
"hash": -1756591319507498000,
"line_mean": 31.0135135135,
"line_max": 98,
"alpha_frac": 0.6838328409,
"autogenerated": false,
"ratio": 4.207815275310835,
"conf... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from articles.models import Article, Tag
class ArticleListView(ListView):
model = Article
ordering = ['-first_commit']
paginate_by = 10
def get_context_data(self, **kwargs):
context = super(A... | {
"repo_name": "invzhi/invzhi.me",
"path": "articles/views.py",
"copies": "1",
"size": "1715",
"license": "bsd-3-clause",
"hash": -8645218599006138000,
"line_mean": 27.1147540984,
"line_max": 79,
"alpha_frac": 0.6373177843,
"autogenerated": false,
"ratio": 3.906605922551253,
"config_test": false... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from builds.models import Build
from builds.filters import BuildFilter
from projects.models import Project
class BuildList(ListView):
model = Build
def get_queryset(self):
self.project_slug = self.kwa... | {
"repo_name": "adrianmugnoz/Documentacion-Divulgame",
"path": "readthedocs/builds/views.py",
"copies": "2",
"size": "1555",
"license": "mit",
"hash": 8007259653699530000,
"line_mean": 30.1,
"line_max": 82,
"alpha_frac": 0.6591639871,
"autogenerated": false,
"ratio": 4.113756613756614,
"config_t... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from builds.models import Build, Version
from builds.filters import BuildFilter
from projects.models import Project
class BuildList(ListView):
model = Build
def get_queryset(self):
self.project_slug ... | {
"repo_name": "apparena/docs",
"path": "readthedocs/builds/views.py",
"copies": "1",
"size": "1671",
"license": "mit",
"hash": -446077362125331700,
"line_mean": 30.5283018868,
"line_max": 98,
"alpha_frac": 0.6624775583,
"autogenerated": false,
"ratio": 4.095588235294118,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView, TemplateView, RedirectView
import json
from core import utils
from core.models import Term, DivisionSet, Subject, SubjectStats, \
Course, Section, Grade, GradeCount, \
D... | {
"repo_name": "rskwan/ucb-grade-dists",
"path": "ucbgradedists/search/views.py",
"copies": "1",
"size": "2962",
"license": "mit",
"hash": -612522625568086500,
"line_mean": 32.2808988764,
"line_max": 144,
"alpha_frac": 0.6299797434,
"autogenerated": false,
"ratio": 3.773248407643312,
"config_tes... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView
from django.views.generic.detail import DetailView
from cms_contact.views.map import MapView, MapResultView
from cms_people.models import Person
class PeopleView(MapView):
template_name = 'cms_people/people.html'
model =... | {
"repo_name": "python-spain/djangocms-association",
"path": "cms_people/views/people.py",
"copies": "1",
"size": "1268",
"license": "mit",
"hash": 4202154711094748700,
"line_mean": 35.2285714286,
"line_max": 95,
"alpha_frac": 0.7137223975,
"autogenerated": false,
"ratio": 3.602272727272727,
"co... |
from django.shortcuts import get_object_or_404
from django.views.generic import ListView
from .. import forms, models
class GroupList(ListView):
"""Show a top-level list of discussion groups."""
model = models.Group
template_name = 'groups/group_list.html'
ordering = 'name'
class GroupDetail(ListVi... | {
"repo_name": "incuna/incuna-groups",
"path": "groups/views/groups.py",
"copies": "1",
"size": "1531",
"license": "bsd-2-clause",
"hash": 7103878279561341000,
"line_mean": 36.3414634146,
"line_max": 82,
"alpha_frac": 0.6590463749,
"autogenerated": false,
"ratio": 3.956072351421189,
"config_test... |
from django.shortcuts import get_object_or_404
from django.views.generic import (
CreateView, ListView, DetailView, FormView, UpdateView)
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from braces.views import (
LoginRequiredMixin, ... | {
"repo_name": "timrchavez/capomastro",
"path": "projects/views.py",
"copies": "1",
"size": "7575",
"license": "mit",
"hash": -7780139876466138000,
"line_mean": 31.650862069,
"line_max": 79,
"alpha_frac": 0.6704950495,
"autogenerated": false,
"ratio": 4.331046312178388,
"config_test": false,
"... |
from django.shortcuts import get_object_or_404
from django.views.generic import (TemplateView, ListView, DetailView,
CreateView, UpdateView, DeleteView,
FormView, RedirectView)
from django.core.urlresolvers import reverse, reverse_lazy
from django.core... | {
"repo_name": "makielab/django-oscar",
"path": "oscar/apps/customer/views.py",
"copies": "3",
"size": "22922",
"license": "bsd-3-clause",
"hash": -5659488873095987000,
"line_mean": 34.9843014129,
"line_max": 89,
"alpha_frac": 0.6126428758,
"autogenerated": false,
"ratio": 4.148027506333695,
"co... |
from django.shortcuts import get_object_or_404
from django.views.generic import TemplateView
from django.contrib.auth.models import User
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
class ProfileView(LoginRequiredMixin, TemplateView):
"""Class based view for user'... | {
"repo_name": "ellezv/django_imager",
"path": "imagersite/imager_profile/views.py",
"copies": "1",
"size": "1683",
"license": "mit",
"hash": -9025394758373116000,
"line_mean": 38.1395348837,
"line_max": 75,
"alpha_frac": 0.6476530006,
"autogenerated": false,
"ratio": 4.337628865979381,
"config_... |
from django.shortcuts import get_object_or_404
from django.views.generic import TemplateView
from django.core.urlresolvers import reverse
import json
from terrapyn.geocms.models import DataResource, Layer, Style, LayerCollection
class LayerPageView(TemplateView):
template_name = 'terrapyn/geocms/layer.html'
... | {
"repo_name": "JeffHeard/terrapyn",
"path": "geocms/views/web.py",
"copies": "1",
"size": "2491",
"license": "apache-2.0",
"hash": -2100750759433300200,
"line_mean": 36.7424242424,
"line_max": 99,
"alpha_frac": 0.6354877559,
"autogenerated": false,
"ratio": 3.6686303387334314,
"config_test": fa... |
from django.shortcuts import get_object_or_404
from django.views.generic import TemplateView
from ..universities.models import University
from ..professors.models import Professor
from ..comments.models import Comment
from .models import Department
class DepartmentView(TemplateView):
template_name = 'department.... | {
"repo_name": "Jpadilla1/notaso",
"path": "notaso/departments/views.py",
"copies": "1",
"size": "1321",
"license": "mit",
"hash": -838535123426290800,
"line_mean": 39.0303030303,
"line_max": 76,
"alpha_frac": 0.6570779712,
"autogenerated": false,
"ratio": 3.6694444444444443,
"config_test": fals... |
from django.shortcuts import get_object_or_404
from django.views.generic.list_detail import object_list, object_detail
from taggit.models import Tag
from builds.models import Build
from builds.filters import BuildFilter
from projects.models import Project
def build_list(request, project_slug=None, tag=None):
""... | {
"repo_name": "phalcon/readthedocs.org",
"path": "readthedocs/builds/views.py",
"copies": "5",
"size": "1546",
"license": "mit",
"hash": -4189344096957405000,
"line_mean": 28.1698113208,
"line_max": 72,
"alpha_frac": 0.6248382924,
"autogenerated": false,
"ratio": 4.08994708994709,
"config_test"... |
from django.shortcuts import get_object_or_404
from dps.decorators import dps_result_view
from dps.models import Transaction
from dps.settings import TEMPLATE_ENGINE
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.http import HttpResponseForbidden
from pprint import p... | {
"repo_name": "mattdw/django-dps",
"path": "dps/views.py",
"copies": "1",
"size": "3240",
"license": "bsd-2-clause",
"hash": -182178350670647800,
"line_mean": 39,
"line_max": 91,
"alpha_frac": 0.6462962963,
"autogenerated": false,
"ratio": 4.84304932735426,
"config_test": false,
"has_no_keywo... |
from django.shortcuts import get_object_or_404
from facebook import GraphAPI, GraphAPIError
from raven.contrib.django.raven_compat.models import client
from canvas.exceptions import InvalidFacebookAccessToken
from canvas.templatetags.jinja_base import render_jinja_to_string
from canvas.view_guards import require_staff... | {
"repo_name": "drawquest/drawquest-web",
"path": "website/drawquest/apps/profiles/api.py",
"copies": "1",
"size": "1424",
"license": "bsd-3-clause",
"hash": -8655412241932614000,
"line_mean": 36.4736842105,
"line_max": 108,
"alpha_frac": 0.7162921348,
"autogenerated": false,
"ratio": 4.2380952380... |
from django.shortcuts import get_object_or_404
from haystack.constants import DJANGO_ID
from haystack.inputs import AutoQuery, Clean
from haystack.query import SearchQuerySet
from canvas.models import UserRedis
from canvas.templatetags.jinja_base import render_jinja_to_string
from canvas.view_guards import require_sta... | {
"repo_name": "drawquest/drawquest-web",
"path": "website/drawquest/apps/search/api.py",
"copies": "1",
"size": "2104",
"license": "bsd-3-clause",
"hash": -6290590248940763000,
"line_mean": 29.0571428571,
"line_max": 96,
"alpha_frac": 0.6459125475,
"autogenerated": false,
"ratio": 3.7173144876325... |
from django.shortcuts import get_object_or_404
from .. import tools
from ..models.post import Post
from ..models.category import Category
from ..models.tag import Tag
from ..tools import render_with_user_opt
def all(request, page):
pager = tools.buildPager(page, Post.objects.count())
posts = Post.objects.al... | {
"repo_name": "jmescuderojustel/codeyourblogin-python-django-1.7",
"path": "src/blog/controllers/post_controller.py",
"copies": "1",
"size": "1412",
"license": "mit",
"hash": -4213813275844425700,
"line_mean": 32.6428571429,
"line_max": 148,
"alpha_frac": 0.7032577904,
"autogenerated": false,
"ra... |
from django.shortcuts import get_object_or_404
from main.models import Project, Task, WorkInProgress, Response, Result, User, Review, AutoReview
from main.types import type_list
from django.contrib.auth.decorators import login_required
from main.helpers import get_project_type
from main.wrapper import get, get_or_post,... | {
"repo_name": "clickwork/clickwork",
"path": "main/views/task.py",
"copies": "1",
"size": "10819",
"license": "mit",
"hash": 7283646716899083000,
"line_mean": 46.2445414847,
"line_max": 124,
"alpha_frac": 0.5912746095,
"autogenerated": false,
"ratio": 4.269534333070244,
"config_test": false,
... |
from django.shortcuts import get_object_or_404
from mc2.controllers.base.views import (
ControllerCreateView, ControllerEditView, ControllerCloneView)
from mc2.controllers.docker.forms import DockerControllerFormHelper
from mc2.controllers.docker.models import DockerController
class DockerControllerCreateView(Con... | {
"repo_name": "praekelt/mc2",
"path": "mc2/controllers/docker/views.py",
"copies": "1",
"size": "1450",
"license": "bsd-2-clause",
"hash": 7719772321437641000,
"line_mean": 37.1578947368,
"line_max": 78,
"alpha_frac": 0.7324137931,
"autogenerated": false,
"ratio": 4.3026706231454,
"config_test"... |
from django.shortcuts import get_object_or_404
from mibbinator.utils import render, oidobj_sort
from models import Object, Module, OID
def home(request):
# collect site news?
return render(request, 'home.html')
def byoid(request, oid):
# look up oid matches
objects = Object.objects.filter(oid=oid)
... | {
"repo_name": "fenner/mibbinator",
"path": "mibbinator/mib/views.py",
"copies": "1",
"size": "1527",
"license": "bsd-2-clause",
"hash": 6372060727005030000,
"line_mean": 35.3571428571,
"line_max": 138,
"alpha_frac": 0.6810740013,
"autogenerated": false,
"ratio": 3.341356673960613,
"config_test"... |
from django.shortcuts import get_object_or_404
from .models import Employee, Category
from .serializers import EmployeeSerializer, EmployeeListSerializer, CategorySerializer
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
@api_view(['GET', ... | {
"repo_name": "neosergio/allstars",
"path": "employees/views.py",
"copies": "1",
"size": "1350",
"license": "mit",
"hash": 2080464048999052300,
"line_mean": 34.5263157895,
"line_max": 87,
"alpha_frac": 0.7111111111,
"autogenerated": false,
"ratio": 3.9705882352941178,
"config_test": false,
"h... |
from django.shortcuts import get_object_or_404
from odin import registration
from baldr import api
class ModelResourceApi(api.ResourceApi):
"""
Provides an API for working with Django models.
This API assumes that mappings have been defined between between the model and a suitable resource.
"""
... | {
"repo_name": "timsavage/baldr",
"path": "baldr/model_api.py",
"copies": "1",
"size": "3277",
"license": "bsd-3-clause",
"hash": 2272223520328019200,
"line_mean": 33.8617021277,
"line_max": 103,
"alpha_frac": 0.6774488862,
"autogenerated": false,
"ratio": 3.9963414634146344,
"config_test": fals... |
from django.shortcuts import get_object_or_404
from odin import registration
from odin.compatibility import deprecated
from baldr import api
@deprecated(message="Will be removed in 0.9 in favour of `baldr.api2.models.ModelResourceApi`.")
class ModelResourceApi(api.ResourceApi):
"""
Provides an API for working... | {
"repo_name": "python-odin/baldr",
"path": "baldr/model_api.py",
"copies": "1",
"size": "3896",
"license": "bsd-3-clause",
"hash": -4375638129641949700,
"line_mean": 37.5742574257,
"line_max": 103,
"alpha_frac": 0.6930184805,
"autogenerated": false,
"ratio": 3.815866797257591,
"config_test": fa... |
from django.shortcuts import get_object_or_404
from paypal.standard.models import ST_PP_COMPLETED
from paypal.standard.ipn.signals import valid_ipn_received, invalid_ipn_received
from django.template.loader import render_to_string
from django.core.mail import EmailMessage
from django.conf import settings
import weasypr... | {
"repo_name": "technolotrix/django_by_example",
"path": "myshop/payment/signals.py",
"copies": "1",
"size": "1494",
"license": "mit",
"hash": -8232633410687408000,
"line_mean": 34.5714285714,
"line_max": 80,
"alpha_frac": 0.656626506,
"autogenerated": false,
"ratio": 3.86046511627907,
"config_t... |
from django.shortcuts import get_object_or_404
from principal.models import Departamento
from django.db.models import Q
def reconstruct_and_save(form):
department = Departamento()
if form.cleaned_data['id']:
department.id = form.cleaned_data['id']
department.codigo = form.cleaned_data['code']
... | {
"repo_name": "carborgar/gestionalumnostfg",
"path": "principal/services/DepartmentService.py",
"copies": "1",
"size": "1836",
"license": "mit",
"hash": -8356099364969671000,
"line_mean": 19.4,
"line_max": 60,
"alpha_frac": 0.6089324619,
"autogenerated": false,
"ratio": 3.793388429752066,
"conf... |
from django.shortcuts import get_object_or_404
from rest_framework.exceptions import PermissionDenied
from rest_framework.status import HTTP_201_CREATED, HTTP_400_BAD_REQUEST
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import authentication, permissions
fro... | {
"repo_name": "bgroff/kala-app",
"path": "django_kala/api/basecamp_classic/companies/views.py",
"copies": "1",
"size": "2953",
"license": "mit",
"hash": 6189462098244987000,
"line_mean": 32.1797752809,
"line_max": 106,
"alpha_frac": 0.6969183881,
"autogenerated": false,
"ratio": 4.536098310291859... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.