Skip to content
Discussion options

You must be logged in to vote

nbshell is just a wrapper around the Python interactive shell, so you can do pretty much anything you can write code for.

You can find the ExportModel class defined in extras/models.py. This class includes a render() method which takes a queryset and returns the rendered output. So, you can do something like this:

sites = Site.objects.all()
et = ExportTemplate.objects.get(name='MyExportTemplate')
et.render(sites)

Hope that helps!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hoalex
Comment options

@jeremystretch
Comment options

@hoalex
Comment options

Answer selected by hoalex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants