Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(18)  |  Call(0)  |  Derive(11)  |  Import(7)

src/o/p/openorg-timeseries-0.1.1/openorg_timeseries/views/admin.py   openorg-timeseries(Download)
from django.db.models.query import QuerySet
from django.shortcuts import get_object_or_404
from django_conneg.views import JSONView, HTMLView, JSONPView, TextView
from django_conneg.http import HttpResponseSeeOther
#from django_conneg.support import login_required
class TimeSeriesView(JSONView):
    _error = staticmethod(ErrorView.as_view())
    _default_format = 'json'
 
    def has_perm(self, perm, obj=None):

src/h/u/humfrey-HEAD/humfrey/sparql/views/admin.py   humfrey(Download)
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django_conneg.views import ContentNegotiatedView, HTMLView, JSONView
 
from humfrey.linkeddata.resource import ResourceRegistry
class IndexView(HTMLView, JSONView):
    def get(self, request):
        stores = Store.objects.all().order_by('name')
        if not request.user.has_perm('sparql.query_store'):
            stores = [s for s in stores if request.user.has_perm('sparql.query_store', s)]

src/h/u/humfrey-0.3.9/humfrey/sparql/views/admin.py   humfrey(Download)
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django_conneg.views import HTMLView, JSONView
 
from .core import StoreView, QueryView
class IndexView(HTMLView, JSONView):
    def get(self, request):
        stores = Store.objects.all().order_by('name')
        if not request.user.is_superuser:
            stores = [s for s in stores if request.user.has_any_perms(s)]

src/h/u/humfrey-0.3.9/humfrey/update/views.py   humfrey(Download)
from django.core.files.base import ContentFile
 
from django_conneg.views import HTMLView, JSONView
from django_conneg.http import HttpResponseSeeOther
 
class FileListView(HTMLView, JSONView):
    _json_indent = 2
    def common(self, request):
        return {
            'form': CreateFileForm(request.POST or None, request.FILES or None),
class FileDetailView(HTMLView, JSONView):
    _json_indent = 2
    def simplify(self, value):
        if isinstance(value, LocalFile):
            return self.simplify({'_url': value.get_absolute_url(),
class UpdateLogView(HTMLView, JSONView):
    _json_indent = 2
 
    def simplify(self, value):
        if isinstance(value, UpdateDefinition):

src/h/u/humfrey-HEAD/humfrey/update/views.py   humfrey(Download)
from django.utils.decorators import method_decorator
 
from django_conneg.views import HTMLView, JSONView
from django_conneg.http import HttpResponseSeeOther
 
class UpdateLogView(HTMLView, JSONView):
    _json_indent = 2
 
    def simplify(self, value):
        if isinstance(value, UpdateDefinition):

src/d/j/django-conneg-HEAD/django_conneg/tests/urls.py   django-conneg(Download)
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django_conneg.views import HTMLView, JSONView
 
class OptionalAuthView(HTMLView, JSONView):
class LoginRequiredView(HTMLView, JSONView):
    _force_fallback_format = ('html', 'json')
    @method_decorator(login_required)
    def get(self, request):
        response = self.render()

src/d/j/django-conneg-0.9.5/django_conneg/tests/urls.py   django-conneg(Download)
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django_conneg.views import HTMLView, JSONView
 
class OptionalAuthView(HTMLView, JSONView):
class LoginRequiredView(HTMLView, JSONView):
    _force_fallback_format = ('html', 'json')
    @method_decorator(login_required)
    def get(self, request):
        response = self.render()