Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling public method in the contrusctor breaks django ergonomics #54

Open
gbip opened this issue Nov 4, 2024 · 0 comments
Open

Calling public method in the contrusctor breaks django ergonomics #54

gbip opened this issue Nov 4, 2024 · 0 comments

Comments

@gbip
Copy link

gbip commented Nov 4, 2024

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 ?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant