def dehydrate_relationship(self, model, relationship_name, relationship_prefix=None):

		full_relationship_name = '__'.join([relationship_prefix, relationship_name]) if relationship_prefix else relationship_name

		related_object = getattr(model, relationship_name)
		relationship_data = self.relationships[full_relationship_name]

		dehydrate_params = {
			'fields': relationship_data.get('fields'),
			'exclude': relationship_data.get('exclude'),
			'relationship_prefix': full_relationship_name,
		}

		#this is a to-many relationship
		if related_object.__class__.__name__ in ('RelatedManager', 'ManyRelatedManager'):
			return [self.dehydrate(related_model, **dehydrate_params) for related_model in related_object.all()]

		#this is a to-one relationship
		return self.dehydrate(related_object, **dehydrate_params)
Initialize self.stmt_h, which is the handle of a statement
dataset/ETHPy150Open jarcoal/django-sliver/sliver/views.py/Resource.dehydrate_relationship--crossover with--dataset/ETHPy150Open harryliu/edwin/edwinServer/site_packages/pypyodbc.py/Cursor.__init__