I don't think there is any reason to monkey patch a view when you can just override it in your urls.py by putting the urlpattern you want to override above the cartridge urls. You can see an example of how I override the product view in cartridge-downloads: https://github.com/ryneeverett/cartridge-downloads#urlspy.
On Tue, Jun 14, 2016 at 8:11 PM, Tran <[email protected]> wrote: > I am trying to monkey patch the def product() in cartridge.shop.views by > recreating the function in another app, but it doesn't work. > > in my app_name/page_processor.py, I did > > import cartridge > > def modified_product(): > ....stuff... > > cartridge.shop.views.product = modified_product > > Do you think I did the right way? I am not sure if I imported cartridge > correctly or the shop.views doesn't allow monkey patch > > -- > You received this message because you are subscribed to the Google Groups > "Mezzanine Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
