diff options
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/compat.py | 2 | ||||
| -rw-r--r-- | rest_framework/fields.py | 12 | ||||
| -rw-r--r-- | rest_framework/filters.py | 2 | ||||
| -rw-r--r-- | rest_framework/mixins.py | 2 | ||||
| -rw-r--r-- | rest_framework/relations.py | 4 | ||||
| -rw-r--r-- | rest_framework/validators.py | 2 | ||||
| -rw-r--r-- | rest_framework/views.py | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 3993cee6..e4e69580 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -131,7 +131,7 @@ else: self.message = kwargs.pop('message', self.message) super(MaxValueValidator, self).__init__(*args, **kwargs) -# URLValidator only accept `message` in 1.6+ +# URLValidator only accepts `message` in 1.6+ if django.VERSION >= (1, 6): from django.core.validators import URLValidator else: diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 3f22660c..0963d4bf 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -186,14 +186,14 @@ class Field(object): def get_initial(self): """ - Return a value to use when the field is being returned as a primative + Return a value to use when the field is being returned as a primitive value, without any object instance. """ return self.initial def get_value(self, dictionary): """ - Given the *incoming* primative data, return the value for this field + Given the *incoming* primitive data, return the value for this field that should be validated and transformed to a native value. """ if html.is_html_input(dictionary): @@ -205,7 +205,7 @@ class Field(object): def get_field_representation(self, instance): """ - Given the outgoing object instance, return the primative value + Given the outgoing object instance, return the primitive value that should be used for this field. """ attribute = get_attribute(instance, self.source_attrs) @@ -274,13 +274,13 @@ class Field(object): def to_internal_value(self, data): """ - Transform the *incoming* primative data into a native value. + Transform the *incoming* primitive data into a native value. """ raise NotImplementedError('to_internal_value() must be implemented.') def to_representation(self, value): """ - Transform the *outgoing* native value into primative data. + Transform the *outgoing* native value into primitive data. """ raise NotImplementedError('to_representation() must be implemented.') @@ -927,7 +927,7 @@ class ImageField(FileField): def to_internal_value(self, data): # Image validation is a bit grungy, so we'll just outright # defer to Django's implementation so we don't need to - # consider it, or treat PIL as a test dependancy. + # consider it, or treat PIL as a test dependency. file_object = super(ImageField, self).to_internal_value(data) django_field = self._DjangoImageField() django_field.error_messages = self.error_messages diff --git a/rest_framework/filters.py b/rest_framework/filters.py index 4c485668..d188a2d1 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -148,7 +148,7 @@ class OrderingFilter(BaseFilterBackend): if not getattr(field, 'write_only', False) ] elif valid_fields == '__all__': - # View explictly allows filtering on any model field + # View explicitly allows filtering on any model field valid_fields = [field.name for field in queryset.model._meta.fields] valid_fields += queryset.query.aggregates.keys() diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index 04b7a763..de334b4b 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -83,7 +83,7 @@ class DestroyModelMixin(object): # The AllowPUTAsCreateMixin was previously the default behaviour -# for PUT requests. This has now been removed and must be *explictly* +# for PUT requests. This has now been removed and must be *explicitly* # included if it is the behavior that you want. # For more info see: ... diff --git a/rest_framework/relations.py b/rest_framework/relations.py index 4f971917..f8cd735d 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -100,9 +100,9 @@ class HyperlinkedRelatedField(RelatedField): self.lookup_url_kwarg = kwargs.pop('lookup_url_kwarg', self.lookup_field) self.format = kwargs.pop('format', None) - # We include these simply for dependancy injection in tests. + # We include these simply for dependency injection in tests. # We can't add them as class attributes or they would expect an - # implict `self` argument to be passed. + # implicit `self` argument to be passed. self.reverse = reverse self.resolve = resolve diff --git a/rest_framework/validators.py b/rest_framework/validators.py index 20de4b42..5bb69ad8 100644 --- a/rest_framework/validators.py +++ b/rest_framework/validators.py @@ -2,7 +2,7 @@ We perform uniqueness checks explicitly on the serializer class, rather the using Django's `.full_clean()`. -This gives us better seperation of concerns, allows us to use single-step +This gives us better separation of concerns, allows us to use single-step object creation, and makes it possible to switch between using the implicit `ModelSerializer` class and an equivelent explicit `Serializer` class. """ diff --git a/rest_framework/views.py b/rest_framework/views.py index 835e223a..979229eb 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -100,7 +100,7 @@ class APIView(View): content_negotiation_class = api_settings.DEFAULT_CONTENT_NEGOTIATION_CLASS metadata_class = api_settings.DEFAULT_METADATA_CLASS - # Allow dependancy injection of other settings to make testing easier. + # Allow dependency injection of other settings to make testing easier. settings = api_settings @classmethod |
