I just checked it in. Thanks! On Sat, Sep 26, 2009 at 1:23 PM, Alex Robbins <[email protected] > wrote:
> Sorry for the lack of context, bookmarklets are awesome, but almost totally > undocumented. (Searching the django docs for bookmarklets doesn't show > anything) > > Ticket made at > http://bitbucket.org/chris1610/satchmo/issue/907/xheaders-in-product-view-for-admin > > I'd really like to see this make it in because I have a client that would > really benefit from it, and I don't want to maintain a fork of satchmo. Let > me know how I can help it along. > > Alex > > > On Fri, Sep 25, 2009 at 1:00 PM, Chris Moffitt <[email protected]> wrote: > >> Interesting. I think the quick reason why we don't have this is that I/we >> didn't know about it :) >> >> After reading this - >> http://www.b-list.org/weblog/2007/nov/07/bookmarklets/ I understand it a >> bit more now so it sounds like a reasonable request and a good idea. >> >> If you wouldn't mind adding a ticket, we'll take a look at it. >> >> -Chris >> >> >> On Fri, Sep 25, 2009 at 12:30 PM, Alex Robbins < >> [email protected]> wrote: >> >>> Hey guys, >>> >>> I was wondering why we don't set up xheaders for the product detail page? >>> That way an admin can edit a product using the excellent admin bookmarklets. >>> >>> Here is a diff of what it would take, not bad at all: >>> diff -r 2f33cb3855de satchmo/apps/product/views/__init__.py >>> --- a/satchmo/apps/product/views/__init__.py Sun Aug 23 20:36:28 2009 >>> -0500 >>> +++ b/satchmo/apps/product/views/__init__.py Fri Sep 25 12:27:11 2009 >>> -0500 >>> @@ -1,5 +1,6 @@ >>> from decimal import Decimal >>> from django import http >>> +from django.core.xheaders import populate_xheaders >>> from django.shortcuts import get_object_or_404, render_to_response >>> from django.template import RequestContext >>> from django.template.loader import select_template >>> @@ -146,7 +147,9 @@ >>> >>> template = find_product_template(product, >>> producttypes=subtype_names) >>> context = RequestContext(request, extra_context) >>> - return http.HttpResponse(template.render(context)) >>> + response = http.HttpResponse(template.render(context)) >>> + populate_xheaders(request, response, Product, product.id) >>> + return response >>> >>> >>> def get_price(request, product_slug): >>> >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
