-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
When trying to extend FeatureLayerResource:
from restle.actions import Action
from restle.fields import TextField
from restle.resources import Resource
class ParentResource(Resource):
text_field = TextField()
query_field = Action(...)
class ChildResourceOne(ParentResource):
pass # text_field present, query_field unavailable
class ChildResourceTwo(ParentResource):
# Class definition fails because query_field is removed
query_field = ParentResource.query_fieldThere is no way to inherit query_field in the usual manner of Python class inheritance.
Current workaround: put Action(...) into a constant that can be referenced in both the parent and the child classes:
from restle.actions import Action
from restle.fields import TextField
from restle.resources import Resource
QUERY_ACTION = Action(...)
class ParentResource(Resource):
text_field = TextField()
query_field = QUERY_ACTION
class ChildResourceOne(ParentResource):
query_field = QUERY_ACTIONMetadata
Metadata
Assignees
Labels
No labels