2007/6/16, John DeRosa <[EMAIL PROTECTED]>:
>
> David Larlet wrote:
> >
> > Any thoughts about this implementation?
>
> I think you could get rid of FakeObject() completely:
>
> class MainSitemap(Sitemap):
>      priority = 0.8
>
>      def items(self):
>          return ["/", "/archives/", "/foo/bar/", ...]
>
>      def location(self, obj):
>          return obj
>
>
> OTOH, if your code works now, you could also leave it alone. :-)  And
> FakeObject could be a convenient central container for calculating
> information that the other methods need, if your site grows in complexity.
>

You're absolutely right, thanks for your comment and suggestion which
works perfectly too! Maybe this usage need to be documented? It
doesn't seemed evident for me at first sight and someone just ask the
same think on IRC yesterday.

David

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to