Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Anna 2017-10-02 23:50:35 +02:00
commit c82b44235d
149 changed files with 3717 additions and 1289 deletions

View File

@ -8,10 +8,9 @@ python:
sudo: false
env:
- DJANGO=1.8
- DJANGO=1.9
- DJANGO=1.10
- DJANGO=1.11
- DJANGO=2.0
- DJANGO=master
matrix:
@ -21,8 +20,8 @@ matrix:
env: DJANGO=master
- python: "3.6"
env: DJANGO=1.11
- python: "3.3"
env: DJANGO=1.8
- python: "3.6"
env: DJANGO=2.0
- python: "2.7"
env: TOXENV="lint"
- python: "2.7"
@ -30,11 +29,14 @@ matrix:
exclude:
- python: "2.7"
env: DJANGO=master
- python: "2.7"
env: DJANGO=2.0
- python: "3.4"
env: DJANGO=master
allow_failures:
- env: DJANGO=master
- env: DJANGO=2.0
install:
- pip install tox tox-travis

View File

@ -2,5 +2,5 @@ include README.md
include LICENSE.md
recursive-include rest_framework/static *.js *.css *.png *.eot *.svg *.ttf *.woff
recursive-include rest_framework/templates *.html
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
global-exclude __pycache__
global-exclude *.py[co]

View File

@ -222,6 +222,21 @@ It is also possible to create Tokens manually through admin interface. In case y
TokenAdmin.raw_id_fields = ('user',)
#### Using Django manage.py command
Since version 3.6.4 it's possible to generate a user token using the following command:
./manage.py drf_create_token <username>
this command will return the API token for the given user, creating it if it doesn't exist:
Generated token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b for user user1
In case you want to regenerate the token (for example if it has been compromised or leaked) you can pass an additional parameter:
./manage.py drf_create_token -r <username>
## SessionAuthentication
This authentication scheme uses Django's default session backend for authentication. Session authentication is appropriate for AJAX clients that are running in the same session context as your website.
@ -239,6 +254,28 @@ If you're using an AJAX style API with SessionAuthentication, you'll need to mak
CSRF validation in REST framework works slightly differently to standard Django due to the need to support both session and non-session based authentication to the same views. This means that only authenticated requests require CSRF tokens, and anonymous requests may be sent without CSRF tokens. This behaviour is not suitable for login views, which should always have CSRF validation applied.
## RemoteUserAuthentication
This authentication scheme allows you to delegate authentication to your web server, which sets the `REMOTE_USER`
environment variable.
To use it, you must have `django.contrib.auth.backends.RemoteUserBackend` (or a subclass) in your
`AUTHENTICATION_BACKENDS` setting. By default, `RemoteUserBackend` creates `User` objects for usernames that don't
already exist. To change this and other behaviour, consult the
[Django documentation](https://docs.djangoproject.com/en/stable/howto/auth-remote-user/).
If successfully authenticated, `RemoteUserAuthentication` provides the following credentials:
* `request.user` will be a Django `User` instance.
* `request.auth` will be `None`.
Consult your web server's documentation for information about configuring an authentication method, e.g.:
* [Apache Authentication How-To](https://httpd.apache.org/docs/2.4/howto/auth.html)
* [NGINX (Restricting Access)](https://www.nginx.com/resources/admin-guide/#restricting_access)
# Custom authentication
To implement a custom authentication scheme, subclass `BaseAuthentication` and override the `.authenticate(self, request)` method. The method should return a two-tuple of `(user, auth)` if authentication succeeds, or `None` otherwise.

View File

@ -434,7 +434,7 @@ Requires either the `Pillow` package or `PIL` package. The `Pillow` package is
A field class that validates a list of objects.
**Signature**: `ListField(child, min_length=None, max_length=None)`
**Signature**: `ListField(child=<A_FIELD_INSTANCE>, min_length=None, max_length=None)`
- `child` - A field instance that should be used for validating the objects in the list. If this argument is not provided then objects in the list will not be validated.
- `min_length` - Validates that the list contains no fewer than this number of elements.
@ -457,7 +457,7 @@ We can now reuse our custom `StringListField` class throughout our application,
A field class that validates a dictionary of objects. The keys in `DictField` are always assumed to be string values.
**Signature**: `DictField(child)`
**Signature**: `DictField(child=<A_FIELD_INSTANCE>)`
- `child` - A field instance that should be used for validating the values in the dictionary. If this argument is not provided then values in the mapping will not be validated.
@ -641,7 +641,7 @@ The `.fail()` method is a shortcut for raising `ValidationError` that takes a me
return Color(red, green, blue)
This style keeps you error messages more cleanly separated from your code, and should be preferred.
This style keeps your error messages cleaner and more separated from your code, and should be preferred.
# Third party packages

View File

@ -330,7 +330,9 @@ For example, if you need to lookup objects based on multiple fields in the URL c
for field in self.lookup_fields:
if self.kwargs[field]: # Ignore empty fields.
filter[field] = self.kwargs[field]
return get_object_or_404(queryset, **filter) # Lookup the object
obj = get_object_or_404(queryset, **filter) # Lookup the object
self.check_object_permissions(self.request, obj)
return obj
You can then simply apply this mixin to a view or viewset anytime you need to apply the custom behavior.

View File

@ -21,14 +21,14 @@ Pagination can be turned off by setting the pagination class to `None`.
## Setting the pagination style
The default pagination style may be set globally, using the `DEFAULT_PAGINATION_CLASS` and `PAGE_SIZE` setting keys. For example, to use the built-in limit/offset pagination, you would do something like this:
The pagination style may be set globally, using the `DEFAULT_PAGINATION_CLASS` and `PAGE_SIZE` setting keys. For example, to use the built-in limit/offset pagination, you would do something like this:
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 100
}
Note that you need to set both the pagination class, and the page size that should be used.
Note that you need to set both the pagination class, and the page size that should be used. Both `DEFAULT_PAGINATION_CLASS` and `PAGE_SIZE` are `None` by default.
You can also set the pagination class on an individual view by using the `pagination_class` attribute. Typically you'll want to use the same pagination style throughout your API, although you might want to vary individual aspects of the pagination, such as default or maximum page size, on a per-view basis.
@ -85,7 +85,7 @@ This pagination style accepts a single number page number in the request query p
#### Setup
To enable the `PageNumberPagination` style globally, use the following configuration, modifying the `PAGE_SIZE` as desired:
To enable the `PageNumberPagination` style globally, use the following configuration, and set the `PAGE_SIZE` as desired:
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
@ -179,6 +179,10 @@ Proper usage of cursor pagination should have an ordering field that satisfies t
* Should be an unchanging value, such as a timestamp, slug, or other field that is only set once, on creation.
* Should be unique, or nearly unique. Millisecond precision timestamps are a good example. This implementation of cursor pagination uses a smart "position plus offset" style that allows it to properly support not-strictly-unique values as the ordering.
* Should be a non-nullable value that can be coerced to a string.
* Should not be a float. Precision errors easily lead to incorrect results.
Hint: use decimals instead.
(If you already have a float field and must paginate on that, an
[example `CursorPagination` subclass that uses decimals to limit precision is available here][float_cursor_pagination_example].)
* The field should have a database index.
Using an ordering field that does not satisfy these constraints will generally still work, but you'll be losing some of the benefits of cursor pagination.
@ -317,3 +321,4 @@ The [`django-rest-framework-link-header-pagination` package][drf-link-header-pag
[drf-proxy-pagination]: https://github.com/tuffnatty/drf-proxy-pagination
[drf-link-header-pagination]: https://github.com/tbeadle/django-rest-framework-link-header-pagination
[disqus-cursor-api]: http://cramer.io/2011/03/08/building-cursors-for-the-disqus-api
[float_cursor_pagination_example]: https://gist.github.com/keturn/8bc88525a183fd41c73ffb729b8865be#file-fpcursorpagination-py

View File

@ -44,7 +44,7 @@ This will either raise a `PermissionDenied` or `NotAuthenticated` exception, or
For example:
def get_object(self):
obj = get_object_or_404(self.get_queryset())
obj = get_object_or_404(self.get_queryset(), pk=self.kwargs["pk"])
self.check_object_permissions(self.request, obj)
return obj

View File

@ -42,7 +42,7 @@ Arguments:
## .data
The unrendered content of a `Request` object.
The unrendered, serialized data of the response.
## .status_code

View File

@ -10,7 +10,14 @@ API schemas are a useful tool that allow for a range of use cases, including
generating reference documentation, or driving dynamic client libraries that
can interact with your API.
## Representing schemas internally
## Install Core API
You'll need to install the `coreapi` package in order to add schema support
for REST framework.
pip install coreapi
## Internal schema representation
REST framework uses [Core API][coreapi] in order to model schema information in
a format-independent representation. This information can then be rendered
@ -68,9 +75,34 @@ has to be rendered into the actual bytes that are used in the response.
REST framework includes a renderer class for handling this media type, which
is available as `renderers.CoreJSONRenderer`.
### Alternate schema formats
Other schema formats such as [Open API][open-api] ("Swagger"),
[JSON HyperSchema][json-hyperschema], or [API Blueprint][api-blueprint] can
also be supported by implementing a custom renderer class.
[JSON HyperSchema][json-hyperschema], or [API Blueprint][api-blueprint] can also
be supported by implementing a custom renderer class that handles converting a
`Document` instance into a bytestring representation.
If there is a Core API codec package that supports encoding into the format you
want to use then implementing the renderer class can be done by using the codec.
#### Example
For example, the `openapi_codec` package provides support for encoding or decoding
to the Open API ("Swagger") format:
from rest_framework import renderers
from openapi_codec import OpenAPICodec
class SwaggerRenderer(renderers.BaseRenderer):
media_type = 'application/openapi+json'
format = 'swagger'
def render(self, data, media_type=None, renderer_context=None):
codec = OpenAPICodec()
return codec.dump(data)
## Schemas vs Hypermedia
@ -89,18 +121,127 @@ document, detailing both the current state and the available interactions.
Further information and support on building Hypermedia APIs with REST framework
is planned for a future version.
---
# Adding a schema
You'll need to install the `coreapi` package in order to add schema support
for REST framework.
pip install coreapi
# Creating a schema
REST framework includes functionality for auto-generating a schema,
or allows you to specify one explicitly. There are a few different ways to
add a schema to your API, depending on exactly what you need.
or allows you to specify one explicitly.
## Manual Schema Specification
To manually specify a schema you create a Core API `Document`, similar to the
example above.
schema = coreapi.Document(
title='Flight Search API',
content={
...
}
)
## Automatic Schema Generation
Automatic schema generation is provided by the `SchemaGenerator` class.
`SchemaGenerator` processes a list of routed URL pattterns and compiles the
appropriately structured Core API Document.
Basic usage is just to provide the title for your schema and call
`get_schema()`:
generator = schemas.SchemaGenerator(title='Flight Search API')
schema = generator.get_schema()
### Per-View Schema Customisation
By default, view introspection is performed by an `AutoSchema` instance
accessible via the `schema` attribute on `APIView`. This provides the
appropriate Core API `Link` object for the view, request method and path:
auto_schema = view.schema
coreapi_link = auto_schema.get_link(...)
(In compiling the schema, `SchemaGenerator` calls `view.schema.get_link()` for
each view, allowed method and path.)
To customise the `Link` generation you may:
* Instantiate `AutoSchema` on your view with the `manual_fields` kwarg:
from rest_framework.views import APIView
from rest_framework.schemas import AutoSchema
class CustomView(APIView):
...
schema = AutoSchema(
manual_fields=[
coreapi.Field("extra_field", ...),
]
)
This allows extension for the most common case without subclassing.
* Provide an `AutoSchema` subclass with more complex customisation:
from rest_framework.views import APIView
from rest_framework.schemas import AutoSchema
class CustomSchema(AutoSchema):
def get_link(...):
# Implemet custom introspection here (or in other sub-methods)
class CustomView(APIView):
...
schema = CustomSchema()
This provides complete control over view introspection.
* Instantiate `ManualSchema` on your view, providing the Core API `Fields` for
the view explicitly:
from rest_framework.views import APIView
from rest_framework.schemas import ManualSchema
class CustomView(APIView):
...
schema = ManualSchema(fields=[
coreapi.Field(
"first_field",
required=True,
location="path",
schema=coreschema.String()
),
coreapi.Field(
"second_field",
required=True,
location="path",
schema=coreschema.String()
),
])
This allows manually specifying the schema for some views whilst maintaining
automatic generation elsewhere.
You may disable schema generation for a view by setting `schema` to `None`:
class CustomView(APIView):
...
schema = None # Will not appear in schema
---
**Note**: For full details on `SchemaGenerator` plus the `AutoSchema` and
`ManualSchema` descriptors see the [API Reference below](#api-reference).
---
# Adding a schema view
There are a few different ways to add a schema view to your API, depending on
exactly what you need.
## The get_schema_view shortcut
@ -193,6 +334,15 @@ to be exposed in the schema:
May be used to specify a `SchemaGenerator` subclass to be passed to the
`SchemaView`.
#### `authentication_classes`
May be used to specify the list of authentication classes that will apply to the schema endpoint.
Defaults to `settings.DEFAULT_AUTHENTICATION_CLASSES`
#### `permission_classes`
May be used to specify the list of permission classes that will apply to the schema endpoint.
Defaults to `settings.DEFAULT_PERMISSION_CLASSES`
## Using an explicit schema view
@ -342,38 +492,12 @@ A generic viewset with sections in the class docstring, using multi-line style.
---
# Alternate schema formats
In order to support an alternate schema format, you need to implement a custom renderer
class that handles converting a `Document` instance into a bytestring representation.
If there is a Core API codec package that supports encoding into the format you
want to use then implementing the renderer class can be done by using the codec.
## Example
For example, the `openapi_codec` package provides support for encoding or decoding
to the Open API ("Swagger") format:
from rest_framework import renderers
from openapi_codec import OpenAPICodec
class SwaggerRenderer(renderers.BaseRenderer):
media_type = 'application/openapi+json'
format = 'swagger'
def render(self, data, media_type=None, renderer_context=None):
codec = OpenAPICodec()
return codec.dump(data)
---
# API Reference
## SchemaGenerator
A class that deals with introspecting your API views, which can be used to
generate a schema.
A class that walks a list of routed URL patterns, requests the schema for each view,
and collates the resulting CoreAPI Document.
Typically you'll instantiate `SchemaGenerator` with a single argument, like so:
@ -406,39 +530,108 @@ Return a nested dictionary containing all the links that should be included in t
This is a good point to override if you want to modify the resulting structure of the generated schema,
as you can build a new dictionary with a different layout.
### get_link(self, path, method, view)
## AutoSchema
A class that deals with introspection of individual views for schema generation.
`AutoSchema` is attached to `APIView` via the `schema` attribute.
The `AutoSchema` constructor takes a single keyword argument `manual_fields`.
**`manual_fields`**: a `list` of `coreapi.Field` instances that will be added to
the generated fields. Generated fields with a matching `name` will be overwritten.
class CustomView(APIView):
schema = AutoSchema(manual_fields=[
coreapi.Field(
"my_extra_field",
required=True,
location="path",
schema=coreschema.String()
),
])
For more advanced customisation subclass `AutoSchema` to customise schema generation.
class CustomViewSchema(AutoSchema):
"""
Overrides `get_link()` to provide Custom Behavior X
"""
def get_link(self, path, method, base_url):
link = super().get_link(path, method, base_url)
# Do something to customize link here...
return link
class MyView(APIView):
schema = CustomViewSchema()
The following methods are available to override.
### get_link(self, path, method, base_url)
Returns a `coreapi.Link` instance corresponding to the given view.
This is the main entry point.
You can override this if you need to provide custom behaviors for particular views.
### get_description(self, path, method, view)
### get_description(self, path, method)
Returns a string to use as the link description. By default this is based on the
view docstring as described in the "Schemas as Documentation" section above.
### get_encoding(self, path, method, view)
### get_encoding(self, path, method)
Returns a string to indicate the encoding for any request body, when interacting
with the given view. Eg. `'application/json'`. May return a blank string for views
that do not expect a request body.
### get_path_fields(self, path, method, view):
### get_path_fields(self, path, method):
Return a list of `coreapi.Link()` instances. One for each path parameter in the URL.
### get_serializer_fields(self, path, method, view)
### get_serializer_fields(self, path, method)
Return a list of `coreapi.Link()` instances. One for each field in the serializer class used by the view.
### get_pagination_fields(self, path, method, view
### get_pagination_fields(self, path, method)
Return a list of `coreapi.Link()` instances, as returned by the `get_schema_fields()` method on any pagination class used by the view.
### get_filter_fields(self, path, method, view)
### get_filter_fields(self, path, method)
Return a list of `coreapi.Link()` instances, as returned by the `get_schema_fields()` method of any filter classes used by the view.
## ManualSchema
Allows manually providing a list of `coreapi.Field` instances for the schema,
plus an optional description.
class MyView(APIView):
schema = ManualSchema(fields=[
coreapi.Field(
"first_field",
required=True,
location="path",
schema=coreschema.String()
),
coreapi.Field(
"second_field",
required=True,
location="path",
schema=coreschema.String()
),
]
)
The `ManualSchema` constructor takes two arguments:
**`fields`**: A list of `coreapi.Field` instances. Required.
**`description`**: A string description. Optional.
---
## Core API
@ -572,10 +765,21 @@ Valid only if a `location="body"` field is included on the `Link`.
A short description of the meaning and intended usage of the input field.
---
# Third party packages
## DRF OpenAPI
[DRF OpenAPI][drf-openapi] renders the schema generated by Django Rest Framework
in [OpenAPI][open-api] format.
[cite]: https://blog.heroku.com/archives/2014/1/8/json_schema_for_heroku_platform_api
[coreapi]: http://www.coreapi.org/
[corejson]: http://www.coreapi.org/specification/encoding/#core-json-encoding
[open-api]: https://openapis.org/
[drf-openapi]: https://github.com/limdauto/drf_openapi
[json-hyperschema]: http://json-schema.org/latest/json-schema-hypermedia.html
[api-blueprint]: https://apiblueprint.org/
[static-files]: https://docs.djangoproject.com/en/stable/howto/static-files/

View File

@ -993,7 +993,7 @@ The following class is an example of a generic serializer that can handle coerci
## Overriding serialization and deserialization behavior
If you need to alter the serialization, deserialization or validation of a serializer class you can do so by overriding the `.to_representation()` or `.to_internal_value()` methods.
If you need to alter the serialization or deserialization behavior of a serializer class, you can do so by overriding the `.to_representation()` or `.to_internal_value()` methods.
Some reasons this might be useful include...
@ -1011,7 +1011,7 @@ Takes the object instance that requires serialization, and should return a primi
Takes the unvalidated incoming data as input and should return the validated data that will be made available as `serializer.validated_data`. The return value will also be passed to the `.create()` or `.update()` methods if `.save()` is called on the serializer class.
If any of the validation fails, then the method should raise a `serializers.ValidationError(errors)`. Typically the `errors` argument here will be a dictionary mapping field names to error messages.
If any of the validation fails, then the method should raise a `serializers.ValidationError(errors)`. The `errors` argument should be a dictionary mapping field names (or `settings.NON_FIELD_ERRORS_KEY`) to a list of error messages. If you don't need to alter deserialization behavior and instead want to provide object-level validation, it's recommended that you intead override the [`.validate()`](#object-level-validation) method.
The `data` argument passed to this method will normally be the value of `request.data`, so the datatype it provides will depend on the parser classes you have configured for your API.
@ -1180,4 +1180,4 @@ The [drf-writable-nested][drf-writable-nested] package provides writable nested
[drf-base64]: https://bitbucket.org/levit_scs/drf_base64
[drf-serializer-extensions]: https://github.com/evenicoulddoit/django-rest-framework-serializer-extensions
[djangorestframework-queryfields]: http://djangorestframework-queryfields.readthedocs.io/
[drf-writable-nested]: http://github.com/Brogency/drf-writable-nested
[drf-writable-nested]: http://github.com/beda-software/drf-writable-nested

View File

@ -362,6 +362,14 @@ The default style is to return minified responses, in line with [Heroku's API de
Default: `True`
#### STRICT_JSON
When set to `True`, JSON rendering and parsing will only observe syntactically valid JSON, raising an exception for the extended float values (`nan`, `inf`, `-inf`) accepted by Python's `json` module. This is the recommended setting, as these values are not generally supported. e.g., neither Javascript's `JSON.Parse` nor PostgreSQL's JSON data type accept these values.
When set to `False`, JSON rendering and parsing will be permissive. However, these values are still invalid and will need to be specially handled in your code.
Default: `True`
#### COERCE_DECIMAL_TO_STRING
When returning decimal objects in API representations that do not support a native decimal type, it is normally best to return the value as a string. This avoids the loss of precision that occurs with binary floating point implementations.

View File

@ -6,7 +6,7 @@ source: status.py
>
> &mdash; [RFC 2324][rfc2324], Hyper Text Coffee Pot Control Protocol
Using bare status codes in your responses isn't recommended. REST framework includes a set of named constants that you can use to make more code more obvious and readable.
Using bare status codes in your responses isn't recommended. REST framework includes a set of named constants that you can use to make your code more obvious and readable.
from rest_framework import status
from rest_framework.response import Response

View File

@ -82,7 +82,11 @@ For example, when forcibly authenticating using a token, you might do something
user = User.objects.get(username='olivia')
request = factory.get('/accounts/django-superstars/')
force_authenticate(request, user=user, token=user.token)
force_authenticate(request, user=user, token=user.auth_token)
---
**Note**: `force_authenticate` directly sets `request.user` to the in-memory `user` instance. If you are re-using the same `user` instance across multiple tests that update the saved `user` state, you may need to call [`refresh_from_db()`][refresh_from_db_docs] between tests.
---
@ -378,3 +382,4 @@ For example, to add support for using `format='html'` in test requests, you migh
[client]: https://docs.djangoproject.com/en/stable/topics/testing/tools/#the-test-client
[requestfactory]: https://docs.djangoproject.com/en/stable/topics/testing/advanced/#django.test.client.RequestFactory
[configuration]: #configuration
[refresh_from_db_docs]: https://docs.djangoproject.com/en/1.11/ref/models/instances/#django.db.models.Model.refresh_from_db

View File

@ -68,9 +68,9 @@ Or, if you're using the `@api_view` decorator with function based views.
## How clients are identified
The `X-Forwarded-For` and `Remote-Addr` HTTP headers are used to uniquely identify client IP addresses for throttling. If the `X-Forwarded-For` header is present then it will be used, otherwise the value of the `Remote-Addr` header will be used.
The `X-Forwarded-For` HTTP header and `REMOTE_ADDR` WSGI variable are used to uniquely identify client IP addresses for throttling. If the `X-Forwarded-For` header is present then it will be used, otherwise the value of the `REMOTE_ADDR` variable from the WSGI environment will be used.
If you need to strictly identify unique client IP addresses, you'll need to first configure the number of application proxies that the API runs behind by setting the `NUM_PROXIES` setting. This setting should be an integer of zero or more. If set to non-zero then the client IP will be identified as being the last IP address in the `X-Forwarded-For` header, once any application proxy IP addresses have first been excluded. If set to zero, then the `Remote-Addr` header will always be used as the identifying IP address.
If you need to strictly identify unique client IP addresses, you'll need to first configure the number of application proxies that the API runs behind by setting the `NUM_PROXIES` setting. This setting should be an integer of zero or more. If set to non-zero then the client IP will be identified as being the last IP address in the `X-Forwarded-For` header, once any application proxy IP addresses have first been excluded. If set to zero, then the `REMOTE_ADDR` value will always be used as the identifying IP address.
It is important to understand that if you configure the `NUM_PROXIES` setting, then all clients behind a unique [NAT'd](http://en.wikipedia.org/wiki/Network_address_translation) gateway will be treated as a single client.

View File

@ -130,7 +130,7 @@ REST framework also allows you to work with regular function based views. It pr
## @api_view()
**Signature:** `@api_view(http_method_names=['GET'], exclude_from_schema=False)`
**Signature:** `@api_view(http_method_names=['GET'])`
The core of this functionality is the `api_view` decorator, which takes a list of HTTP methods that your view should respond to. For example, this is how you would write a very simple view that just manually returns some data:
@ -150,12 +150,6 @@ By default only `GET` methods will be accepted. Other methods will respond with
return Response({"message": "Got some data!", "data": request.data})
return Response({"message": "Hello, world!"})
You can also mark an API view as being omitted from any [auto-generated schema][schemas],
using the `exclude_from_schema` argument.:
@api_view(['GET'], exclude_from_schema=True)
def api_docs(request):
...
## API policy decorators
@ -184,6 +178,35 @@ The available decorators are:
Each of these decorators takes a single argument which must be a list or tuple of classes.
## View schema decorator
To override the default schema generation for function based views you may use
the `@schema` decorator. This must come *after* (below) the `@api_view`
decorator. For example:
from rest_framework.decorators import api_view, schema
from rest_framework.schemas import AutoSchema
class CustomAutoSchema(AutoSchema):
def get_link(self, path, method, base_url):
# override view introspection here...
@api_view(['GET'])
@schema(CustomAutoSchema())
def view(request):
return Response({"message": "Hello for today! See you tomorrow!"})
This decorator takes a single `AutoSchema` instance, an `AutoSchema` subclass
instance or `ManualSchema` instance as described in the [Schemas documentation][schemas].
You may pass `None` in order to exclude the view from schema generation.
@api_view(['GET'])
@schema(None)
def view(request):
return Response({"message": "Will not appear in schema!"})
[cite]: http://reinout.vanrees.org/weblog/2011/08/24/class-based-views-usage.html
[cite2]: http://www.boredomandlaziness.org/2012/05/djangos-cbvs-are-not-mistake-but.html
[settings]: settings.md

BIN
docs/img/drf-openapi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -408,7 +408,7 @@ The `coreapi` library, and the `schema` object will now both be available on the
In order to interact with the API you'll need a client instance.
var client = coreapi.Client()
var client = new coreapi.Client()
Typically you'll also want to provide some authentication credentials when
instantiating the client.
@ -419,11 +419,11 @@ The `SessionAuthentication` class allows session cookies to provide the user
authentication. You'll want to provide a standard HTML login flow, to allow
the user to login, and then instantiate a client using session authentication:
let auth = coreapi.auth.SessionAuthentication({
let auth = new coreapi.auth.SessionAuthentication({
csrfCookieName: 'csrftoken',
csrfHeaderName: 'X-CSRFToken'
})
let client = coreapi.Client({auth: auth})
let client = new coreapi.Client({auth: auth})
The authentication scheme will handle including a CSRF header in any outgoing
requests for unsafe HTTP methods.
@ -433,11 +433,11 @@ requests for unsafe HTTP methods.
The `TokenAuthentication` class can be used to support REST framework's built-in
`TokenAuthentication`, as well as OAuth and JWT schemes.
let auth = coreapi.auth.TokenAuthentication({
let auth = new coreapi.auth.TokenAuthentication({
scheme: 'JWT'
token: '<token>'
})
let client = coreapi.Client({auth: auth})
let client = new coreapi.Client({auth: auth})
When using TokenAuthentication you'll probably need to implement a login flow
using the CoreAPI client.
@ -448,7 +448,7 @@ request to an "obtain token" endpoint
For example, using the "Django REST framework JWT" package
// Setup some globally accessible state
window.client = coreapi.Client()
window.client = new coreapi.Client()
window.loggedIn = false
function loginUser(username, password) {
@ -471,11 +471,11 @@ For example, using the "Django REST framework JWT" package
The `BasicAuthentication` class can be used to support HTTP Basic Authentication.
let auth = coreapi.auth.BasicAuthentication({
let auth = new coreapi.auth.BasicAuthentication({
username: '<username>',
password: '<password>'
})
let client = coreapi.Client({auth: auth})
let client = new coreapi.Client({auth: auth})
## Using the client

View File

@ -42,7 +42,7 @@ For example:
class UserList(generics.ListAPIView):
"""
Return a list of all the existing users.
""""
"""
If a view supports multiple methods, you should split your documentation using `method:` style delimiters.
@ -75,6 +75,23 @@ When using viewsets, you should use the relevant action names as delimiters.
There are a number of mature third-party packages for providing API documentation.
#### DRF OpenAPI
[DRF OpenAPI][drf-openapi] bridges the gap between OpenAPI specification and tool chain with the schema exposed
out-of-the-box by Django Rest Framework. Its goals are:
* To be dropped into any existing DRF project without any code change necessary.
* Provide clear disctinction between request schema and response schema.
* Provide a versioning mechanism for each schema. Support defining schema by version range syntax, e.g. >1.0, <=2.0
* Support multiple response codes, not just 200
* All this information should be bound to view methods, not view classes.
It also tries to stay current with the maturing schema generation mechanism provided by DRF.
![Screenshot - DRF OpenAPI][image-drf-openapi]
---
#### DRF Docs
[DRF Docs][drfdocs-repo] allows you to document Web APIs made with Django REST Framework and it is authored by Emmanouil Konstantinidis. It's made to work out of the box and its setup should not take more than a couple of minutes. Complete documentation can be found on the [website][drfdocs-website] while there is also a [demo][drfdocs-demo] available for people to see what it looks like. **Live API Endpoints** allow you to utilize the endpoints from within the documentation in a neat way.
@ -197,6 +214,8 @@ In this approach, rather than documenting the available API endpoints up front,
To implement a hypermedia API you'll need to decide on an appropriate media type for the API, and implement a custom renderer and parser for that media type. The [REST, Hypermedia & HATEOAS][hypermedia-docs] section of the documentation includes pointers to background reading, as well as links to various hypermedia formats.
[cite]: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
[drf-openapi]: https://github.com/limdauto/drf_openapi/
[image-drf-openapi]: ../img/drf-openapi.png
[drfdocs-repo]: https://github.com/ekonstantinidis/django-rest-framework-docs
[drfdocs-website]: http://www.drfdocs.com/
[drfdocs-demo]: http://demo.drfdocs.com/

View File

@ -40,6 +40,45 @@ You can determine your currently installed version using `pip freeze`:
## 3.6.x series
### 3.6.5
* Fix `DjangoModelPermissions` to ensure user authentication before calling the view's `get_queryset()` method. As a side effect, this changes the order of the HTTP method permissions and authentication checks, and 405 responses will only be returned when authenticated. If you want to replicate the old behavior, see the PR for details. [#5376][gh5376]
* Deprecated `exclude_from_schema` on `APIView` and `api_view` decorator. Set `schema = None` or `@schema(None)` as appropriate. [#5422][gh5422]
* Timezone-aware `DateTimeField`s now respect active or default `timezone` during serialization, instead of always using UTC.
Resolves inconsistency whereby instances were serialised with supplied datetime for `create` but UTC for `retrieve`. [#3732][gh3732]
**Possible backwards compatibility break** if you were relying on datetime strings being UTC. Have client interpret datetimes or [set default or active timezone (docs)][djangodocs-set-timezone] to UTC if needed.
### 3.6.4
**Date**: [21st August 2017][3.6.4-milestone]
* Ignore any invalidly formed query parameters for OrderingFilter. [#5131][gh5131]
* Improve memory footprint when reading large JSON requests. [#5147][gh5147]
* Fix schema generation for pagination. [#5161][gh5161]
* Fix exception when `HTML_CUTOFF` is set to `None`. [#5174][gh5174]
* Fix browsable API not supporting `multipart/form-data` correctly. [#5176][gh5176]
* Fixed `test_hyperlinked_related_lookup_url_encoded_exists`. [#5179][gh5179]
* Make sure max_length is in FileField kwargs. [#5186][gh5186]
* Fix `list_route` & `detail_route` with kwargs contains curly bracket in `url_path` [#5187][gh5187]
* Add Django manage command to create a DRF user Token. [#5188][gh5188]
* Ensure API documentation templates do not check for user authentication [#5162][gh5162]
* Fix special case where OneToOneField is also primary key. [#5192][gh5192]
* Added aria-label and a new region for accessibility purposes in base.html [#5196][gh5196]
* Quote nested API parameters in api.js. [#5214][gh5214]
* Set ViewSet args/kwargs/request before dispatch. [#5229][gh5229]
* Added unicode support to SlugField. [#5231][gh5231]
* Fix HiddenField appears in Raw Data form initial content. [#5259][gh5259]
* Raise validation error on invalid timezone parsing. [#5261][gh5261]
* Fix SearchFilter to-many behavior/performance. [#5264][gh5264]
* Simplified chained comparisons and minor code fixes. [#5276][gh5276]
* RemoteUserAuthentication, docs, and tests. [#5306][gh5306]
* Revert "Cached the field's root and context property" [#5313][gh5313]
* Fix introspection of list field in schema. [#5326][gh5326]
* Fix interactive docs for multiple nested and extra methods. [#5334][gh5334]
* Fix/remove undefined template var "schema" [#5346][gh5346]
### 3.6.3
**Date**: [12th May 2017][3.6.3-milestone]
@ -716,6 +755,7 @@ For older release notes, [please see the version 2.x documentation][old-release-
[3.6.1-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.1+Release%22
[3.6.2-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.2+Release%22
[3.6.3-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.3+Release%22
[3.6.4-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.4+Release%22
<!-- 3.0.1 -->
[gh2013]: https://github.com/encode/django-rest-framework/issues/2013
@ -1326,8 +1366,8 @@ For older release notes, [please see the version 2.x documentation][old-release-
[gh4955]: https://github.com/encode/django-rest-framework/issues/4955
[gh4956]: https://github.com/encode/django-rest-framework/issues/4956
[gh4949]: https://github.com/encode/django-rest-framework/issues/4949
<!-- 3.6.3 -->
<!-- 3.6.3 -->
[gh5126]: https://github.com/encode/django-rest-framework/issues/5126
[gh5085]: https://github.com/encode/django-rest-framework/issues/5085
[gh4437]: https://github.com/encode/django-rest-framework/issues/4437
@ -1360,3 +1400,36 @@ For older release notes, [please see the version 2.x documentation][old-release-
[gh4968]: https://github.com/encode/django-rest-framework/issues/4968
[gh5089]: https://github.com/encode/django-rest-framework/issues/5089
[gh5117]: https://github.com/encode/django-rest-framework/issues/5117
<!-- 3.6.4 -->
[gh5346]: https://github.com/encode/django-rest-framework/issues/5346
[gh5334]: https://github.com/encode/django-rest-framework/issues/5334
[gh5326]: https://github.com/encode/django-rest-framework/issues/5326
[gh5313]: https://github.com/encode/django-rest-framework/issues/5313
[gh5306]: https://github.com/encode/django-rest-framework/issues/5306
[gh5276]: https://github.com/encode/django-rest-framework/issues/5276
[gh5264]: https://github.com/encode/django-rest-framework/issues/5264
[gh5261]: https://github.com/encode/django-rest-framework/issues/5261
[gh5259]: https://github.com/encode/django-rest-framework/issues/5259
[gh5231]: https://github.com/encode/django-rest-framework/issues/5231
[gh5229]: https://github.com/encode/django-rest-framework/issues/5229
[gh5214]: https://github.com/encode/django-rest-framework/issues/5214
[gh5196]: https://github.com/encode/django-rest-framework/issues/5196
[gh5192]: https://github.com/encode/django-rest-framework/issues/5192
[gh5162]: https://github.com/encode/django-rest-framework/issues/5162
[gh5188]: https://github.com/encode/django-rest-framework/issues/5188
[gh5187]: https://github.com/encode/django-rest-framework/issues/5187
[gh5186]: https://github.com/encode/django-rest-framework/issues/5186
[gh5179]: https://github.com/encode/django-rest-framework/issues/5179
[gh5176]: https://github.com/encode/django-rest-framework/issues/5176
[gh5174]: https://github.com/encode/django-rest-framework/issues/5174
[gh5161]: https://github.com/encode/django-rest-framework/issues/5161
[gh5147]: https://github.com/encode/django-rest-framework/issues/5147
[gh5131]: https://github.com/encode/django-rest-framework/issues/5131
<!-- 3.6.5 -->
[gh5376]: https://github.com/encode/django-rest-framework/issues/5376
[gh5422]: https://github.com/encode/django-rest-framework/issues/5422
[gh5408]: https://github.com/encode/django-rest-framework/issues/5408
[gh3732]: https://github.com/encode/django-rest-framework/issues/3732
[djangodocs-set-timezone]: https://docs.djangoproject.com/en/1.11/topics/i18n/timezones/#default-time-zone-and-current-time-zone

View File

@ -47,7 +47,7 @@ We don't need our `JSONResponse` class in `views.py` anymore, so go ahead and de
@api_view(['GET', 'POST'])
def snippet_list(request):
"""
List all snippets, or create a new snippet.
List all code snippets, or create a new snippet.
"""
if request.method == 'GET':
snippets = Snippet.objects.all()
@ -68,7 +68,7 @@ Here is the view for an individual snippet, in the `views.py` module.
@api_view(['GET', 'PUT', 'DELETE'])
def snippet_detail(request, pk):
"""
Retrieve, update or delete a snippet instance.
Retrieve, update or delete a code snippet.
"""
try:
snippet = Snippet.objects.get(pk=pk)

View File

@ -26,6 +26,7 @@ Here we've used the `ReadOnlyModelViewSet` class to automatically provide the de
Next we're going to replace the `SnippetList`, `SnippetDetail` and `SnippetHighlight` view classes. We can remove the three views, and again replace them with a single class.
from rest_framework.decorators import detail_route
from rest_framework.response import Response
class SnippetViewSet(viewsets.ModelViewSet):
"""

View File

@ -36,7 +36,7 @@ API schema.
We can now include a schema for our API, by including an autogenerated schema
view in our URL configuration.
```
```python
from rest_framework.schemas import get_schema_view
schema_view = get_schema_view(title='Pastebin API')

View File

@ -24,6 +24,30 @@ Create a new Django project named `tutorial`, then start a new app called `quick
django-admin.py startapp quickstart
cd ..
The project layout should look like:
$ pwd
<some path>/tutorial
$ find .
.
./manage.py
./tutorial
./tutorial/__init__.py
./tutorial/quickstart
./tutorial/quickstart/__init__.py
./tutorial/quickstart/admin.py
./tutorial/quickstart/apps.py
./tutorial/quickstart/migrations
./tutorial/quickstart/migrations/__init__.py
./tutorial/quickstart/models.py
./tutorial/quickstart/tests.py
./tutorial/quickstart/views.py
./tutorial/settings.py
./tutorial/urls.py
./tutorial/wsgi.py
It may look unusual that the application has been created within the project directory. Using the project's namespace avoids name clashes with external module (topic goes outside the scope of the quickstart).
Now sync your database for the first time:
python manage.py migrate

View File

@ -1,6 +1,7 @@
# PEP8 code linting, which we run on all commits.
flake8==2.4.0
pep8==1.5.7
flake8==3.4.1
flake8-tidy-imports==1.1.0
pep8==1.7.0
# Sort and lint imports
isort==4.2.5

View File

@ -1,2 +1,2 @@
# MkDocs to build our documentation.
mkdocs==0.16.2
mkdocs==0.16.3

View File

@ -1,6 +1,7 @@
# Optional packages which may be used with REST framework.
pytz==2017.2
markdown==2.6.4
django-guardian==1.4.8
django-guardian==1.4.9
django-filter==1.0.4
coreapi==2.2.4
coreapi==2.3.1
coreschema==0.0.4

View File

@ -1,8 +1,8 @@
# Wheel for PyPI installs.
wheel==0.29.0
wheel==0.30.0
# Twine for secured PyPI uploads.
twine==1.6.5
twine==1.9.1
# Transifex client for managing translation resources.
transifex-client==0.11

View File

@ -1,4 +1,4 @@
# PyTest for running the tests.
pytest==3.0.5
pytest==3.2.2
pytest-django==3.1.2
pytest-cov==2.4.0
pytest-cov==2.5.1

View File

@ -8,7 +8,7 @@ ______ _____ _____ _____ __
"""
__title__ = 'Django REST framework'
__version__ = '3.6.3'
__version__ = '3.6.4'
__author__ = 'Tom Christie'
__license__ = 'BSD 2-Clause'
__copyright__ = 'Copyright 2011-2017 Tom Christie'
@ -21,3 +21,5 @@ HTTP_HEADER_ENCODING = 'iso-8859-1'
# Default datetime input and output formats
ISO_8601 = 'iso-8601'
default_app_config = 'rest_framework.apps.RestFrameworkConfig'

10
rest_framework/apps.py Normal file
View File

@ -0,0 +1,10 @@
from django.apps import AppConfig
class RestFrameworkConfig(AppConfig):
name = 'rest_framework'
verbose_name = "Django REST framework"
def ready(self):
# Add System checks
from .checks import pagination_system_check # NOQA

View File

@ -201,3 +201,24 @@ class TokenAuthentication(BaseAuthentication):
def authenticate_header(self, request):
return self.keyword
class RemoteUserAuthentication(BaseAuthentication):
"""
REMOTE_USER authentication.
To use this, set up your web server to perform authentication, which will
set the REMOTE_USER environment variable. You will need to have
'django.contrib.auth.backends.RemoteUserBackend in your
AUTHENTICATION_BACKENDS setting
"""
# Name of request header to grab username from. This will be the key as
# used in the request.META dictionary, i.e. the normalization of headers to
# all uppercase and the addition of "HTTP_" prefix apply.
header = "REMOTE_USER"
def authenticate(self, request):
user = authenticate(remote_user=request.META.get(self.header))
if user and user.is_active:
return (user, None)

View File

@ -19,7 +19,7 @@ class Command(BaseCommand):
return token[0]
def add_arguments(self, parser):
parser.add_argument('username', type=str, nargs='+')
parser.add_argument('username', type=str)
parser.add_argument(
'-r',

18
rest_framework/checks.py Normal file
View File

@ -0,0 +1,18 @@
from django.core.checks import Tags, Warning, register
@register(Tags.compatibility)
def pagination_system_check(app_configs, **kwargs):
errors = []
# Use of default page size setting requires a default Paginator class
from rest_framework.settings import api_settings
if api_settings.PAGE_SIZE and not api_settings.DEFAULT_PAGINATION_CLASS:
errors.append(
Warning(
"You have specified a default PAGE_SIZE pagination rest_framework setting,"
"without specifying also a DEFAULT_PAGINATION_CLASS.",
hint="The default for DEFAULT_PAGINATION_CLASS is None. "
"In previous versions this was PageNumberPagination",
)
)
return errors

View File

@ -11,13 +11,18 @@ import inspect
import django
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core.validators import \
MaxLengthValidator as DjangoMaxLengthValidator
from django.core.validators import MaxValueValidator as DjangoMaxValueValidator
from django.core.validators import \
MinLengthValidator as DjangoMinLengthValidator
from django.core.validators import MinValueValidator as DjangoMinValueValidator
from django.db import connection, models, transaction
from django.template import Context, RequestContext, Template
from django.utils import six
from django.views.generic import View
try:
from django.urls import (
NoReverseMatch, RegexURLPattern, RegexURLResolver, ResolverMatch, Resolver404, get_script_prefix, reverse, reverse_lazy, resolve
@ -182,13 +187,6 @@ except ImportError:
coreschema = None
# django-filter is optional
try:
import django_filters
except ImportError:
django_filters = None
# django-crispy-forms is optional
try:
import crispy_forms
@ -246,6 +244,7 @@ try:
md = markdown.Markdown(
extensions=extensions, extension_configs=extension_configs
)
md_filter_add_syntax_highlight(md)
return md.convert(text)
except ImportError:
apply_markdown = None
@ -275,6 +274,38 @@ except ImportError:
def pygments_css(style):
return None
if markdown is not None and pygments is not None:
# starting from this blogpost and modified to support current markdown extensions API
# https://zerokspot.com/weblog/2008/06/18/syntax-highlighting-in-markdown-with-pygments/
from markdown.preprocessors import Preprocessor
import re
class CodeBlockPreprocessor(Preprocessor):
pattern = re.compile(
r'^\s*@@ (.+?) @@\s*(.+?)^\s*@@', re.M|re.S)
formatter = HtmlFormatter()
def run(self, lines):
def repl(m):
try:
lexer = get_lexer_by_name(m.group(1))
except (ValueError, NameError):
lexer = TextLexer()
code = m.group(2).replace('\t',' ')
code = pygments.highlight(code, lexer, self.formatter)
code = code.replace('\n\n', '\n&nbsp;\n').replace('\n', '<br />').replace('\\@','@')
return '\n\n%s\n\n' % code
ret = self.pattern.sub(repl, "\n".join(lines))
return ret.split("\n")
def md_filter_add_syntax_highlight(md):
md.preprocessors.add('highlight', CodeBlockPreprocessor(), "_begin")
return True
else:
def md_filter_add_syntax_highlight(md):
return False
try:
import pytz
@ -300,6 +331,28 @@ try:
except ImportError:
DecimalValidator = None
class CustomValidatorMessage(object):
"""
We need to avoid evaluation of `lazy` translated `message` in `django.core.validators.BaseValidator.__init__`.
https://github.com/django/django/blob/75ed5900321d170debef4ac452b8b3cf8a1c2384/django/core/validators.py#L297
Ref: https://github.com/encode/django-rest-framework/pull/5452
"""
def __init__(self, *args, **kwargs):
self.message = kwargs.pop('message', self.message)
super(CustomValidatorMessage, self).__init__(*args, **kwargs)
class MinValueValidator(CustomValidatorMessage, DjangoMinValueValidator):
pass
class MaxValueValidator(CustomValidatorMessage, DjangoMaxValueValidator):
pass
class MinLengthValidator(CustomValidatorMessage, DjangoMinLengthValidator):
pass
class MaxLengthValidator(CustomValidatorMessage, DjangoMaxLengthValidator):
pass
def set_rollback():
if hasattr(transaction, 'set_rollback'):

View File

@ -9,6 +9,7 @@ used to annotate methods on viewsets that should be included by routers.
from __future__ import unicode_literals
import types
import warnings
from django.utils import six
@ -72,7 +73,17 @@ def api_view(http_method_names=None, exclude_from_schema=False):
WrappedAPIView.permission_classes = getattr(func, 'permission_classes',
APIView.permission_classes)
WrappedAPIView.schema = getattr(func, 'schema',
APIView.schema)
if exclude_from_schema:
warnings.warn(
"The `exclude_from_schema` argument to `api_view` is pending deprecation. "
"Use the `schema` decorator instead, passing `None`.",
PendingDeprecationWarning
)
WrappedAPIView.exclude_from_schema = exclude_from_schema
return WrappedAPIView.as_view()
return decorator
@ -112,6 +123,13 @@ def permission_classes(permission_classes):
return decorator
def schema(view_inspector):
def decorator(func):
func.schema = view_inspector
return func
return decorator
def detail_route(methods=None, **kwargs):
"""
Used to mark a method on a ViewSet that should be routed for detail requests.

View File

@ -4,11 +4,14 @@ from rest_framework.renderers import (
CoreJSONRenderer, DocumentationRenderer, SchemaJSRenderer
)
from rest_framework.schemas import SchemaGenerator, get_schema_view
from rest_framework.settings import api_settings
def get_docs_view(
title=None, description=None, schema_url=None, public=True,
patterns=None, generator_class=SchemaGenerator):
patterns=None, generator_class=SchemaGenerator,
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES):
renderer_classes = [DocumentationRenderer, CoreJSONRenderer]
return get_schema_view(
@ -19,12 +22,16 @@ def get_docs_view(
public=public,
patterns=patterns,
generator_class=generator_class,
authentication_classes=authentication_classes,
permission_classes=permission_classes,
)
def get_schemajs_view(
title=None, description=None, schema_url=None, public=True,
patterns=None, generator_class=SchemaGenerator):
patterns=None, generator_class=SchemaGenerator,
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES):
renderer_classes = [SchemaJSRenderer]
return get_schema_view(
@ -35,12 +42,16 @@ def get_schemajs_view(
public=public,
patterns=patterns,
generator_class=generator_class,
authentication_classes=authentication_classes,
permission_classes=permission_classes,
)
def include_docs_urls(
title=None, description=None, schema_url=None, public=True,
patterns=None, generator_class=SchemaGenerator):
patterns=None, generator_class=SchemaGenerator,
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES):
docs_view = get_docs_view(
title=title,
description=description,
@ -48,6 +59,8 @@ def include_docs_urls(
public=public,
patterns=patterns,
generator_class=generator_class,
authentication_classes=authentication_classes,
permission_classes=permission_classes,
)
schema_js_view = get_schemajs_view(
title=title,
@ -56,6 +69,8 @@ def include_docs_urls(
public=public,
patterns=patterns,
generator_class=generator_class,
authentication_classes=authentication_classes,
permission_classes=permission_classes,
)
urls = [
url(r'^$', docs_view, name='docs-index'),

View File

@ -64,7 +64,7 @@ def _get_full_details(detail):
class ErrorDetail(six.text_type):
"""
A string-like object that can additionally
A string-like object that can additionally have a code.
"""
code = None
@ -123,7 +123,7 @@ class ValidationError(APIException):
default_detail = _('Invalid input.')
default_code = 'invalid'
def __init__(self, detail, code=None):
def __init__(self, detail=None, code=None):
if detail is None:
detail = self.default_detail
if code is None:

View File

@ -5,7 +5,6 @@ import copy
import datetime
import decimal
import inspect
import json
import re
import uuid
from collections import OrderedDict
@ -14,8 +13,7 @@ from django.conf import settings
from django.core.exceptions import ValidationError as DjangoValidationError
from django.core.exceptions import ObjectDoesNotExist
from django.core.validators import (
EmailValidator, MaxLengthValidator, MaxValueValidator, MinLengthValidator,
MinValueValidator, RegexValidator, URLValidator, ip_address_validators
EmailValidator, RegexValidator, URLValidator, ip_address_validators
)
from django.forms import FilePathField as DjangoFilePathField
from django.forms import ImageField as DjangoImageField
@ -26,19 +24,20 @@ from django.utils.dateparse import (
from django.utils.duration import duration_string
from django.utils.encoding import is_protected_type, smart_text
from django.utils.formats import localize_input, sanitize_separators
from django.utils.functional import cached_property
from django.utils.functional import lazy
from django.utils.ipv6 import clean_ipv6_address
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from rest_framework import ISO_8601
from rest_framework.compat import (
InvalidTimeError, get_remote_field, unicode_repr, unicode_to_repr,
value_from_object
InvalidTimeError, MaxLengthValidator, MaxValueValidator,
MinLengthValidator, MinValueValidator, get_remote_field, unicode_repr,
unicode_to_repr, value_from_object
)
from rest_framework.exceptions import ErrorDetail, ValidationError
from rest_framework.settings import api_settings
from rest_framework.utils import html, humanize_datetime, representation
from rest_framework.utils import html, humanize_datetime, json, representation
class empty:
@ -94,9 +93,6 @@ def get_attribute(instance, attrs):
Also accepts either attribute lookup on objects or dictionary lookups.
"""
for attr in attrs:
if instance is None:
# Break out early if we get `None` at any point in a nested lookup.
return None
try:
if isinstance(instance, collections.Mapping):
instance = instance[attr]
@ -143,7 +139,7 @@ def to_choices_dict(choices):
to_choices_dict([1]) -> {1: 1}
to_choices_dict([(1, '1st'), (2, '2nd')]) -> {1: '1st', 2: '2nd'}
to_choices_dict([('Group', ((1, '1st'), 2))]) -> {'Group': {1: '1st', 2: '2nd'}}
to_choices_dict([('Group', ((1, '1st'), 2))]) -> {'Group': {1: '1st', 2: '2'}}
"""
# Allow single, paired or grouped choices style:
# choices = [1, 2, 3]
@ -586,7 +582,7 @@ class Field(object):
message_string = msg.format(**kwargs)
raise ValidationError(message_string, code=key)
@cached_property
@property
def root(self):
"""
Returns the top-level serializer for this field.
@ -596,7 +592,7 @@ class Field(object):
root = root.parent
return root
@cached_property
@property
def context(self):
"""
Returns the context as passed to the root serializer on initialization.
@ -692,8 +688,22 @@ class NullBooleanField(Field):
'invalid': _('"{input}" is not a valid boolean.')
}
initial = None
TRUE_VALUES = {'t', 'T', 'true', 'True', 'TRUE', '1', 1, True}
FALSE_VALUES = {'f', 'F', 'false', 'False', 'FALSE', '0', 0, 0.0, False}
TRUE_VALUES = {
't', 'T',
'y', 'Y', 'yes', 'YES',
'true', 'True', 'TRUE',
'on', 'On', 'ON',
'1', 1,
True
}
FALSE_VALUES = {
'f', 'F',
'n', 'N', 'no', 'NO',
'false', 'False', 'FALSE',
'off', 'Off', 'OFF',
'0', 0, 0.0,
False
}
NULL_VALUES = {'n', 'N', 'null', 'Null', 'NULL', '', None}
def __init__(self, **kwargs):
@ -702,12 +712,15 @@ class NullBooleanField(Field):
super(NullBooleanField, self).__init__(**kwargs)
def to_internal_value(self, data):
try:
if data in self.TRUE_VALUES:
return True
elif data in self.FALSE_VALUES:
return False
elif data in self.NULL_VALUES:
return None
except TypeError: # Input is an unhashable type
pass
self.fail('invalid', input=data)
def to_representation(self, value):
@ -738,11 +751,17 @@ class CharField(Field):
self.min_length = kwargs.pop('min_length', None)
super(CharField, self).__init__(**kwargs)
if self.max_length is not None:
message = self.error_messages['max_length'].format(max_length=self.max_length)
self.validators.append(MaxLengthValidator(self.max_length, message=message))
message = lazy(
self.error_messages['max_length'].format,
six.text_type)(max_length=self.max_length)
self.validators.append(
MaxLengthValidator(self.max_length, message=message))
if self.min_length is not None:
message = self.error_messages['min_length'].format(min_length=self.min_length)
self.validators.append(MinLengthValidator(self.min_length, message=message))
message = lazy(
self.error_messages['min_length'].format,
six.text_type)(min_length=self.min_length)
self.validators.append(
MinLengthValidator(self.min_length, message=message))
def run_validation(self, data=empty):
# Test for the empty string here so that it does not get validated,
@ -897,11 +916,17 @@ class IntegerField(Field):
self.min_value = kwargs.pop('min_value', None)
super(IntegerField, self).__init__(**kwargs)
if self.max_value is not None:
message = self.error_messages['max_value'].format(max_value=self.max_value)
self.validators.append(MaxValueValidator(self.max_value, message=message))
message = lazy(
self.error_messages['max_value'].format,
six.text_type)(max_value=self.max_value)
self.validators.append(
MaxValueValidator(self.max_value, message=message))
if self.min_value is not None:
message = self.error_messages['min_value'].format(min_value=self.min_value)
self.validators.append(MinValueValidator(self.min_value, message=message))
message = lazy(
self.error_messages['min_value'].format,
six.text_type)(min_value=self.min_value)
self.validators.append(
MinValueValidator(self.min_value, message=message))
def to_internal_value(self, data):
if isinstance(data, six.text_type) and len(data) > self.MAX_STRING_LENGTH:
@ -931,11 +956,17 @@ class FloatField(Field):
self.min_value = kwargs.pop('min_value', None)
super(FloatField, self).__init__(**kwargs)
if self.max_value is not None:
message = self.error_messages['max_value'].format(max_value=self.max_value)
self.validators.append(MaxValueValidator(self.max_value, message=message))
message = lazy(
self.error_messages['max_value'].format,
six.text_type)(max_value=self.max_value)
self.validators.append(
MaxValueValidator(self.max_value, message=message))
if self.min_value is not None:
message = self.error_messages['min_value'].format(min_value=self.min_value)
self.validators.append(MinValueValidator(self.min_value, message=message))
message = lazy(
self.error_messages['min_value'].format,
six.text_type)(min_value=self.min_value)
self.validators.append(
MinValueValidator(self.min_value, message=message))
def to_internal_value(self, data):
@ -984,11 +1015,17 @@ class DecimalField(Field):
super(DecimalField, self).__init__(**kwargs)
if self.max_value is not None:
message = self.error_messages['max_value'].format(max_value=self.max_value)
self.validators.append(MaxValueValidator(self.max_value, message=message))
message = lazy(
self.error_messages['max_value'].format,
six.text_type)(max_value=self.max_value)
self.validators.append(
MaxValueValidator(self.max_value, message=message))
if self.min_value is not None:
message = self.error_messages['min_value'].format(min_value=self.min_value)
self.validators.append(MinValueValidator(self.min_value, message=message))
message = lazy(
self.error_messages['min_value'].format,
six.text_type)(min_value=self.min_value)
self.validators.append(
MinValueValidator(self.min_value, message=message))
def to_internal_value(self, data):
"""
@ -1112,7 +1149,9 @@ class DateTimeField(Field):
"""
field_timezone = getattr(self, 'timezone', self.default_timezone())
if (field_timezone is not None) and not timezone.is_aware(value):
if field_timezone is not None:
if timezone.is_aware(value):
return value.astimezone(field_timezone)
try:
return timezone.make_aware(value, field_timezone)
except InvalidTimeError:
@ -1122,7 +1161,7 @@ class DateTimeField(Field):
return value
def default_timezone(self):
return timezone.get_default_timezone() if settings.USE_TZ else None
return timezone.get_current_timezone() if settings.USE_TZ else None
def to_internal_value(self, value):
input_formats = getattr(self, 'input_formats', api_settings.DATETIME_INPUT_FORMATS)
@ -1161,6 +1200,7 @@ class DateTimeField(Field):
return value
if output_format.lower() == ISO_8601:
value = self.enforce_timezone(value)
value = value.isoformat()
if value.endswith('+00:00'):
value = value[:-6] + 'Z'
@ -1324,18 +1364,10 @@ class ChoiceField(Field):
html_cutoff_text = _('More than {count} items...')
def __init__(self, choices, **kwargs):
self.grouped_choices = to_choices_dict(choices)
self.choices = flatten_choices_dict(self.grouped_choices)
self.choices = choices
self.html_cutoff = kwargs.pop('html_cutoff', self.html_cutoff)
self.html_cutoff_text = kwargs.pop('html_cutoff_text', self.html_cutoff_text)
# Map the string representation of choices to the underlying value.
# Allows us to deal with eg. integer choices while supporting either
# integer or string input, but still get the correct datatype out.
self.choice_strings_to_values = {
six.text_type(key): key for key in self.choices.keys()
}
self.allow_blank = kwargs.pop('allow_blank', False)
super(ChoiceField, self).__init__(**kwargs)
@ -1364,6 +1396,22 @@ class ChoiceField(Field):
cutoff_text=self.html_cutoff_text
)
def _get_choices(self):
return self._choices
def _set_choices(self, choices):
self.grouped_choices = to_choices_dict(choices)
self._choices = flatten_choices_dict(self.grouped_choices)
# Map the string representation of choices to the underlying value.
# Allows us to deal with eg. integer choices while supporting either
# integer or string input, but still get the correct datatype out.
self.choice_strings_to_values = {
six.text_type(key): key for key in self.choices.keys()
}
choices = property(_get_choices, _set_choices)
class MultipleChoiceField(ChoiceField):
default_error_messages = {
@ -1774,13 +1822,16 @@ class ModelField(Field):
max_length = kwargs.pop('max_length', None)
super(ModelField, self).__init__(**kwargs)
if max_length is not None:
message = self.error_messages['max_length'].format(max_length=max_length)
self.validators.append(MaxLengthValidator(max_length, message=message))
message = lazy(
self.error_messages['max_length'].format,
six.text_type)(max_length=self.max_length)
self.validators.append(
MaxLengthValidator(self.max_length, message=message))
def to_internal_value(self, data):
rel = get_remote_field(self.model_field, default=None)
if rel is not None:
return rel.to._meta.get_field(rel.field_name).to_python(data)
return rel.model._meta.get_field(rel.field_name).to_python(data)
return self.model_field.to_python(data)
def get_attribute(self, obj):

View File

@ -5,7 +5,6 @@ returned by list views.
from __future__ import unicode_literals
import operator
import warnings
from functools import reduce
from django.core.exceptions import ImproperlyConfigured
@ -18,7 +17,7 @@ from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from rest_framework.compat import (
coreapi, coreschema, distinct, django_filters, guardian, template_render
coreapi, coreschema, distinct, guardian, template_render
)
from rest_framework.settings import api_settings
@ -40,44 +39,6 @@ class BaseFilterBackend(object):
return []
if django_filters:
from django_filters.rest_framework.filterset import FilterSet as DFFilterSet
class FilterSet(DFFilterSet):
def __init__(self, *args, **kwargs):
warnings.warn(
"The built in 'rest_framework.filters.FilterSet' is deprecated. "
"You should use 'django_filters.rest_framework.FilterSet' instead.",
DeprecationWarning, stacklevel=2
)
return super(FilterSet, self).__init__(*args, **kwargs)
DFBase = django_filters.rest_framework.DjangoFilterBackend
else:
def FilterSet():
assert False, 'django-filter must be installed to use the `FilterSet` class'
DFBase = BaseFilterBackend
class DjangoFilterBackend(DFBase):
"""
A filter backend that uses django-filter.
"""
def __new__(cls, *args, **kwargs):
assert django_filters, 'Using DjangoFilterBackend, but django-filter is not installed'
assert django_filters.VERSION >= (0, 15, 3), 'django-filter 0.15.3 and above is required'
warnings.warn(
"The built in 'rest_framework.filters.DjangoFilterBackend' is deprecated. "
"You should use 'django_filters.rest_framework.DjangoFilterBackend' instead.",
DeprecationWarning, stacklevel=2
)
return super(DjangoFilterBackend, cls).__new__(cls, *args, **kwargs)
class SearchFilter(BaseFilterBackend):
# The URL query parameter used for the search.
search_param = api_settings.SEARCH_PARAM

View File

@ -3,15 +3,16 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Bashar Al-Abdulhadi, 2016
# aymen chaieb <chaieb.aymen1992@gmail.com>, 2017
# Bashar Al-Abdulhadi, 2016-2017
# Eyad Toma <d.eyad.t@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-15 17:08+0000\n"
"Last-Translator: aymen chaieb <chaieb.aymen1992@gmail.com>\n"
"Language-Team: Arabic (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -54,7 +55,7 @@ msgstr ""
#: authentication.py:195
msgid "Invalid token."
msgstr "رمز غير صحيح"
msgstr "رمز غير صحيح."
#: authtoken/apps.py:7
msgid "Auth Token"
@ -316,15 +317,15 @@ msgstr "أرسل"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "تصاعدي"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "تنازلي"
#: pagination.py:193
msgid "Invalid page."
msgstr "صفحة غير صحيحة"
msgstr "صفحة غير صحيحة."
#: pagination.py:427
msgid "Invalid cursor"
@ -382,13 +383,13 @@ msgstr "الترتيب"
#: templates/rest_framework/filters/search.html:2
msgid "Search"
msgstr "البحث"
msgstr "بحث"
#: templates/rest_framework/horizontal/radio.html:2
#: templates/rest_framework/inline/radio.html:2
#: templates/rest_framework/vertical/radio.html:2
msgid "None"
msgstr ""
msgstr "لا شيء"
#: templates/rest_framework/horizontal/select_multiple.html:2
#: templates/rest_framework/inline/select_multiple.html:2
@ -398,7 +399,7 @@ msgstr ""
#: validators.py:43
msgid "This field must be unique."
msgstr ""
msgstr "هذا الحقل يجب أن يكون وحيد"
#: validators.py:97
msgid "The fields {field_names} must make a unique set."
@ -438,4 +439,4 @@ msgstr ""
#: views.py:88
msgid "Permission denied."
msgstr ""
msgstr "حق غير مصرح به"

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Catalan (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/ca/)\n"
"MIME-Version: 1.0\n"

View File

@ -10,7 +10,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Czech (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/cs/)\n"
"MIME-Version: 1.0\n"

View File

@ -3,15 +3,15 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Mads Jensen <mje@inducks.org>, 2015-2016
# Mads Jensen <mje@inducks.org>, 2015-2017
# Mikkel Munch Mortensen <3xm@detfalskested.dk>, 2015
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Mads Jensen <mje@inducks.org>\n"
"Language-Team: Danish (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/da/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -62,31 +62,31 @@ msgstr ""
#: authtoken/models.py:15
msgid "Key"
msgstr ""
msgstr "Nøgle"
#: authtoken/models.py:18
msgid "User"
msgstr ""
msgstr "Bruger"
#: authtoken/models.py:20
msgid "Created"
msgstr ""
msgstr "Oprettet"
#: authtoken/models.py:29
msgid "Token"
msgstr ""
msgstr "Token"
#: authtoken/models.py:30
msgid "Tokens"
msgstr ""
msgstr "Tokens"
#: authtoken/serializers.py:8
msgid "Username"
msgstr ""
msgstr "Brugernavn"
#: authtoken/serializers.py:9
msgid "Password"
msgstr ""
msgstr "Kodeord"
#: authtoken/serializers.py:20
msgid "User account is disabled."
@ -316,15 +316,15 @@ msgstr "Indsend."
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "stigende"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "faldende"
#: pagination.py:193
msgid "Invalid page."
msgstr ""
msgstr "Ugyldig side"
#: pagination.py:427
msgid "Invalid cursor"
@ -426,7 +426,7 @@ msgstr "Ugyldig version i URL-stien."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "Ugyldig version in URLen. Den stemmer ikke overens med nogen versionsnumre."
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -4,6 +4,8 @@
#
# Translators:
# Fabian Büchler <fabian@buechler.io>, 2015
# datKater <imperator.katz@gmail.com>, 2017
# Lukas Bischofberger <me@worx.li>, 2017
# Mads Jensen <mje@inducks.org>, 2015
# Niklas P <contact@niklasplessing.net>, 2015-2016
# Thomas Tanner, 2015
@ -14,8 +16,8 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Lukas Bischofberger <me@worx.li>\n"
"Language-Team: German (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -74,7 +76,7 @@ msgstr "Benutzer"
#: authtoken/models.py:20
msgid "Created"
msgstr ""
msgstr "Erzeugt"
#: authtoken/models.py:29
msgid "Token"
@ -98,7 +100,7 @@ msgstr "Benutzerkonto ist gesperrt."
#: authtoken/serializers.py:23
msgid "Unable to log in with provided credentials."
msgstr "Kann nicht mit den angegeben Zugangsdaten anmelden."
msgstr "Die angegebenen Zugangsdaten stimmen nicht."
#: authtoken/serializers.py:26
msgid "Must include \"username\" and \"password\"."
@ -122,7 +124,7 @@ msgstr "Anmeldedaten fehlen."
#: exceptions.py:99
msgid "You do not have permission to perform this action."
msgstr "Sie sind nicht berechtigt, diese Aktion durchzuführen."
msgstr "Sie sind nicht berechtigt diese Aktion durchzuführen."
#: exceptions.py:104 views.py:81
msgid "Not found."
@ -151,7 +153,7 @@ msgstr "Dieses Feld ist erforderlich."
#: fields.py:270
msgid "This field may not be null."
msgstr "Dieses Feld darf nicht Null sein."
msgstr "Dieses Feld darf nicht null sein."
#: fields.py:608 fields.py:639
msgid "\"{input}\" is not a valid boolean."
@ -193,7 +195,7 @@ msgstr "\"{value}\" ist keine gültige UUID."
#: fields.py:796
msgid "Enter a valid IPv4 or IPv6 address."
msgstr "Geben Sie eine gültige UPv4 oder IPv6 Adresse an"
msgstr "Geben Sie eine gültige IPv4 oder IPv6 Adresse an"
#: fields.py:821
msgid "A valid integer is required."
@ -272,7 +274,7 @@ msgstr "Diese Auswahl darf nicht leer sein"
#: fields.py:1339
msgid "\"{input}\" is not a valid path choice."
msgstr "\"{input}\" ist ein ungültiger Pfad Wahl."
msgstr "\"{input}\" ist ein ungültiger Pfad."
#: fields.py:1358
msgid "No file was submitted."
@ -308,7 +310,7 @@ msgstr "Diese Liste darf nicht leer sein."
#: fields.py:1502
msgid "Expected a dictionary of items but got type \"{input_type}\"."
msgstr "Erwarte ein Dictionary mit Elementen, erhielt aber den Typ \"{input_type}\"."
msgstr "Erwartete ein Dictionary mit Elementen, erhielt aber den Typ \"{input_type}\"."
#: fields.py:1549
msgid "Value must be valid JSON."
@ -320,15 +322,15 @@ msgstr "Abschicken"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "Aufsteigend"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "Absteigend"
#: pagination.py:193
msgid "Invalid page."
msgstr ""
msgstr "Ungültige Seite."
#: pagination.py:427
msgid "Invalid cursor"
@ -430,7 +432,7 @@ msgstr "Ungültige Version im URL Pfad."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "Ungültige Version im URL-Pfad. Entspricht keinem Versions-Namensraum."
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Greek (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/el/)\n"
"MIME-Version: 1.0\n"

View File

@ -6,6 +6,7 @@
# Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com>, 2015
# José Padilla <jpadilla@webapplicate.com>, 2015
# Miguel Gonzalez <migonzalvar@gmail.com>, 2015
# Miguel Gonzalez <migonzalvar@gmail.com>, 2016
# Miguel Gonzalez <migonzalvar@gmail.com>, 2015-2016
# Sergio Infante <rsinfante@gmail.com>, 2015
msgid ""
@ -13,8 +14,8 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Miguel Gonzalez <migonzalvar@gmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -319,11 +320,11 @@ msgstr "Enviar"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "ascendiente"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "descendiente"
#: pagination.py:193
msgid "Invalid page."
@ -429,7 +430,7 @@ msgstr "Versión inválida en la ruta de la URL."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "La versión especificada en la ruta de la URL no es válida. No coincide con ninguna del espacio de nombres de versiones."
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Estonian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/et/)\n"
"MIME-Version: 1.0\n"

View File

@ -4,14 +4,14 @@
#
# Translators:
# Aarni Koskela, 2015
# Aarni Koskela, 2015
# Aarni Koskela, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Aarni Koskela\n"
"Language-Team: Finnish (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/fi/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -58,35 +58,35 @@ msgstr "Epäkelpo Token."
#: authtoken/apps.py:7
msgid "Auth Token"
msgstr ""
msgstr "Autentikaatiotunniste"
#: authtoken/models.py:15
msgid "Key"
msgstr ""
msgstr "Avain"
#: authtoken/models.py:18
msgid "User"
msgstr ""
msgstr "Käyttäjä"
#: authtoken/models.py:20
msgid "Created"
msgstr ""
msgstr "Luotu"
#: authtoken/models.py:29
msgid "Token"
msgstr ""
msgstr "Tunniste"
#: authtoken/models.py:30
msgid "Tokens"
msgstr ""
msgstr "Tunnisteet"
#: authtoken/serializers.py:8
msgid "Username"
msgstr ""
msgstr "Käyttäjänimi"
#: authtoken/serializers.py:9
msgid "Password"
msgstr ""
msgstr "Salasana"
#: authtoken/serializers.py:20
msgid "User account is disabled."
@ -316,15 +316,15 @@ msgstr "Lähetä"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "nouseva"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "laskeva"
#: pagination.py:193
msgid "Invalid page."
msgstr ""
msgstr "Epäkelpo sivu."
#: pagination.py:427
msgid "Invalid cursor"
@ -426,7 +426,7 @@ msgstr "Epäkelpo versio URL-polussa."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "URL-polun versio ei täsmää mihinkään versionimiavaruuteen."
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -12,8 +12,8 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Xavier Ordoquy <xordoquy@linovia.com>\n"
"Language-Team: French (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -318,11 +318,11 @@ msgstr "Envoyer"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "croissant"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "décroissant"
#: pagination.py:193
msgid "Invalid page."
@ -428,7 +428,7 @@ msgstr "Version non valide dans l'URL."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "Version invalide dans l'URL. Ne correspond à aucune version de l'espace de nommage."
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Hungarian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/hu/)\n"
"MIME-Version: 1.0\n"

View File

@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Italian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/it/)\n"
"MIME-Version: 1.0\n"

View File

@ -4,13 +4,14 @@
#
# Translators:
# Hiroaki Nakamura <hnakamur@gmail.com>, 2016
# Kouichi Nishizawa <kouichi.nishizawa@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Kouichi Nishizawa <kouichi.nishizawa@gmail.com>\n"
"Language-Team: Japanese (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -315,15 +316,15 @@ msgstr "提出"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "昇順"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "降順"
#: pagination.py:193
msgid "Invalid page."
msgstr ""
msgstr "不正なページです。"
#: pagination.py:427
msgid "Invalid cursor"
@ -425,7 +426,7 @@ msgstr "URLパス内のバージョンが不正です。"
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "不正なバージョンのURLのパスです。どのバージョンの名前空間にも一致しません。"
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -3,14 +3,15 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Joon Hwan 김준환 <xncbf12@gmail.com>, 2017
# SUN CHOI <best2378@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Joon Hwan 김준환 <xncbf12@gmail.com>\n"
"Language-Team: Korean (Korea) (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/ko_KR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -247,7 +248,7 @@ msgstr "Time의 포멧이 잘못되었습니다. 이 형식들 중 한가지를
#: fields.py:1232
msgid "Duration has wrong format. Use one of these formats instead: {format}."
msgstr ""
msgstr "Duration의 포멧이 잘못되었습니다. 이 형식들 중 한가지를 사용하세요: {format}."
#: fields.py:1251 fields.py:1300
msgid "\"{input}\" is not a valid choice."
@ -263,11 +264,11 @@ msgstr "아이템 리스트가 예상되었으나 \"{input_type}\"를 받았습
#: fields.py:1302
msgid "This selection may not be empty."
msgstr ""
msgstr "이 선택 항목은 비워 둘 수 없습니다."
#: fields.py:1339
msgid "\"{input}\" is not a valid path choice."
msgstr ""
msgstr "\"{input}\"이 유효하지 않은 경로 선택입니다."
#: fields.py:1358
msgid "No file was submitted."
@ -299,7 +300,7 @@ msgstr "유효한 이미지 파일을 업로드 하십시오. 업로드 하신
#: fields.py:1449 relations.py:438 serializers.py:525
msgid "This list may not be empty."
msgstr ""
msgstr "이 리스트는 비워 둘 수 없습니다."
#: fields.py:1502
msgid "Expected a dictionary of items but got type \"{input_type}\"."
@ -307,7 +308,7 @@ msgstr "아이템 딕셔너리가 예상되었으나 \"{input_type}\" 타입을
#: fields.py:1549
msgid "Value must be valid JSON."
msgstr ""
msgstr "Value 는 유효한 JSON형식이어야 합니다."
#: filters.py:36 templates/rest_framework/filters/django_filter.html:5
msgid "Submit"
@ -315,15 +316,15 @@ msgstr ""
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "오름차순"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "내림차순"
#: pagination.py:193
msgid "Invalid page."
msgstr ""
msgstr "페이지가 유효하지 않습니다."
#: pagination.py:427
msgid "Invalid cursor"
@ -381,7 +382,7 @@ msgstr ""
#: templates/rest_framework/filters/search.html:2
msgid "Search"
msgstr ""
msgstr "검색"
#: templates/rest_framework/horizontal/radio.html:2
#: templates/rest_framework/inline/radio.html:2
@ -401,19 +402,19 @@ msgstr "이 칸은 반드시 고유해야 합니다."
#: validators.py:97
msgid "The fields {field_names} must make a unique set."
msgstr ""
msgstr "{field_names} 필드는 반드시 고유하게 설정해야 합니다."
#: validators.py:245
msgid "This field must be unique for the \"{date_field}\" date."
msgstr ""
msgstr "이 칸은 \"{date_field}\"날짜에 대해 고유해야합니다."
#: validators.py:260
msgid "This field must be unique for the \"{date_field}\" month."
msgstr ""
msgstr "이 칸은 \"{date_field}\" 월에 대해 고유해야합니다."
#: validators.py:273
msgid "This field must be unique for the \"{date_field}\" year."
msgstr ""
msgstr "이 칸은 \"{date_field}\" 년에 대해 고유해야합니다."
#: versioning.py:42
msgid "Invalid version in \"Accept\" header."
@ -425,7 +426,7 @@ msgstr "URL path내 버전이 유효하지 않습니다."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "URL 경로에 유효하지 않은 버전이 있습니다. 버전 네임 스페이스와 일치하지 않습니다."
#: versioning.py:147
msgid "Invalid version in hostname."
@ -437,4 +438,4 @@ msgstr "쿼리 파라메터내 버전이 유효하지 않습니다."
#: views.py:88
msgid "Permission denied."
msgstr ""
msgstr "사용 권한이 거부되었습니다."

Binary file not shown.

View File

@ -0,0 +1,440 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# peterisb <pb@sungis.lv>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2017-08-05 12:13+0000\n"
"Last-Translator: peterisb <pb@sungis.lv>\n"
"Language-Team: Latvian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/lv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: lv\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n"
#: authentication.py:73
msgid "Invalid basic header. No credentials provided."
msgstr "Nederīgs pieprasījuma sākums. Akreditācijas parametri nav nodrošināti."
#: authentication.py:76
msgid "Invalid basic header. Credentials string should not contain spaces."
msgstr "Nederīgs pieprasījuma sākums. Akreditācijas parametriem jābūt bez atstarpēm."
#: authentication.py:82
msgid "Invalid basic header. Credentials not correctly base64 encoded."
msgstr "Nederīgs pieprasījuma sākums. Akreditācijas parametri nav korekti base64 kodēti."
#: authentication.py:99
msgid "Invalid username/password."
msgstr "Nederīgs lietotājvārds/parole."
#: authentication.py:102 authentication.py:198
msgid "User inactive or deleted."
msgstr "Lietotājs neaktīvs vai dzēsts."
#: authentication.py:176
msgid "Invalid token header. No credentials provided."
msgstr "Nederīgs pilnvaras sākums. Akreditācijas parametri nav nodrošināti."
#: authentication.py:179
msgid "Invalid token header. Token string should not contain spaces."
msgstr "Nederīgs pilnvaras sākums. Pilnvaras parametros nevar būt tukšumi."
#: authentication.py:185
msgid ""
"Invalid token header. Token string should not contain invalid characters."
msgstr "Nederīgs pilnvaras sākums. Pilnvaras parametros nevar būt nederīgas zīmes."
#: authentication.py:195
msgid "Invalid token."
msgstr "Nederīga pilnavara."
#: authtoken/apps.py:7
msgid "Auth Token"
msgstr "Autorizācijas pilnvara"
#: authtoken/models.py:15
msgid "Key"
msgstr "Atslēga"
#: authtoken/models.py:18
msgid "User"
msgstr "Lietotājs"
#: authtoken/models.py:20
msgid "Created"
msgstr "Izveidots"
#: authtoken/models.py:29
msgid "Token"
msgstr "Pilnvara"
#: authtoken/models.py:30
msgid "Tokens"
msgstr "Pilnvaras"
#: authtoken/serializers.py:8
msgid "Username"
msgstr "Lietotājvārds"
#: authtoken/serializers.py:9
msgid "Password"
msgstr "Parole"
#: authtoken/serializers.py:20
msgid "User account is disabled."
msgstr "Lietotāja konts ir atslēgts."
#: authtoken/serializers.py:23
msgid "Unable to log in with provided credentials."
msgstr "Neiespējami pieteikties sistēmā ar nodrošinātajiem akreditācijas datiem."
#: authtoken/serializers.py:26
msgid "Must include \"username\" and \"password\"."
msgstr "Jābūt iekļautam \"username\" un \"password\"."
#: exceptions.py:49
msgid "A server error occurred."
msgstr "Notikusi servera kļūda."
#: exceptions.py:84
msgid "Malformed request."
msgstr "Nenoformēts pieprasījums."
#: exceptions.py:89
msgid "Incorrect authentication credentials."
msgstr "Nekorekti autentifikācijas parametri."
#: exceptions.py:94
msgid "Authentication credentials were not provided."
msgstr "Netika nodrošināti autorizācijas parametri."
#: exceptions.py:99
msgid "You do not have permission to perform this action."
msgstr "Tev nav tiesību veikt šo darbību."
#: exceptions.py:104 views.py:81
msgid "Not found."
msgstr "Nav atrasts."
#: exceptions.py:109
msgid "Method \"{method}\" not allowed."
msgstr "Metode \"{method}\" nav atļauta."
#: exceptions.py:120
msgid "Could not satisfy the request Accept header."
msgstr "Nevarēja apmierināt pieprasījuma Accept header."
#: exceptions.py:132
msgid "Unsupported media type \"{media_type}\" in request."
msgstr "Pieprasījumā neatbalstīts datu tips \"{media_type}\" ."
#: exceptions.py:145
msgid "Request was throttled."
msgstr "Pieprasījums tika apturēts."
#: fields.py:269 relations.py:206 relations.py:239 validators.py:98
#: validators.py:181
msgid "This field is required."
msgstr "Šis lauks ir obligāts."
#: fields.py:270
msgid "This field may not be null."
msgstr "Šis lauks nevar būt null."
#: fields.py:608 fields.py:639
msgid "\"{input}\" is not a valid boolean."
msgstr "\"{input}\" ir nederīga loģiskā vērtība."
#: fields.py:674
msgid "This field may not be blank."
msgstr "Šis lauks nevar būt tukšs."
#: fields.py:675 fields.py:1675
msgid "Ensure this field has no more than {max_length} characters."
msgstr "Pārliecinies, ka laukā nav vairāk par {max_length} zīmēm."
#: fields.py:676
msgid "Ensure this field has at least {min_length} characters."
msgstr "Pārliecinies, ka laukā ir vismaz {min_length} zīmes."
#: fields.py:713
msgid "Enter a valid email address."
msgstr "Ievadi derīgu e-pasta adresi."
#: fields.py:724
msgid "This value does not match the required pattern."
msgstr "Šī vērtība neatbilst prasītajam pierakstam."
#: fields.py:735
msgid ""
"Enter a valid \"slug\" consisting of letters, numbers, underscores or "
"hyphens."
msgstr "Ievadi derīgu \"slug\" vērtību, kura sastāv no burtiem, skaitļiem, apakš-svītras vai defises."
#: fields.py:747
msgid "Enter a valid URL."
msgstr "Ievadi derīgu URL."
#: fields.py:760
msgid "\"{value}\" is not a valid UUID."
msgstr "\"{value}\" ir nedrīgs UUID."
#: fields.py:796
msgid "Enter a valid IPv4 or IPv6 address."
msgstr "Ievadi derīgu IPv4 vai IPv6 adresi."
#: fields.py:821
msgid "A valid integer is required."
msgstr "Prasīta ir derīga skaitliska vērtība."
#: fields.py:822 fields.py:857 fields.py:891
msgid "Ensure this value is less than or equal to {max_value}."
msgstr "Pārliecinies, ka šī vērtība ir mazāka vai vienāda ar {max_value}."
#: fields.py:823 fields.py:858 fields.py:892
msgid "Ensure this value is greater than or equal to {min_value}."
msgstr "Pārliecinies, ka šī vērtība ir lielāka vai vienāda ar {min_value}."
#: fields.py:824 fields.py:859 fields.py:896
msgid "String value too large."
msgstr "Teksta vērtība pārāk liela."
#: fields.py:856 fields.py:890
msgid "A valid number is required."
msgstr "Derīgs skaitlis ir prasīts."
#: fields.py:893
msgid "Ensure that there are no more than {max_digits} digits in total."
msgstr "Pārliecinies, ka nav vairāk par {max_digits} zīmēm kopā."
#: fields.py:894
msgid ""
"Ensure that there are no more than {max_decimal_places} decimal places."
msgstr "Pārliecinies, ka nav vairāk par {max_decimal_places} decimālajām zīmēm."
#: fields.py:895
msgid ""
"Ensure that there are no more than {max_whole_digits} digits before the "
"decimal point."
msgstr "Pārliecinies, ka nav vairāk par {max_whole_digits} zīmēm pirms komata."
#: fields.py:1025
msgid "Datetime has wrong format. Use one of these formats instead: {format}."
msgstr "Datuma un laika formāts ir nepareizs. Lieto vienu no norādītajiem formātiem: \"{format}.\""
#: fields.py:1026
msgid "Expected a datetime but got a date."
msgstr "Tika gaidīts datums un laiks, saņemts datums.."
#: fields.py:1103
msgid "Date has wrong format. Use one of these formats instead: {format}."
msgstr "Datumam ir nepareizs formāts. Lieto vienu no norādītajiem formātiem: {format}."
#: fields.py:1104
msgid "Expected a date but got a datetime."
msgstr "Tika gaidīts datums, saņemts datums un laiks."
#: fields.py:1170
msgid "Time has wrong format. Use one of these formats instead: {format}."
msgstr "Laikam ir nepareizs formāts. Lieto vienu no norādītajiem formātiem: {format}."
#: fields.py:1232
msgid "Duration has wrong format. Use one of these formats instead: {format}."
msgstr "Ilgumam ir nepreizs formāts. Lieto vienu no norādītajiem formātiem: {format}."
#: fields.py:1251 fields.py:1300
msgid "\"{input}\" is not a valid choice."
msgstr "\"{input}\" ir nederīga izvēle."
#: fields.py:1254 relations.py:71 relations.py:441
msgid "More than {count} items..."
msgstr "Vairāk par {count} ierakstiem..."
#: fields.py:1301 fields.py:1448 relations.py:437 serializers.py:524
msgid "Expected a list of items but got type \"{input_type}\"."
msgstr "Tika gaidīts saraksts ar ierakstiem, bet tika saņemts \"{input_type}\" tips."
#: fields.py:1302
msgid "This selection may not be empty."
msgstr "Šī daļa nevar būt tukša."
#: fields.py:1339
msgid "\"{input}\" is not a valid path choice."
msgstr "\"{input}\" ir nederīga ceļa izvēle."
#: fields.py:1358
msgid "No file was submitted."
msgstr "Neviens fails netika pievienots."
#: fields.py:1359
msgid ""
"The submitted data was not a file. Check the encoding type on the form."
msgstr "Pievienotie dati nebija fails. Pārbaudi kodējuma tipu formā."
#: fields.py:1360
msgid "No filename could be determined."
msgstr "Faila nosaukums nevar tikt noteikts."
#: fields.py:1361
msgid "The submitted file is empty."
msgstr "Pievienotais fails ir tukšs."
#: fields.py:1362
msgid ""
"Ensure this filename has at most {max_length} characters (it has {length})."
msgstr "Pārliecinies, ka faila nosaukumā ir vismaz {max_length} zīmes (tajā ir {length})."
#: fields.py:1410
msgid ""
"Upload a valid image. The file you uploaded was either not an image or a "
"corrupted image."
msgstr "Augšupielādē derīgu attēlu. Pievienotā datne nebija attēls vai bojāts attēls."
#: fields.py:1449 relations.py:438 serializers.py:525
msgid "This list may not be empty."
msgstr "Šis saraksts nevar būt tukšs."
#: fields.py:1502
msgid "Expected a dictionary of items but got type \"{input_type}\"."
msgstr "Tika gaidīta vārdnīca ar ierakstiem, bet tika saņemts \"{input_type}\" tips."
#: fields.py:1549
msgid "Value must be valid JSON."
msgstr "Vērtībai ir jābūt derīgam JSON."
#: filters.py:36 templates/rest_framework/filters/django_filter.html:5
msgid "Submit"
msgstr "Iesniegt"
#: filters.py:336
msgid "ascending"
msgstr "augoši"
#: filters.py:337
msgid "descending"
msgstr "dilstoši"
#: pagination.py:193
msgid "Invalid page."
msgstr "Nederīga lapa."
#: pagination.py:427
msgid "Invalid cursor"
msgstr "Nederīgs kursors"
#: relations.py:207
msgid "Invalid pk \"{pk_value}\" - object does not exist."
msgstr "Nederīga pk \"{pk_value}\" - objekts neeksistē."
#: relations.py:208
msgid "Incorrect type. Expected pk value, received {data_type}."
msgstr "Nepareizs tips. Tika gaidīta pk vērtība, saņemts {data_type}."
#: relations.py:240
msgid "Invalid hyperlink - No URL match."
msgstr "Nederīga hipersaite - Nav URL sakritība."
#: relations.py:241
msgid "Invalid hyperlink - Incorrect URL match."
msgstr "Nederīga hipersaite - Nederīga URL sakritība."
#: relations.py:242
msgid "Invalid hyperlink - Object does not exist."
msgstr "Nederīga hipersaite - Objekts neeksistē."
#: relations.py:243
msgid "Incorrect type. Expected URL string, received {data_type}."
msgstr "Nepareizs tips. Tika gaidīts URL teksts, saņemts {data_type}."
#: relations.py:401
msgid "Object with {slug_name}={value} does not exist."
msgstr "Objekts ar {slug_name}={value} neeksistē."
#: relations.py:402
msgid "Invalid value."
msgstr "Nedrīga vērtība."
#: serializers.py:326
msgid "Invalid data. Expected a dictionary, but got {datatype}."
msgstr "Nederīgi dati. Tika gaidīta vārdnīca, saņemts {datatype}."
#: templates/rest_framework/admin.html:116
#: templates/rest_framework/base.html:128
msgid "Filters"
msgstr "Filtri"
#: templates/rest_framework/filters/django_filter.html:2
#: templates/rest_framework/filters/django_filter_crispyforms.html:4
msgid "Field filters"
msgstr "Lauka filtri"
#: templates/rest_framework/filters/ordering.html:3
msgid "Ordering"
msgstr "Kārtošana"
#: templates/rest_framework/filters/search.html:2
msgid "Search"
msgstr "Meklēt"
#: templates/rest_framework/horizontal/radio.html:2
#: templates/rest_framework/inline/radio.html:2
#: templates/rest_framework/vertical/radio.html:2
msgid "None"
msgstr "Nekas"
#: templates/rest_framework/horizontal/select_multiple.html:2
#: templates/rest_framework/inline/select_multiple.html:2
#: templates/rest_framework/vertical/select_multiple.html:2
msgid "No items to select."
msgstr "Nav ierakstu, ko izvēlēties."
#: validators.py:43
msgid "This field must be unique."
msgstr "Šim laukam ir jābūt unikālam."
#: validators.py:97
msgid "The fields {field_names} must make a unique set."
msgstr "Laukiem {field_names} jāveido unikālas kombinācijas."
#: validators.py:245
msgid "This field must be unique for the \"{date_field}\" date."
msgstr "Šim laukam ir jābūt unikālam priekš \"{date_field}\" datuma."
#: validators.py:260
msgid "This field must be unique for the \"{date_field}\" month."
msgstr "Šim laukam ir jābūt unikālam priekš \"{date_field}\" mēneša."
#: validators.py:273
msgid "This field must be unique for the \"{date_field}\" year."
msgstr "Šim laukam ir jābūt unikālam priekš \"{date_field}\" gada."
#: versioning.py:42
msgid "Invalid version in \"Accept\" header."
msgstr "Nederīga versija \"Accept\" galvenē."
#: versioning.py:73
msgid "Invalid version in URL path."
msgstr "Nederīga versija URL ceļā."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr "Nederīga versija URL ceļā. Nav atbilstības esošo versiju telpā."
#: versioning.py:147
msgid "Invalid version in hostname."
msgstr "Nederīga versija servera nosaukumā."
#: versioning.py:169
msgid "Invalid version in query parameter."
msgstr "Nederīga versija pieprasījuma parametros."
#: views.py:88
msgid "Permission denied."
msgstr "Pieeja liegta."

View File

@ -3,14 +3,14 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Filip Dimitrovski <filipdimitrovski22@gmail.com>, 2015
# Filip Dimitrovski <filipdimitrovski22@gmail.com>, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Filip Dimitrovski <filipdimitrovski22@gmail.com>\n"
"Language-Team: Macedonian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/mk/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -57,7 +57,7 @@ msgstr "Невалиден токен."
#: authtoken/apps.py:7
msgid "Auth Token"
msgstr ""
msgstr "Автентикациски токен"
#: authtoken/models.py:15
msgid "Key"
@ -65,7 +65,7 @@ msgstr ""
#: authtoken/models.py:18
msgid "User"
msgstr ""
msgstr "Корисник"
#: authtoken/models.py:20
msgid "Created"
@ -73,19 +73,19 @@ msgstr ""
#: authtoken/models.py:29
msgid "Token"
msgstr ""
msgstr "Токен"
#: authtoken/models.py:30
msgid "Tokens"
msgstr ""
msgstr "Токени"
#: authtoken/serializers.py:8
msgid "Username"
msgstr ""
msgstr "Корисничко име"
#: authtoken/serializers.py:9
msgid "Password"
msgstr ""
msgstr "Лозинка"
#: authtoken/serializers.py:20
msgid "User account is disabled."
@ -184,11 +184,11 @@ msgstr "Внесете валиден URL."
#: fields.py:760
msgid "\"{value}\" is not a valid UUID."
msgstr ""
msgstr "\"{value}\" не е валиден UUID."
#: fields.py:796
msgid "Enter a valid IPv4 or IPv6 address."
msgstr ""
msgstr "Внеси валидна IPv4 или IPv6 адреса."
#: fields.py:821
msgid "A valid integer is required."
@ -255,11 +255,11 @@ msgstr "„{input}“ не е валиден избор."
#: fields.py:1254 relations.py:71 relations.py:441
msgid "More than {count} items..."
msgstr ""
msgstr "Повеќе од {count} ставки..."
#: fields.py:1301 fields.py:1448 relations.py:437 serializers.py:524
msgid "Expected a list of items but got type \"{input_type}\"."
msgstr "Очекувана беше листа, а внесено беше „{input_type}“."
msgstr "Очекувана беше листа од ставки, а внесено беше „{input_type}“."
#: fields.py:1302
msgid "This selection may not be empty."
@ -299,35 +299,35 @@ msgstr "Качете (upload-ирајте) валидна слика. Фајло
#: fields.py:1449 relations.py:438 serializers.py:525
msgid "This list may not be empty."
msgstr ""
msgstr "Оваа листа не смее да биде празна."
#: fields.py:1502
msgid "Expected a dictionary of items but got type \"{input_type}\"."
msgstr ""
msgstr "Очекуван беше dictionary од ставки, a внесен беше тип \"{input_type}\"."
#: fields.py:1549
msgid "Value must be valid JSON."
msgstr ""
msgstr "Вредноста мора да биде валиден JSON."
#: filters.py:36 templates/rest_framework/filters/django_filter.html:5
msgid "Submit"
msgstr ""
msgstr "Испрати"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "растечки"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "опаѓачки"
#: pagination.py:193
msgid "Invalid page."
msgstr ""
msgstr "Невалидна вредност за страна."
#: pagination.py:427
msgid "Invalid cursor"
msgstr ""
msgstr "Невалиден покажувач (cursor)"
#: relations.py:207
msgid "Invalid pk \"{pk_value}\" - object does not exist."
@ -368,32 +368,32 @@ msgstr "Невалидни податоци. Очекуван беше dictionar
#: templates/rest_framework/admin.html:116
#: templates/rest_framework/base.html:128
msgid "Filters"
msgstr ""
msgstr "Филтри"
#: templates/rest_framework/filters/django_filter.html:2
#: templates/rest_framework/filters/django_filter_crispyforms.html:4
msgid "Field filters"
msgstr ""
msgstr "Филтри на полиња"
#: templates/rest_framework/filters/ordering.html:3
msgid "Ordering"
msgstr ""
msgstr "Подредување"
#: templates/rest_framework/filters/search.html:2
msgid "Search"
msgstr ""
msgstr "Пребарај"
#: templates/rest_framework/horizontal/radio.html:2
#: templates/rest_framework/inline/radio.html:2
#: templates/rest_framework/vertical/radio.html:2
msgid "None"
msgstr ""
msgstr "Ништо"
#: templates/rest_framework/horizontal/select_multiple.html:2
#: templates/rest_framework/inline/select_multiple.html:2
#: templates/rest_framework/vertical/select_multiple.html:2
msgid "No items to select."
msgstr ""
msgstr "Нема ставки за избирање."
#: validators.py:43
msgid "This field must be unique."
@ -425,7 +425,7 @@ msgstr "Невалидна верзија во URL патеката."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "Верзијата во URL патеката не е валидна. Не се согласува со ниеден version namespace (именски простор за верзии)."
#: versioning.py:147
msgid "Invalid version in hostname."
@ -437,4 +437,4 @@ msgstr "Невалидна верзија во query параметарот."
#: views.py:88
msgid "Permission denied."
msgstr ""
msgstr "Барањето не е дозволено."

View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Norwegian Bokmål (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/nb/)\n"
"MIME-Version: 1.0\n"

View File

@ -4,16 +4,17 @@
#
# Translators:
# Hans van Luttikhuizen <hansvanluttikhuizen@me.com>, 2016
# mikedingjan <mike@mikedingjan.nl>, 2015
# mikedingjan <mike@mikedingjan.nl>, 2015
# Mike Dingjan <mike@mikedingjan.nl>, 2015
# Mike Dingjan <mike@mikedingjan.nl>, 2017
# Mike Dingjan <mike@mikedingjan.nl>, 2015
# Hans van Luttikhuizen <hansvanluttikhuizen@me.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Mike Dingjan <mike@mikedingjan.nl>\n"
"Language-Team: Dutch (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -318,11 +319,11 @@ msgstr "Verzenden"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "oplopend"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "aflopend"
#: pagination.py:193
msgid "Invalid page."
@ -428,7 +429,7 @@ msgstr "Ongeldige versie in URL-pad."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "Ongeldige versie in het URL pad, komt niet overeen met een geldige versie namespace"
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -5,20 +5,21 @@
# Translators:
# Janusz Harkot <jh@blueice.pl>, 2015
# Piotr Jakimiak <legolass71@gmail.com>, 2015
# m_aciek <maciej.olko@gmail.com>, 2016
# m_aciek <maciej.olko@gmail.com>, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: m_aciek <maciej.olko@gmail.com>\n"
"Language-Team: Polish (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
#: authentication.py:73
msgid "Invalid basic header. No credentials provided."
@ -317,11 +318,11 @@ msgstr "Wyślij"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "rosnąco"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "malejąco"
#: pagination.py:193
msgid "Invalid page."
@ -427,7 +428,7 @@ msgstr "Błędna wersja w ścieżce URL."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "Niepoprawna wersja w ścieżce URL. Nie pasuje do przestrzeni nazw żadnej wersji."
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/pt_BR/)\n"
"MIME-Version: 1.0\n"

View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Romanian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/ro/)\n"
"MIME-Version: 1.0\n"

View File

@ -3,6 +3,7 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Grigory Mishchenko <grishkokot@gmail.com>, 2017
# Kirill Tarasenko, 2015
# koodjo <koodjo@mail.ru>, 2015
# Mike TUMS <mktums@gmail.com>, 2015
@ -12,8 +13,8 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Grigory Mishchenko <grishkokot@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -161,11 +162,11 @@ msgstr "Это поле не может быть пустым."
#: fields.py:675 fields.py:1675
msgid "Ensure this field has no more than {max_length} characters."
msgstr "Убедитесь что в этом поле не больше {max_length} символов."
msgstr "Убедитесь, что в этом поле не больше {max_length} символов."
#: fields.py:676
msgid "Ensure this field has at least {min_length} characters."
msgstr "Убедитесь что в этом поле как минимум {min_length} символов."
msgstr "Убедитесь, что в этом поле как минимум {min_length} символов."
#: fields.py:713
msgid "Enter a valid email address."
@ -199,11 +200,11 @@ msgstr "Требуется целочисленное значение."
#: fields.py:822 fields.py:857 fields.py:891
msgid "Ensure this value is less than or equal to {max_value}."
msgstr "Убедитесь что значение меньше или равно {max_value}."
msgstr "Убедитесь, что значение меньше или равно {max_value}."
#: fields.py:823 fields.py:858 fields.py:892
msgid "Ensure this value is greater than or equal to {min_value}."
msgstr "Убедитесь что значение больше или равно {min_value}."
msgstr "Убедитесь, что значение больше или равно {min_value}."
#: fields.py:824 fields.py:859 fields.py:896
msgid "String value too large."
@ -215,18 +216,18 @@ msgstr "Требуется численное значение."
#: fields.py:893
msgid "Ensure that there are no more than {max_digits} digits in total."
msgstr "Убедитесь что в числе не больше {max_digits} знаков."
msgstr "Убедитесь, что в числе не больше {max_digits} знаков."
#: fields.py:894
msgid ""
"Ensure that there are no more than {max_decimal_places} decimal places."
msgstr "Убедитесь что в числе не больше {max_decimal_places} знаков в дробной части."
msgstr "Убедитесь, что в числе не больше {max_decimal_places} знаков в дробной части."
#: fields.py:895
msgid ""
"Ensure that there are no more than {max_whole_digits} digits before the "
"decimal point."
msgstr "Убедитесь что в цисле не больше {max_whole_digits} знаков в целой части."
msgstr "Убедитесь, что в числе не больше {max_whole_digits} знаков в целой части."
#: fields.py:1025
msgid "Datetime has wrong format. Use one of these formats instead: {format}."
@ -292,7 +293,7 @@ msgstr "Загруженный файл пуст."
#: fields.py:1362
msgid ""
"Ensure this filename has at most {max_length} characters (it has {length})."
msgstr "Убедитесь что имя файла меньше {max_length} символов (сейчас {length})."
msgstr "Убедитесь, что имя файла меньше {max_length} символов (сейчас {length})."
#: fields.py:1410
msgid ""
@ -338,7 +339,7 @@ msgstr "Недопустимый первичный ключ \"{pk_value}\" - о
#: relations.py:208
msgid "Incorrect type. Expected pk value, received {data_type}."
msgstr "Некорректный тип. Ожилалось значение первичного ключа, получен {data_type}."
msgstr "Некорректный тип. Ожидалось значение первичного ключа, получен {data_type}."
#: relations.py:240
msgid "Invalid hyperlink - No URL match."

View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Slovak (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/sk/)\n"
"MIME-Version: 1.0\n"

Binary file not shown.

View File

@ -0,0 +1,440 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Gregor Cimerman, 2017
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Gregor Cimerman\n"
"Language-Team: Slovenian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
#: authentication.py:73
msgid "Invalid basic header. No credentials provided."
msgstr "Napačno enostavno zagalvje. Ni podanih poverilnic."
#: authentication.py:76
msgid "Invalid basic header. Credentials string should not contain spaces."
msgstr "Napačno enostavno zaglavje. Poverilniški niz ne sme vsebovati presledkov."
#: authentication.py:82
msgid "Invalid basic header. Credentials not correctly base64 encoded."
msgstr "Napačno enostavno zaglavje. Poverilnice niso pravilno base64 kodirane."
#: authentication.py:99
msgid "Invalid username/password."
msgstr "Napačno uporabniško ime ali geslo."
#: authentication.py:102 authentication.py:198
msgid "User inactive or deleted."
msgstr "Uporabnik neaktiven ali izbrisan."
#: authentication.py:176
msgid "Invalid token header. No credentials provided."
msgstr "Neveljaven žeton v zaglavju. Ni vsebovanih poverilnic."
#: authentication.py:179
msgid "Invalid token header. Token string should not contain spaces."
msgstr "Neveljaven žeton v zaglavju. Žeton ne sme vsebovati presledkov."
#: authentication.py:185
msgid ""
"Invalid token header. Token string should not contain invalid characters."
msgstr "Neveljaven žeton v zaglavju. Žeton ne sme vsebovati napačnih znakov."
#: authentication.py:195
msgid "Invalid token."
msgstr "Neveljaven žeton."
#: authtoken/apps.py:7
msgid "Auth Token"
msgstr "Prijavni žeton"
#: authtoken/models.py:15
msgid "Key"
msgstr "Ključ"
#: authtoken/models.py:18
msgid "User"
msgstr "Uporabnik"
#: authtoken/models.py:20
msgid "Created"
msgstr "Ustvarjen"
#: authtoken/models.py:29
msgid "Token"
msgstr "Žeton"
#: authtoken/models.py:30
msgid "Tokens"
msgstr "Žetoni"
#: authtoken/serializers.py:8
msgid "Username"
msgstr "Uporabniško ime"
#: authtoken/serializers.py:9
msgid "Password"
msgstr "Geslo"
#: authtoken/serializers.py:20
msgid "User account is disabled."
msgstr "Uporabniški račun je onemogočen."
#: authtoken/serializers.py:23
msgid "Unable to log in with provided credentials."
msgstr "Neuspešna prijava s podanimi poverilnicami."
#: authtoken/serializers.py:26
msgid "Must include \"username\" and \"password\"."
msgstr "Mora vsebovati \"uporabniško ime\" in \"geslo\"."
#: exceptions.py:49
msgid "A server error occurred."
msgstr "Napaka na strežniku."
#: exceptions.py:84
msgid "Malformed request."
msgstr "Okvarjen zahtevek."
#: exceptions.py:89
msgid "Incorrect authentication credentials."
msgstr "Napačni avtentikacijski podatki."
#: exceptions.py:94
msgid "Authentication credentials were not provided."
msgstr "Avtentikacijski podatki niso bili podani."
#: exceptions.py:99
msgid "You do not have permission to perform this action."
msgstr "Nimate dovoljenj za izvedbo te akcije."
#: exceptions.py:104 views.py:81
msgid "Not found."
msgstr "Ni najdeno"
#: exceptions.py:109
msgid "Method \"{method}\" not allowed."
msgstr "Metoda \"{method}\" ni dovoljena"
#: exceptions.py:120
msgid "Could not satisfy the request Accept header."
msgstr "Ni bilo mogoče zagotoviti zaglavja Accept zahtevka."
#: exceptions.py:132
msgid "Unsupported media type \"{media_type}\" in request."
msgstr "Nepodprt medijski tip \"{media_type}\" v zahtevku."
#: exceptions.py:145
msgid "Request was throttled."
msgstr "Zahtevek je bil pridržan."
#: fields.py:269 relations.py:206 relations.py:239 validators.py:98
#: validators.py:181
msgid "This field is required."
msgstr "To polje je obvezno."
#: fields.py:270
msgid "This field may not be null."
msgstr "To polje ne sme biti null."
#: fields.py:608 fields.py:639
msgid "\"{input}\" is not a valid boolean."
msgstr "\"{input}\" ni veljaven boolean."
#: fields.py:674
msgid "This field may not be blank."
msgstr "To polje ne sme biti prazno."
#: fields.py:675 fields.py:1675
msgid "Ensure this field has no more than {max_length} characters."
msgstr "To polje ne sme biti daljše od {max_length} znakov."
#: fields.py:676
msgid "Ensure this field has at least {min_length} characters."
msgstr "To polje mora vsebovati vsaj {min_length} znakov."
#: fields.py:713
msgid "Enter a valid email address."
msgstr "Vnesite veljaven elektronski naslov."
#: fields.py:724
msgid "This value does not match the required pattern."
msgstr "Ta vrednost ne ustreza zahtevanemu vzorcu."
#: fields.py:735
msgid ""
"Enter a valid \"slug\" consisting of letters, numbers, underscores or "
"hyphens."
msgstr "Vnesite veljaven \"slug\", ki vsebuje črke, številke, podčrtaje ali vezaje."
#: fields.py:747
msgid "Enter a valid URL."
msgstr "Vnesite veljaven URL."
#: fields.py:760
msgid "\"{value}\" is not a valid UUID."
msgstr "\"{value}\" ni veljaven UUID"
#: fields.py:796
msgid "Enter a valid IPv4 or IPv6 address."
msgstr "Vnesite veljaven IPv4 ali IPv6 naslov."
#: fields.py:821
msgid "A valid integer is required."
msgstr "Zahtevano je veljavno celo število."
#: fields.py:822 fields.py:857 fields.py:891
msgid "Ensure this value is less than or equal to {max_value}."
msgstr "Vrednost mora biti manjša ali enaka {max_value}."
#: fields.py:823 fields.py:858 fields.py:892
msgid "Ensure this value is greater than or equal to {min_value}."
msgstr "Vrednost mora biti večija ali enaka {min_value}."
#: fields.py:824 fields.py:859 fields.py:896
msgid "String value too large."
msgstr "Niz je prevelik."
#: fields.py:856 fields.py:890
msgid "A valid number is required."
msgstr "Zahtevano je veljavno število."
#: fields.py:893
msgid "Ensure that there are no more than {max_digits} digits in total."
msgstr "Vnesete lahko največ {max_digits} števk."
#: fields.py:894
msgid ""
"Ensure that there are no more than {max_decimal_places} decimal places."
msgstr "Vnesete lahko največ {max_decimal_places} decimalnih mest."
#: fields.py:895
msgid ""
"Ensure that there are no more than {max_whole_digits} digits before the "
"decimal point."
msgstr "Vnesete lahko največ {max_whole_digits} števk pred decimalno piko."
#: fields.py:1025
msgid "Datetime has wrong format. Use one of these formats instead: {format}."
msgstr "Datim in čas v napačnem formatu. Uporabite eno izmed naslednjih formatov: {format}."
#: fields.py:1026
msgid "Expected a datetime but got a date."
msgstr "Pričakovan datum in čas, prejet le datum."
#: fields.py:1103
msgid "Date has wrong format. Use one of these formats instead: {format}."
msgstr "Datum je v napačnem formatu. Uporabnite enega izmed naslednjih: {format}."
#: fields.py:1104
msgid "Expected a date but got a datetime."
msgstr "Pričakovan datum vendar prejet datum in čas."
#: fields.py:1170
msgid "Time has wrong format. Use one of these formats instead: {format}."
msgstr "Čas je v napačnem formatu. Uporabite enega izmed naslednjih: {format}."
#: fields.py:1232
msgid "Duration has wrong format. Use one of these formats instead: {format}."
msgstr "Trajanje je v napačnem formatu. Uporabite enega izmed naslednjih: {format}."
#: fields.py:1251 fields.py:1300
msgid "\"{input}\" is not a valid choice."
msgstr "\"{input}\" ni veljavna izbira."
#: fields.py:1254 relations.py:71 relations.py:441
msgid "More than {count} items..."
msgstr "Več kot {count} elementov..."
#: fields.py:1301 fields.py:1448 relations.py:437 serializers.py:524
msgid "Expected a list of items but got type \"{input_type}\"."
msgstr "Pričakovan seznam elementov vendar prejet tip \"{input_type}\"."
#: fields.py:1302
msgid "This selection may not be empty."
msgstr "Ta izbria ne sme ostati prazna."
#: fields.py:1339
msgid "\"{input}\" is not a valid path choice."
msgstr "\"{input}\" ni veljavna izbira poti."
#: fields.py:1358
msgid "No file was submitted."
msgstr "Datoteka ni bila oddana."
#: fields.py:1359
msgid ""
"The submitted data was not a file. Check the encoding type on the form."
msgstr "Oddani podatki niso datoteka. Preverite vrsto kodiranja na formi."
#: fields.py:1360
msgid "No filename could be determined."
msgstr "Imena datoteke ni bilo mogoče določiti."
#: fields.py:1361
msgid "The submitted file is empty."
msgstr "Oddana datoteka je prazna."
#: fields.py:1362
msgid ""
"Ensure this filename has at most {max_length} characters (it has {length})."
msgstr "Ime datoteke lahko vsebuje največ {max_length} znakov (ta jih ima {length})."
#: fields.py:1410
msgid ""
"Upload a valid image. The file you uploaded was either not an image or a "
"corrupted image."
msgstr "Naložite veljavno sliko. Naložena datoteka ni bila slika ali pa je okvarjena."
#: fields.py:1449 relations.py:438 serializers.py:525
msgid "This list may not be empty."
msgstr "Seznam ne sme biti prazen."
#: fields.py:1502
msgid "Expected a dictionary of items but got type \"{input_type}\"."
msgstr "Pričakovan je slovar elementov, prejet element je tipa \"{input_type}\"."
#: fields.py:1549
msgid "Value must be valid JSON."
msgstr "Vrednost mora biti veljaven JSON."
#: filters.py:36 templates/rest_framework/filters/django_filter.html:5
msgid "Submit"
msgstr "Potrdi"
#: filters.py:336
msgid "ascending"
msgstr "naraščujoče"
#: filters.py:337
msgid "descending"
msgstr "padajoče"
#: pagination.py:193
msgid "Invalid page."
msgstr "Neveljavna stran."
#: pagination.py:427
msgid "Invalid cursor"
msgstr "Neveljaven kazalec"
#: relations.py:207
msgid "Invalid pk \"{pk_value}\" - object does not exist."
msgstr "Neveljaven pk \"{pk_value}\" - objekt ne obstaja."
#: relations.py:208
msgid "Incorrect type. Expected pk value, received {data_type}."
msgstr "Neveljaven tip. Pričakovana vrednost pk, prejet {data_type}."
#: relations.py:240
msgid "Invalid hyperlink - No URL match."
msgstr "Neveljavna povezava - Ni URL."
#: relations.py:241
msgid "Invalid hyperlink - Incorrect URL match."
msgstr "Ni veljavna povezava - Napačen URL."
#: relations.py:242
msgid "Invalid hyperlink - Object does not exist."
msgstr "Ni veljavna povezava - Objekt ne obstaja."
#: relations.py:243
msgid "Incorrect type. Expected URL string, received {data_type}."
msgstr "Napačen tip. Pričakovan URL niz, prejet {data_type}."
#: relations.py:401
msgid "Object with {slug_name}={value} does not exist."
msgstr "Objekt z {slug_name}={value} ne obstaja."
#: relations.py:402
msgid "Invalid value."
msgstr "Neveljavna vrednost."
#: serializers.py:326
msgid "Invalid data. Expected a dictionary, but got {datatype}."
msgstr "Napačni podatki. Pričakovan slovar, prejet {datatype}."
#: templates/rest_framework/admin.html:116
#: templates/rest_framework/base.html:128
msgid "Filters"
msgstr "Filtri"
#: templates/rest_framework/filters/django_filter.html:2
#: templates/rest_framework/filters/django_filter_crispyforms.html:4
msgid "Field filters"
msgstr "Filter polj"
#: templates/rest_framework/filters/ordering.html:3
msgid "Ordering"
msgstr "Razvrščanje"
#: templates/rest_framework/filters/search.html:2
msgid "Search"
msgstr "Iskanje"
#: templates/rest_framework/horizontal/radio.html:2
#: templates/rest_framework/inline/radio.html:2
#: templates/rest_framework/vertical/radio.html:2
msgid "None"
msgstr "None"
#: templates/rest_framework/horizontal/select_multiple.html:2
#: templates/rest_framework/inline/select_multiple.html:2
#: templates/rest_framework/vertical/select_multiple.html:2
msgid "No items to select."
msgstr "Ni elementov za izbiro."
#: validators.py:43
msgid "This field must be unique."
msgstr "To polje mora biti unikatno."
#: validators.py:97
msgid "The fields {field_names} must make a unique set."
msgstr "Polja {field_names} morajo skupaj sestavljati unikaten niz."
#: validators.py:245
msgid "This field must be unique for the \"{date_field}\" date."
msgstr "Polje mora biti unikatno za \"{date_field}\" dan."
#: validators.py:260
msgid "This field must be unique for the \"{date_field}\" month."
msgstr "Polje mora biti unikatno za \"{date_field} mesec.\""
#: validators.py:273
msgid "This field must be unique for the \"{date_field}\" year."
msgstr "Polje mora biti unikatno za \"{date_field}\" leto."
#: versioning.py:42
msgid "Invalid version in \"Accept\" header."
msgstr "Neveljavna verzija v \"Accept\" zaglavju."
#: versioning.py:73
msgid "Invalid version in URL path."
msgstr "Neveljavna različca v poti URL."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr "Neveljavna različica v poti URL. Se ne ujema z nobeno različico imenskega prostora."
#: versioning.py:147
msgid "Invalid version in hostname."
msgstr "Neveljavna različica v imenu gostitelja."
#: versioning.py:169
msgid "Invalid version in query parameter."
msgstr "Neveljavna verzija v poizvedbenem parametru."
#: views.py:88
msgid "Permission denied."
msgstr "Dovoljenje zavrnjeno."

View File

@ -10,8 +10,8 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Joakim Soderlund\n"
"Language-Team: Swedish (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/sv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -316,11 +316,11 @@ msgstr "Skicka"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "stigande"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "fallande"
#: pagination.py:193
msgid "Invalid page."
@ -426,7 +426,7 @@ msgstr "Ogiltig version i URL-resursen."
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "Ogiltig version i URL-resursen. Matchar inget versions-namespace."
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -6,7 +6,7 @@
# Dogukan Tufekci <dogukan@creco.co>, 2015
# Emrah BİLBAY <emrahbilbay@gmail.com>, 2015
# Ertaç Paprat <epaprat@gmail.com>, 2015
# Yusuf (Josè) Luis <alagunajs@gmail.com>, 2016
# José Luis <alagunajs@gmail.com>, 2016
# Mesut Can Gürle <mesutcang@gmail.com>, 2015
# Murat Çorlu <muratcorlu@gmail.com>, 2015
# Recep KIRMIZI <rkirmizi@gmail.com>, 2015
@ -16,7 +16,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Turkish (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/tr/)\n"
"MIME-Version: 1.0\n"

View File

@ -3,13 +3,13 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Yusuf (Josè) Luis <alagunajs@gmail.com>, 2015-2016
# José Luis <alagunajs@gmail.com>, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"Language-Team: Turkish (Turkey) (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/tr_TR/)\n"
"MIME-Version: 1.0\n"

View File

@ -3,16 +3,17 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Denis Podlesniy <haos616@gmail.com>, 2016
# Денис Подлесный <haos616@gmail.com>, 2016
# Illarion <khlyestovillarion@gmail.com>, 2016
# Kirill Tarasenko, 2016
# Victor Mireyev <greymouse2005@ya.ru>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Victor Mireyev <greymouse2005@ya.ru>\n"
"Language-Team: Ukrainian (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/uk/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -317,11 +318,11 @@ msgstr "Відправити"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "в порядку зростання"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "у порядку зменшення"
#: pagination.py:193
msgid "Invalid page."

View File

@ -4,15 +4,15 @@
#
# Translators:
# hunter007 <wentao79@gmail.com>, 2015
# Lele Long <schemacs@gmail.com>, 2015
# Lele Long <schemacs@gmail.com>, 2015,2017
# Ming Chen <mockey.chen@gmail.com>, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: Lele Long <schemacs@gmail.com>\n"
"Language-Team: Chinese (China) (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -63,7 +63,7 @@ msgstr "认证令牌"
#: authtoken/models.py:15
msgid "Key"
msgstr ""
msgstr ""
#: authtoken/models.py:18
msgid "User"
@ -71,7 +71,7 @@ msgstr "用户"
#: authtoken/models.py:20
msgid "Created"
msgstr ""
msgstr "已创建"
#: authtoken/models.py:29
msgid "Token"
@ -317,15 +317,15 @@ msgstr "保存"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "升序"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "降序"
#: pagination.py:193
msgid "Invalid page."
msgstr ""
msgstr "无效页。"
#: pagination.py:427
msgid "Invalid cursor"
@ -427,7 +427,7 @@ msgstr "URL路径包含无效版本。"
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "URL路径中存在无效版本。版本空间中无法匹配上。"
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -6,13 +6,14 @@
# cokky <cokkywu@gmail.com>, 2015
# hunter007 <wentao79@gmail.com>, 2015
# nypisces <loliandny@icloud.com>, 2015
# ppppfly <mpang@gizwits.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"Last-Translator: Thomas Christie <tom@tomchristie.com>\n"
"PO-Revision-Date: 2017-08-03 14:58+0000\n"
"Last-Translator: ppppfly <mpang@gizwits.com>\n"
"Language-Team: Chinese Simplified (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/zh-Hans/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -59,35 +60,35 @@ msgstr "认证令牌无效。"
#: authtoken/apps.py:7
msgid "Auth Token"
msgstr ""
msgstr "认证令牌"
#: authtoken/models.py:15
msgid "Key"
msgstr ""
msgstr ""
#: authtoken/models.py:18
msgid "User"
msgstr ""
msgstr "用户"
#: authtoken/models.py:20
msgid "Created"
msgstr ""
msgstr "已创建"
#: authtoken/models.py:29
msgid "Token"
msgstr ""
msgstr "令牌"
#: authtoken/models.py:30
msgid "Tokens"
msgstr ""
msgstr "令牌"
#: authtoken/serializers.py:8
msgid "Username"
msgstr ""
msgstr "用户名"
#: authtoken/serializers.py:9
msgid "Password"
msgstr ""
msgstr "密码"
#: authtoken/serializers.py:20
msgid "User account is disabled."
@ -317,15 +318,15 @@ msgstr "提交"
#: filters.py:336
msgid "ascending"
msgstr ""
msgstr "正排序"
#: filters.py:337
msgid "descending"
msgstr ""
msgstr "倒排序"
#: pagination.py:193
msgid "Invalid page."
msgstr ""
msgstr "无效页面。"
#: pagination.py:427
msgid "Invalid cursor"
@ -427,7 +428,7 @@ msgstr "URL路径包含无效版本。"
#: versioning.py:115
msgid "Invalid version in URL path. Does not match any version namespace."
msgstr ""
msgstr "在URL路径中发现无效的版本。无法匹配任何的版本命名空间。"
#: versioning.py:147
msgid "Invalid version in hostname."

View File

@ -473,7 +473,7 @@ class CursorPagination(BasePagination):
"""
The cursor pagination implementation is necessarily complex.
For an overview of the position/offset style we use, see this post:
http://cramer.io/2011/03/08/building-cursors-for-the-disqus-api
http://cra.mr/2011/03/08/building-cursors-for-the-disqus-api
"""
cursor_query_param = 'cursor'
cursor_query_description = _('The pagination cursor value.')
@ -482,6 +482,15 @@ class CursorPagination(BasePagination):
ordering = '-created'
template = 'rest_framework/pagination/previous_and_next.html'
# Client can control the page size using this query parameter.
# Default is 'None'. Set to eg 'page_size' to enable usage.
page_size_query_param = None
page_size_query_description = _('Number of results to return per page.')
# Set to an integer to limit the maximum page size the client may request.
# Only relevant if 'page_size_query_param' has also been set.
max_page_size = None
# The offset in the cursor is used in situations where we have a
# nearly-unique index. (Eg millisecond precision creation timestamps)
# We guard against malicious users attempting to cause expensive database
@ -566,6 +575,16 @@ class CursorPagination(BasePagination):
return self.page
def get_page_size(self, request):
if self.page_size_query_param:
try:
return _positive_int(
request.query_params[self.page_size_query_param],
strict=True,
cutoff=self.max_page_size
)
except (KeyError, ValueError):
pass
return self.page_size
def get_next_link(self):
@ -779,7 +798,7 @@ class CursorPagination(BasePagination):
def get_schema_fields(self, view):
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
return [
fields = [
coreapi.Field(
name=self.cursor_query_param,
required=False,
@ -790,3 +809,16 @@ class CursorPagination(BasePagination):
)
)
]
if self.page_size_query_param is not None:
fields.append(
coreapi.Field(
name=self.page_size_query_param,
required=False,
location='query',
schema=coreschema.Integer(
title='Page size',
description=force_text(self.page_size_query_description)
)
)
)
return fields

Some files were not shown because too many files have changed in this diff Show More