aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/relations.py
diff options
context:
space:
mode:
authorCraig Blaszczyk2015-01-07 12:01:11 +0000
committerCraig Blaszczyk2015-01-07 12:01:11 +0000
commit4c32083b8b59a50877633910055313dad7bb117e (patch)
tree4de7729161f512c7c14beaafc4a6f776ce772cc1 /rest_framework/relations.py
parentfe5d93c8cbc5f3a9b1b6715208c70f485be68bdf (diff)
downloaddjango-rest-framework-4c32083b8b59a50877633910055313dad7bb117e.tar.bz2
use double quotes for user visible strings; end user visible strings in full stops; add some missing translation tags
Diffstat (limited to 'rest_framework/relations.py')
-rw-r--r--rest_framework/relations.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/rest_framework/relations.py b/rest_framework/relations.py
index 7b119291..3737b21f 100644
--- a/rest_framework/relations.py
+++ b/rest_framework/relations.py
@@ -128,9 +128,9 @@ class StringRelatedField(RelatedField):
class PrimaryKeyRelatedField(RelatedField):
default_error_messages = {
- 'required': _('This field is required.'),
+ 'required': _("This field is required."),
'does_not_exist': _("Invalid pk '{pk_value}' - object does not exist."),
- 'incorrect_type': _('Incorrect type. Expected pk value, received {data_type}.'),
+ 'incorrect_type': _("Incorrect type. Expected pk value, received {data_type}."),
}
def use_pk_only_optimization(self):
@@ -152,11 +152,11 @@ class HyperlinkedRelatedField(RelatedField):
lookup_field = 'pk'
default_error_messages = {
- 'required': _('This field is required.'),
- 'no_match': _('Invalid hyperlink - No URL match'),
- 'incorrect_match': _('Invalid hyperlink - Incorrect URL match.'),
- 'does_not_exist': _('Invalid hyperlink - Object does not exist.'),
- 'incorrect_type': _('Incorrect type. Expected URL string, received {data_type}.'),
+ 'required': _("This field is required."),
+ 'no_match': _("Invalid hyperlink - No URL match."),
+ 'incorrect_match': _("Invalid hyperlink - Incorrect URL match."),
+ 'does_not_exist': _("Invalid hyperlink - Object does not exist."),
+ 'incorrect_type': _("Incorrect type. Expected URL string, received {data_type}."),
}
def __init__(self, view_name=None, **kwargs):
@@ -292,7 +292,7 @@ class SlugRelatedField(RelatedField):
default_error_messages = {
'does_not_exist': _("Object with {slug_name}={value} does not exist."),
- 'invalid': _('Invalid value.'),
+ 'invalid': _("Invalid value."),
}
def __init__(self, slug_field=None, **kwargs):