Skip to content

Calling public method in the contrusctor breaks django ergonomics #54

@gbip

Description

@gbip

BaseTileJsonVivew.__init__() calls get_min_zoom, get_max_zoom, etc. which in turns calls BaseVectorView.get_layers and BaseVectorView.get_layer_class_kwargs.

If you were to override BaseVectorView.get_layer_class_kwargs with an implementation that depends on Django ergonomics (self.request, self.args, self.kwargs, etc.), you would be called by BaseTileJsonVivew.__init__ outside of the View.dispatch which breaks your code and causes a crash.

A solution would be to remove your sanity checks from BaseTileJsonVivew.__init__() (maybe make a Django check like the admin does for list_display ?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions