wow, that's pretty obvious once you spell it out, isn't it? ;) thanks!
On Oct 31, 3:19 pm, Bob Waycott <[email protected]> wrote: > Our current store has a setup like this: > > from satchmo_store.urls import urlpatterns as satchmopatterns > > urlpatterns = patterns('', > # custom patterns we use here > ) > > urlpatterns += satchmopatterns > > To me this seems rather straightforward. > > Satchmo also provides a couple helper function for unsetting/setting url > patterns to point to custom views that have been documented elsewhere in the > mailing lists & are easily found in the source code. > > > > On Fri, Oct 30, 2009 at 7:35 PM, philosophe <[email protected]> wrote: > > > Thanks, Bob, > > > I was able to override the core detail view for custom order products, > > but I had to cobble together a silly hack to get my url pattern above > > the core patterns: > > > my_patterns = patterns('', > > (r'^shop/product/(?P<product_slug>[-\w]+)/$', > > 'my_app.storefront.views.get_my_product', {}, 'satchmo_product'), > > ) > > > temp_urlpatterns = urlpatterns > > urlpatterns = my_patterns > > urlpatterns += temp_urlpatterns > > > >>>is there a better way of doing this? > > > To document the overriding view solution: > > 1. copy the get_product() view to the local views.py and change its > > name (for example, get_my_product()) > > > 2. copy over the import statements from the core to the local > > > 3. copy the following line to the local after the imports: > > NOTSET = object() > > > 4. change this line: > > template = find_product_template(product, > > producttypes=subtype_names) > > > to this (the single item list points to the local template): > > template = select_template(["product/detail_customproduct.html"]) > > > 5. get the urlpattern to point to get_my_product() in some better way > > than that shown above ;) > > > thanks, > > --derek --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en -~----------~----~----~----~------~----~------~--~---
