mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 09:57:55 +03:00 
			
		
		
		
	Merge pull request #1219 from sepeth/fix-documentation-typo
Typo on api-guide/fields.md and serializers.py
This commit is contained in:
		
						commit
						b65b43c732
					
				| 
						 | 
				
			
			@ -299,9 +299,9 @@ Django's regular [FILE_UPLOAD_HANDLERS] are used for handling uploaded files.
 | 
			
		|||
 | 
			
		||||
# Custom fields
 | 
			
		||||
 | 
			
		||||
If you want to create a custom field, you'll probably want to override either one or both of the `.to_native()` and `.from_native()` methods.  These two methods are used to convert between the initial datatype, and a primative, serializable datatype.  Primative datatypes may be any of a number, string, date/time/datetime or None.  They may also be any list or dictionary like object that only contains other primative objects.
 | 
			
		||||
If you want to create a custom field, you'll probably want to override either one or both of the `.to_native()` and `.from_native()` methods.  These two methods are used to convert between the initial datatype, and a primitive, serializable datatype.  Primitive datatypes may be any of a number, string, date/time/datetime or None.  They may also be any list or dictionary like object that only contains other primitive objects.
 | 
			
		||||
 | 
			
		||||
The `.to_native()` method is called to convert the initial datatype into a primative, serializable datatype.  The `from_native()` method is called to restore a primative datatype into it's initial representation.
 | 
			
		||||
The `.to_native()` method is called to convert the initial datatype into a primitive, serializable datatype.  The `from_native()` method is called to restore a primitive datatype into it's initial representation.
 | 
			
		||||
 | 
			
		||||
## Examples
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,8 +6,8 @@ form encoded input.
 | 
			
		|||
Serialization in REST framework is a two-phase process:
 | 
			
		||||
 | 
			
		||||
1. Serializers marshal between complex types like model instances, and
 | 
			
		||||
python primatives.
 | 
			
		||||
2. The process of marshalling between python primatives and request and
 | 
			
		||||
python primitives.
 | 
			
		||||
2. The process of marshalling between python primitives and request and
 | 
			
		||||
response content is handled by parsers and renderers.
 | 
			
		||||
"""
 | 
			
		||||
from __future__ import unicode_literals
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user