mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 01:47:59 +03:00 
			
		
		
		
	Merge pull request #4895 from felixxm/reverted-4852
Reverted "Removed multi-table inheritance auto created PK from serialize".
This commit is contained in:
		
						commit
						20e3717ae4
					
				| 
						 | 
					@ -76,12 +76,7 @@ def _get_forward_relationships(opts):
 | 
				
			||||||
    Returns an `OrderedDict` of field names to `RelationInfo`.
 | 
					    Returns an `OrderedDict` of field names to `RelationInfo`.
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    forward_relations = OrderedDict()
 | 
					    forward_relations = OrderedDict()
 | 
				
			||||||
    for field in [
 | 
					    for field in [field for field in opts.fields if field.serialize and get_remote_field(field)]:
 | 
				
			||||||
        field for field in opts.fields
 | 
					 | 
				
			||||||
        if field.serialize and get_remote_field(field) and not (field.primary_key and field.one_to_one)
 | 
					 | 
				
			||||||
        # If the field is a OneToOneField and it's been marked as PK, then this
 | 
					 | 
				
			||||||
        # is a multi-table inheritance auto created PK ('%_ptr').
 | 
					 | 
				
			||||||
    ]:
 | 
					 | 
				
			||||||
        forward_relations[field.name] = RelationInfo(
 | 
					        forward_relations[field.name] = RelationInfo(
 | 
				
			||||||
            model_field=field,
 | 
					            model_field=field,
 | 
				
			||||||
            related_model=get_related_model(field),
 | 
					            related_model=get_related_model(field),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user