Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 147 by [email protected]: sitemap.xml support
http://code.google.com/p/django-hotclub/issues/detail?id=147

Here are some diffs to add support for sitemap.xml generation.  I had
to hand massage the diffs since they were based on my custom project,
not complete_project, and my custom project has stuff you don't really
want.  I might have made some typos in the diffs, but I think any errors
should be easy to clear up.

In a couple places I had to relax @login_required restrictions.  It
doesn't make sense to advertise a page in the sitemap if an anonymous
web crawler can't get to the page.  (If anyone knows how to properly
authenticate AdSense to login to a pinax site I'd love to hear it.
I haven't been able to manage it.)

For the most part in the pinax apps, the authenticated login check is
done in the template.  If you're an anonymous user, it just hides some
of the create/edit/delete links.  Some pages put the checks in views.py
and completely disable viewing the page if you aren't logged in.  Unless
the data truly needs to be secure (in which case you don't want to list
it in the sitemap), I think the first approach is better.

Due to a recent change in the vendor branch, I wasn't able to cleanly
isolate a change I had to make in photos/views.py.  I haven't analyzed
it yet, but the recent change might allow for unathenticated users to
view the public images (which is what we want for sitemap purposes).
I did something like:
     if request.user.is_authenticated():
         other_user = get_object_or_404(User,
username=request.user.username)
         tribes = Tribe.objects.filter(members=request.user)
         projects = Project.objects.filter(members__user=request.user)
     else:
         other_user = None
         tribes = None
         projects = None

I think that's the only change that isn't in the patch, but I'm not
100% certain.  I haven't sitemap'd all the apps, so some additional
work is required anyway.

mike

Attachments:
        sitemap.diff  12.8 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" 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/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to