9 lines
311 B
Python
9 lines
311 B
Python
from django.db import models
|
|
from django.contrib.contenttypes.models import ContentType
|
|
|
|
|
|
class SourceTransformationManager(models.Manager):
|
|
def get_for_object(self, obj):
|
|
ct = ContentType.objects.get_for_model(obj)
|
|
return self.model.objects.filter(content_type=ct).filter(object_id=obj.pk)
|