On Dec 19, 6:52 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Thanks.. that's close, but I can't seem to get it to work properly
> from within Django;
>
> They give an example like this:
> def MakeExample1() :
> doc = Document()
> ss = doc.StyleSheet
> section = Section()
> doc.Sections.append( section )
>
> section.append( 'A lot of useful documents can be created '
> 'in this way, more advance formating
> is available '
> 'but a lot of users just want to see
> their data come out '
> 'in something other than a text
> file.' )
> return doc
>
> I have:
> def rtf(request, slug):
> release = Release.objects.get(slug=slug)
> response = HttpResponse(mimetype='application/rtf')
> response['Content-Disposition'] = 'attachment;
> filename='+release.slug+'.rtf'
>
> doc = Document()
> ss = doc.StyleSheet
> section = Section()
> doc.Sections.append( section )
>
> section.append( 'A lot of useful documents can be created '
> 'in this way, more advance formating
> is available '
> 'but a lot of users just want to see
> their data come out '
> 'in something other than a text
> file.' )
> response.write(doc.Sections)
> return response
>
> But it looks like I'm returning a list or something:
> [['A lot of useful documents can be created in this way, more advance
> formating is available but a lot of users just want to see their data
> come out in something other than a text file.']]
>
Judging by the examples it looks like you need that Renderer class,
e.g.:
DR = Renderer()
DR.Write(doc, response)
> On Dec 19, 11:12 am, "Jökull" <[EMAIL PROTECTED]> wrote:
>
> > A quick google returned this:http://pyrtf.sourceforge.net/
>
> > On Dec 19, 3:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Like the title says, I'd like to output a word-friendly format.
> > > Obviously plain text is trivial, but I'd like to have a doc or at
> > > least rtf format. Can anyone point me in the right direction?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---