Re: CBV contrib.sitemaps
On Tuesday, December 15, 2015 at 6:35:06 PM UTC-5, Shai Berger wrote: > > Hi Carl, > > On Tuesday 15 December 2015 18:17:36 Carl Johnson wrote: > > I was adding a sitemap to a project, and I more or less had to rewrite > the > > views from scratch because sitemap expects to receive a dictionary of > all > > possible pages at start up time, [...] > > This seems to be a misrepresentation; it takes a dictionary of all site > sections, but each section may well change. E.g. the documentation[1] > mentions > a BlogSitemap class -- but surely, new blog posts may be added without > requiring system restart to update the site map... > Right, but if you want to add a new section, that would require it to be baked in. My issue was I was skirting the 50,000 page per sitemap limit, so I needed to break my site map up, and the logical way to do that was to add one section for each show on our site, but the number of shows can change dynamically. > > > > So my question is this, if I created a class-based version of sitemaps > > (django.contrib.sitemaps_cbv or whatever), would that pull request be > > something you would have interest in merging? Or do you consider the > > existing sitemaps are good enough, and you don't want to have support > > something new (for example, rewriting all the docs)? > > > The above notwithstanding, you may have some real improvements to suggest, > in > which case we may be interested. However, we would probably like to see > the > prospective new sitemaps used before we'd accept it, so your best path > towards > that is to develop your version as a 3rd-party app. We'd probably not like > to > keep both versions, though, so if you're trying to write a replacement, > you > need to consider issues of backwards compatibility and upgrade path. > Yeah, that's really the sticking point. From my point of view, rewriting sitemaps for one use case isn't so complicated. Rewriting it from scratch as a CBV is also not so complicated. The complicated part would be to rewrite it as a CBV but keep backwards compatibility, especially because to me the point of the rewrite would be to create a new (hopefully easier to use!) interface for sitemaps. I'll think some more about it. — Carl Johnson -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/6649267a-4e22-479d-82fe-02712de6ab2a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: CBV contrib.sitemaps
I meant to add: [1] https://docs.djangoproject.com/en/1.9/ref/contrib/sitemaps/#sitemap-classes On Wednesday 16 December 2015 01:34:45 Shai Berger wrote: > Hi Carl, > > On Tuesday 15 December 2015 18:17:36 Carl Johnson wrote: > > I was adding a sitemap to a project, and I more or less had to rewrite > > the views from scratch because sitemap expects to receive a dictionary > > of all possible pages at start up time, [...] > > This seems to be a misrepresentation; it takes a dictionary of all site > sections, but each section may well change. E.g. the documentation[1] > mentions a BlogSitemap class -- but surely, new blog posts may be added > without requiring system restart to update the site map... > > > So my question is this, if I created a class-based version of sitemaps > > (django.contrib.sitemaps_cbv or whatever), would that pull request be > > something you would have interest in merging? Or do you consider the > > existing sitemaps are good enough, and you don't want to have support > > something new (for example, rewriting all the docs)? > > The above notwithstanding, you may have some real improvements to suggest, > in which case we may be interested. However, we would probably like to see > the prospective new sitemaps used before we'd accept it, so your best path > towards that is to develop your version as a 3rd-party app. We'd probably > not like to keep both versions, though, so if you're trying to write a > replacement, you need to consider issues of backwards compatibility and > upgrade path. > > HTH, > Shai.
Re: CBV contrib.sitemaps
Hi Carl, On Tuesday 15 December 2015 18:17:36 Carl Johnson wrote: > I was adding a sitemap to a project, and I more or less had to rewrite the > views from scratch because sitemap expects to receive a dictionary of all > possible pages at start up time, [...] This seems to be a misrepresentation; it takes a dictionary of all site sections, but each section may well change. E.g. the documentation[1] mentions a BlogSitemap class -- but surely, new blog posts may be added without requiring system restart to update the site map... > > So my question is this, if I created a class-based version of sitemaps > (django.contrib.sitemaps_cbv or whatever), would that pull request be > something you would have interest in merging? Or do you consider the > existing sitemaps are good enough, and you don't want to have support > something new (for example, rewriting all the docs)? > The above notwithstanding, you may have some real improvements to suggest, in which case we may be interested. However, we would probably like to see the prospective new sitemaps used before we'd accept it, so your best path towards that is to develop your version as a 3rd-party app. We'd probably not like to keep both versions, though, so if you're trying to write a replacement, you need to consider issues of backwards compatibility and upgrade path. HTH, Shai.
CBV contrib.sitemaps
I was adding a sitemap to a project, and I more or less had to rewrite the views from scratch because sitemap expects to receive a dictionary of all possible pages at start up time, which for various reasons I didn't want to have to provide. In general extending sitemaps is pretty difficult because (like contrib.admin, but that's another can of worms) it was made before class-based views, so it doesn't have the notion of creating a new instance for each request. So my question is this, if I created a class-based version of sitemaps (django.contrib.sitemaps_cbv or whatever), would that pull request be something you would have interest in merging? Or do you consider the existing sitemaps are good enough, and you don't want to have support something new (for example, rewriting all the docs)? Thanks, — Carl Johnson -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3ed7a856-4458-4f20-b146-0275a488bb70%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.