Sphene Community Tools


Copyright © 2007-2018 by Herbert Poul

You are not logged in.

Change Language:

AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Wiki attachments don't show up

When trying to link to some attachments on Boostcon's wiki, one of our users noticed that the links weren't showing up. I tracked the problem down to templates/sphene/sphwiki/macros/_attachment.html.

That file refers to the following two variables: attachment.get_fileupload_url and attachment.get_fileupload_filename, neither of which appear to exist. I was able to resolve the issue by replacing them with attachment.fileupload.url and attachment.fileupload.name, respectively. Is this an anachronism from older versions of Django?

--- Last Edited by jvp at 2009-01-27 08:20:34 ---
yes exactly - it was changed in django in 1.0 .. there are still a few locations where i forgot to change it..
thanks for the notice, i have fixed the templates in SVN trunk
Hey, we have Signatures !!! Great, isn't it ? ;)
The {attachment id=#} macro is not working. I looked at the wikimacros.py which generates the context and it's doing it differently than the attachment_list which seems to work fine. I've tried changing the context and even returning the link hard, but that just shows text and does not generate the proper HTML.

I made a very temporary, sloppy fix for now by adding this line after where the attachment is queried for:

return HTML('<a href="'+attachment.fileupload.url+'">'+os.path.basename( attachment.fileupload.name )+'</a>')

--- Last Edited by Noah Jorgenson at 2009-08-10 22:46:45 ---

Made a more complete fix which models what the html would have done:

returnMe = '<a href="'+attachment.fileupload.url+'">'
            if params.has_key('label'):
                returnMe = returnMe+params['label']
                returnMe = returnMe+os.path.basename( attachment.fileupload.name )
            returnMe = returnMe+'</a>'
            return HTML(returnMe)

--- Last Edited by Noah Jorgenson at 2009-08-10 23:02:40 ---

EDIT: Works with the updated code from the SVN.

--- Last Edited by Noah Jorgenson at 2009-08-10 23:29:38 ---

Please login to post a reply.

Powered by Sphene Community Tools