Django sitemap index with paged content

I was working on the sitemap index. I would like every 40000 item group into one sitemap on the site index like this

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>http://terrywong.co.uk/sitemap-Page1.xml</loc>
    </sitemap>
    <sitemap>
        <loc>http://terrywong.co.uk/sitemap-static.xml</loc>
    </sitemap>
    <sitemap>
        <loc>http://terrywong.co.uk/sitemap-Page3.xml</loc>
    </sitemap>
    <sitemap>
        <loc>http://terrywong.co.uk/sitemap-Page2.xml</loc>
    </sitemap>
</sitemapindex>

I couldn’t find ways of doing it without using plugin.

Each item on the siteindex require it’s own class, so I created class dynamically using type, and by using paginator

urls.py

from sitemap import generateSitemaps

sitemaps = generateSitemaps()

urlpatterns += patterns('django.contrib.sitemaps.views',
    url(r'^sitemap\.xml$', 'index', {'sitemaps': sitemaps}),
    url(r'^sitemap-(?P<section>.+)\.xml$', 'sitemap', {'sitemaps': sitemaps}),
)

sitemap.py

from models import Post
from django.core.paginator import Paginator

sitemapEntryPage=40000

def items(self):
    posts = Post.objects.filter(deletedByAdmin=False, deletedByUser=False).order_by("-id")
    paginator = Paginator(posts, sitemapEntryPage)
    return paginator.page(self.page).object_list

def generateSitemaps():
    siteMaps = { "static" : StaticViewSitemap }
    
    postPages = range(Post.objects.filter(deletedByAdmin=False, deletedByUser=False).count())[0::sitemapEntryPage]
    
    for postPage in postPages: 
        page = postPage / sitemapEntryPage + 1
        postPageCls = type('postPage' + str(page), (Sitemap,), {'items': items})
        postPageCls.page = page
        postPageCls.priority = 0.5
        postPageCls.changefreq = 'daily'
        siteMaps['postPage' + str(page)] = postPageCls

    return siteMaps

If there is a better way please feel free to let me know :)