Reputation: 705
Let's take an example of two apps:
So IceCream was developed first, and all the views are Stock are created using the generic Class-Based Views - SListView, SCreateView,SDetailView, SUpdateView and SDeleteView. And the URL mapping are as follows:
And later StockBalance is being developed. Without touching the code from the Stock app, how can I change the behavior of the each view? And what is the common method in Django to do that?
What I want to archieve is that:
Upvotes: 0
Views: 21
Reputation: 122436
You can insert the URL mappings of StockBalance in front of those of Stock. This ensures those URLs will be found first by Django and thus you can fully reimplement (inherit / override / etc) what those views will do.
So:
Upvotes: 1