[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.']]
>   
The example returns doc--you are returning doc.Sections.  Most likely
that is a list, or a list-like object.  I've never used pyrtf, fwiw.


Cheers,
Cliff


--~--~---------~--~----~------------~-------~--~----~
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