Hello

I have this class set up to handle a filename. I want to display all
the listing in abspath onto a kid template called private.kid...
abspath holds the filename and path of files uploaded to the data base.

 tried to use the sample from the tutorial of displaying the
pagename

==The call is ==

class UploadedFile(SQLObject):
        filename = StringCol(alternateID=True)
        abspath = StringCol()
        size = IntCol()


==I tried to use in the controller==

    @expose(template="se.templates.private")
    @identity.require(identity.not_anonymous())
    def private(self, pagename="privatepage"):
        myfile = UploadedFile.byFilename(abspath)
        file_path = [myfile.abspath for myfile in UploadedFile.select
        (orderBy=UploadedFile.q.abspath)]
        try:
            page = Page.byPagename(pagename)
        except SQLObjectNotFound:
            redirect("/notfound", pagename=pagename)
        content = publish_parts(page.data,
writer_name="html")["html_body"]
        content = wikiwords.sub(r'<a href="\1">\1</a>', content)
        return dict(page=page, data=content, file_path=file_path)



==and to display the abspaths on the template i tried  ==

    <ul>
        <li py:for="abspath in file_path">${abspath}</li>
    </ul>


Now this doesn't work so there must be something wrong somewhere

I get 2 errors

File "/var/projects/document_site/se/se/controllers.py", line 49, in
private
    myfile = UploadedFile.byFilename(abspath)
NameError: global name 'abspath' is not defined

File "/usr/local/lib/python2.4/traceback.py", line 13, in _print
    file.write(str+terminator)
IOError: [Errno 5] Input/output error


If someone could help me to display the abspath from my database that
would be appreciated.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to