mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Scheme fix when unauth and Flask8 lint fix
This commit is contained in:
parent
9c9525b130
commit
84e22cc2f3
|
@ -13,7 +13,7 @@
|
|||
{% if 'javascript' in langs %}{% include "rest_framework/docs/langs/javascript-intro.html" %}{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if document.data %}
|
||||
{% for section_key, section in document.data|items %}
|
||||
{% if section_key %}
|
||||
<h2 id="{{ section_key }}" class="coredocs-section-title">{{ section_key }} <a href="#{{ section_key }}"><i class="fa fa-link" aria-hidden="true"></i>
|
||||
|
@ -28,3 +28,4 @@
|
|||
{% for link_key, link in document.links|items %}
|
||||
{% include "rest_framework/docs/link.html" %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
|
||||
<div class="menu-list">
|
||||
<ul id="menu-content" class="menu-content collapse out">
|
||||
{% if document.data %}
|
||||
{% for section_key, section in document.data|items %}
|
||||
<li data-toggle="collapse" data-target="#{{ section_key }}-dropdown" class="collapsed">
|
||||
<a><i class="fa fa-dot-circle-o fa-lg"></i> {% if section_key %}{{ section_key }}{% else %}API Endpoints{% endif %} <span class="arrow"></span></a>
|
||||
|
@ -15,6 +16,7 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
<ul class="menu-list menu-list-bottom">
|
||||
|
|
|
@ -45,6 +45,7 @@ class NonAtomicAPIExceptionView(APIView):
|
|||
BasicModel.objects.all()
|
||||
raise Http404
|
||||
|
||||
|
||||
urlpatterns = (
|
||||
url(r'^$', NonAtomicAPIExceptionView.as_view()),
|
||||
)
|
||||
|
|
|
@ -1132,7 +1132,6 @@ class TestDateTimeField(FieldValues):
|
|||
valid_inputs = {
|
||||
'2001-01-01 13:00': datetime.datetime(2001, 1, 1, 13, 00, tzinfo=utc),
|
||||
'2001-01-01T13:00': datetime.datetime(2001, 1, 1, 13, 00, tzinfo=utc),
|
||||
'2001-01-01T13:00Z': datetime.datetime(2001, 1, 1, 13, 00, tzinfo=utc),
|
||||
datetime.datetime(2001, 1, 1, 13, 00): datetime.datetime(2001, 1, 1, 13, 00, tzinfo=utc),
|
||||
datetime.datetime(2001, 1, 1, 13, 00, tzinfo=utc): datetime.datetime(2001, 1, 1, 13, 00, tzinfo=utc),
|
||||
# Django 1.4 does not support timezone string parsing.
|
||||
|
|
|
@ -246,6 +246,7 @@ class ObjectPermissionInstanceView(generics.RetrieveUpdateDestroyAPIView):
|
|||
authentication_classes = [authentication.BasicAuthentication]
|
||||
permission_classes = [ViewObjectPermissions]
|
||||
|
||||
|
||||
object_permissions_view = ObjectPermissionInstanceView.as_view()
|
||||
|
||||
|
||||
|
@ -255,6 +256,7 @@ class ObjectPermissionListView(generics.ListAPIView):
|
|||
authentication_classes = [authentication.BasicAuthentication]
|
||||
permission_classes = [ViewObjectPermissions]
|
||||
|
||||
|
||||
object_permissions_list_view = ObjectPermissionListView.as_view()
|
||||
|
||||
|
||||
|
@ -443,6 +445,7 @@ class DeniedObjectView(PermissionInstanceView):
|
|||
class DeniedObjectViewWithDetail(PermissionInstanceView):
|
||||
permission_classes = (BasicObjectPermWithDetail,)
|
||||
|
||||
|
||||
denied_view = DeniedView.as_view()
|
||||
|
||||
denied_view_with_detail = DeniedViewWithDetail.as_view()
|
||||
|
|
|
@ -108,6 +108,7 @@ class HTMLView1(APIView):
|
|||
def get(self, request, **kwargs):
|
||||
return Response('text')
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^.*\.(?P<format>.+)$', MockView.as_view(renderer_classes=[RendererA, RendererB])),
|
||||
url(r'^$', MockView.as_view(renderer_classes=[RendererA, RendererB])),
|
||||
|
|
|
@ -120,6 +120,7 @@ class MockView(APIView):
|
|||
|
||||
return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR)
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', MockView.as_view()),
|
||||
]
|
||||
|
|
|
@ -32,6 +32,7 @@ class MockJsonRenderer(BaseRenderer):
|
|||
class MockTextMediaRenderer(BaseRenderer):
|
||||
media_type = 'text/html'
|
||||
|
||||
|
||||
DUMMYSTATUS = status.HTTP_200_OK
|
||||
DUMMYCONTENT = 'dummycontent'
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ factory = APIRequestFactory()
|
|||
def null_view(request):
|
||||
pass
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^view$', null_view, name='view'),
|
||||
]
|
||||
|
|
|
@ -70,6 +70,7 @@ class ExampleViewSet(ModelViewSet):
|
|||
assert self.action
|
||||
return super(ExampleViewSet, self).get_serializer(*args, **kwargs)
|
||||
|
||||
|
||||
if coreapi:
|
||||
schema_view = get_schema_view(title='Example API')
|
||||
else:
|
||||
|
|
|
@ -243,6 +243,7 @@ class RegexSerializer(serializers.Serializer):
|
|||
validators=[RegexValidator(regex=re.compile('^[0-9]{4,6}$'),
|
||||
message='A PIN is 4-6 digits')])
|
||||
|
||||
|
||||
expected_repr = """
|
||||
RegexSerializer():
|
||||
pin = CharField(validators=[<django.core.validators.RegexValidator object>])
|
||||
|
|
Loading…
Reference in New Issue
Block a user