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

All Samples(28)  |  Call(2)  |  Derive(0)  |  Import(26)
Decorates a view method to say that it renders a particular format and mimetypes.

Use as:
    @renderer(format="foo")
    def render_foo(self, request, context, template_name): ...
or
    @renderer(format="foo", mimetypes=("application/x-foo",))
    def render_foo(self, request, context, template_name): ...

The former case will inherit mimetypes from the previous renderer for that(more...)

        def renderer(format, mimetypes=(), priority=0, name=None, test=None):
    """
    Decorates a view method to say that it renders a particular format and mimetypes.

    Use as:
        @renderer(format="foo")
        def render_foo(self, request, context, template_name): ...
    or
        @renderer(format="foo", mimetypes=("application/x-foo",))
        def render_foo(self, request, context, template_name): ...
    
    The former case will inherit mimetypes from the previous renderer for that
    format in the MRO. Where there isn't one, it will default to the empty
    tuple.

    Takes an optional priority argument to resolve ties between renderers.
    """

    def g(f):
        return Renderer(f, format, mimetypes, priority, name, test)
    return g
        


src/d/j/django-conneg-0.9.5/django_conneg/views.py   django-conneg(Download)
 
from django_conneg.conneg import Conneg
from django_conneg.decorators import renderer
from django_conneg.http import MediaType, HttpError, HttpNotAcceptable
from django_conneg.utils import utc
 
        for renderer in request.renderers:
            response = renderer(request, context, template_name)
            if response is NotImplemented:
                continue

src/d/j/django-conneg-HEAD/django_conneg/views.py   django-conneg(Download)
 
from django_conneg.conneg import Conneg
from django_conneg.decorators import renderer
from django_conneg.http import MediaType, HttpError, HttpNotAcceptable
from django_conneg.utils import utc
 
        for renderer in request.renderers:
            response = renderer(request, context, template_name)
            if response is NotImplemented:
                continue

src/h/u/humfrey-HEAD/humfrey/sparql/views/misc.py   humfrey(Download)
import functools
 
from django_conneg.decorators import renderer
 
from .core import StoreView

src/h/u/humfrey-HEAD/humfrey/sparql/views/core.py   humfrey(Download)
from django.views.generic import View
 
from django_conneg.decorators import renderer
from django_conneg.views import ContentNegotiatedView, HTMLView
 

src/h/u/humfrey-HEAD/humfrey/results/views/standard.py   humfrey(Download)
from django.http import HttpResponse
 
from django_conneg.decorators import renderer
from django_conneg.http import MediaType
from django_conneg.views import ContentNegotiatedView

src/h/u/humfrey-HEAD/humfrey/results/views/spreadsheet.py   humfrey(Download)
from django.shortcuts import render_to_response
from django.template import RequestContext
 
from django_conneg.decorators import renderer
from django_conneg.views import ContentNegotiatedView

src/h/u/humfrey-HEAD/humfrey/results/views/json.py   humfrey(Download)
from humfrey.utils.namespaces import contract
 
from django_conneg.decorators import renderer
from django_conneg.views import ContentNegotiatedView
 

src/h/u/humfrey-HEAD/humfrey/results/views/geospatial.py   humfrey(Download)
from django.template import RequestContext
 
from django_conneg.decorators import renderer
from django_conneg.views import ContentNegotiatedView
 

src/h/u/humfrey-HEAD/humfrey/results/views/feed.py   humfrey(Download)
from django.http import HttpResponse
 
from django_conneg.decorators import renderer
from django_conneg.views import ContentNegotiatedView
 

src/h/u/humfrey-0.3.9/humfrey/results/views/standard.py   humfrey(Download)
from django.http import HttpResponse
 
from django_conneg.decorators import renderer
from django_conneg.views import ContentNegotiatedView
 

  1 | 2 | 3  Next