wlanslovenija / django-tastypie-mongoengine

MongoEngine support for django-tastypie.
Other
73 stars 59 forks source link

Filter support for polymorphic resources. #59

Closed ecgunendar closed 11 years ago

ecgunendar commented 11 years ago

This is filter support for Polymorphic resource. Following is the example when this fix works. need support for oid and type filtering for below example. Eg :: class aResource(MongoEngineResource): ...... class bResource(MongoEngineResource): .......

class cResource(MongoEngineResource):
  class Meta:
    object_class = c
    polymorphic = {
        'c' : 'self',
        'a' : aResource,
        'b' : bResource,
    }
    filtering = {
         'oid' : ALL,
         'type' : ALL,
         'status' : ALL_WITH_RELATIONS,
    }

class dResource(MongoEngineResource):
  class Meta:
    queryset = d
  polyresouce = tastypie_mongoengine.fields.EmbeddedListField(of='cResourcee', attribute='polyresource', full=True, null=True)
ecgunendar commented 11 years ago

Removing due to test failures.