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

All Samples(92)  |  Call(0)  |  Derive(66)  |  Import(26)

src/h/u/humfrey-0.3.9/humfrey/sparql/views/core.py   humfrey(Download)
from django.views.generic import View
 
from django_conneg.views import ContentNegotiatedView, HTMLView, JSONPView, TextView, ErrorCatchingView
 
from humfrey.linkeddata.views import MappingView
class SparqlGraphView(RDFView, HTMLView, FeedView, KMLView):
    def get(self, request, context):
        return self.render(request, context, ('sparql/graph', 'results/graph'))
    post = get
 
class SparqlResultSetView(ResultSetView, SpreadsheetView, HTMLView):
class SparqlBooleanView(ResultSetView, HTMLView):
    def get(self, request, context):
        return self.render(request, context, ('sparql/boolean', 'results/boolean'))
    post = get
 
class SparqlErrorView(HTMLView, TextView):

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 ErrorView(HTMLView, JSONPView, TextView):
    _force_fallback_format = 'json'
 
    def dispatch(self, request, context, template_name):
        template_name = (template_name, 'timeseries-admin/error')
class ListView(TimeSeriesView, HTMLView, JSONPView):
    @method_decorator(login_required)
    def get(self, request):
        series = TimeSeries.objects.all().order_by('slug')
        series = [s for s in series if self.has_perm('view', s)]
class CreateView(TimeSeriesView, HTMLView):
    def common(self, request):
        return {
            'form': forms.NewTimeSeriesForm(request.POST or None),
            'archive_formset': forms.ArchiveFormSet(request.POST or None),
class DetailView(TimeSeriesView, HTMLView):
    def common(self, request, slug):
        series = get_object_or_404(TimeSeries, slug=slug)
        form = forms.TimeSeriesForm(request.POST or None, instance=series)
        context = {'series': series,

src/o/p/openorg-timeseries-0.1.1/openorg_timeseries/views/endpoint.py   openorg-timeseries(Download)
from django.http import HttpResponse
 
from django_conneg.views import ContentNegotiatedView, HTMLView, TextView, JSONPView
from django_conneg.decorators import renderer
 
class IndexView(HTMLView):
    def get(self, request):
        return self.render(request, {}, 'timeseries/index')
 
class ErrorView(HTMLView, JSONPView, TextView):
class InfoView(HTMLView, JSONPView, RDFView):
    _json_indent = 2
 
    series_types = {'period': 'gauge', 'gauge': 'rate', 'counter': 'gauge', 'absolute': 'cumulative'}
 
class GraphView(HTMLView, JSONPView):
    _json_indent = 2
 
    def get(self, request):
        #return self.render(request, {}, 'timeseries/graph')

src/h/u/humfrey-HEAD/humfrey/feeds/views.py   humfrey(Download)
from django.http import Http404
from django_conneg.views import ContentNegotiatedView, HTMLView, JSONPView
from humfrey.linkeddata.views import MappingView
from humfrey.sparql.views import StoreView
 
class IndexView(HTMLView, JSONPView):
    template_name = 'feeds/index'
 
    def get(self, request):
        feeds = config.FEED_META.values()
        feeds.sort(key=lambda f: f['name'])
        self.context.update({'feeds':feeds})
        return self.render()
 
class FeedView(HTMLView, StoreView, MappingView):

src/d/j/django-conneg-0.9.5/django_conneg/support/middleware.py   django-conneg(Download)
from django.contrib.auth import authenticate
from django_conneg.http import MediaType
from django_conneg.views import HTMLView, JSONPView, TextView
 
class UnauthorizedView(HTMLView, JSONPView, TextView):
class InactiveUserView(HTMLView, JSONPView, TextView):
    _force_fallback_format = 'txt'
    template_name = 'conneg/inactive_user'
 
    def get(self, request):

src/h/u/humfrey-0.3.9/humfrey/elasticsearch/views.py   humfrey(Download)
from django_conneg.decorators import renderer
from django_conneg.http import HttpResponseSeeOther
from django_conneg.views import HTMLView, JSONPView, ErrorCatchingView
from rdflib import URIRef
 
class SearchView(HTMLView, JSONPView, MappingView, ErrorCatchingView, StoreView):
    @property
    def index_name(self):
        return self.store_name
 

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)]
class GraphListView(StoreChooseMixin, CannedQueryView, RDFView, HTMLView, MappingView):
    query = """
        CONSTRUCT {
         ?g a sd:Graph ;
           dcterms:publisher ?publisher ;

src/d/j/django-conneg-HEAD/django_conneg/support/middleware.py   django-conneg(Download)
from django.contrib.auth import authenticate
from django_conneg.http import MediaType
from django_conneg.views import HTMLView, JSONPView, TextView
 
class UnauthorizedView(HTMLView, JSONPView, TextView):
class InactiveUserView(HTMLView, JSONPView, TextView):
    _force_fallback_format = 'txt'
    template_name = 'conneg/inactive_user'
 
    def get(self, request):

src/d/a/dataox-HEAD/dataox/core/views.py   dataox(Download)
from __future__ import division
 
from django.conf import settings
from django_conneg.views import HTMLView, TextView
import rdflib
class DatasetView(CannedQueryView, MappingView, RDFView, HTMLView):
    template_name = 'datasets'
    catalog = rdflib.URIRef("https://data.ox.ac.uk/id/dataset/catalogue")
 
    query = """
class ExploreView(HTMLView, RedisView):
    def get(self, request):
        context = {
            'examples': EXAMPLES,
        }
        return self.render(request, context, 'explore')
 
class ExampleResourceView(ResultSetView, HTMLView, StoreView, MappingView):
class ExampleQueryView(ResultSetView, HTMLView, StoreView, MappingView):
    _QUERY = """
        SELECT ?dataset ?datasetLabel ?value ?label ?comment WHERE {
            ?dataset a void:Dataset ;
              rdfs:label ?datasetLabel ;

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 IndexView(HTMLView):
    @method_decorator(login_required)
    def get(self, request):
        definitions = UpdateDefinition.objects.all().order_by('title')
        definitions = [d for d in definitions if d.can_view(request.user)]
class DefinitionDetailView(HTMLView):
    def common(self, request, slug=None):
        if slug:
            obj = get_object_or_404(UpdateDefinition, slug=slug)
        else:
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(),

  1 | 2 | 3  Next