Skip to content

Resource Meta classes don't support inheritance #1

@dharvey-consbio

Description

@dharvey-consbio

It's because the Meta classes are processed at class-definition time, and removed afterwards. By the time an inheriting class definition is processed, the Meta class has been removed from the parent.

For example, the following results in this error:

AttributeError: type object 'BaseResource' has no attribute 'Meta'

from restle.resources import Resource

class BaseResource(Resource):
    class Meta:
        case_sensitive_fields = False
        match_fuzzy_keys = True

class ArcGISResource(BaseResource):
    class Meta(BaseResource.Meta):
        get_parameters = {"f": "json"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions