Lee Connell schrieb:
" files = get_files(user.static_dir) "

Q1. so this is pulling from the User model, so would I add another field to
the model which holds the static_dir?

Yes, that's how I intended it. You don't have to do it that way. You could also contruct the path for static_dir by appending/inserting the username to some fixed path that is set in the configuration file, e.g.

static_dir = config.get('myapp.static_dir', '/Users/%s/files') % user.user_name

Q2. Do I have to manually serve files through CP?  Is there a way for CP to
just serve up anything that's not a .py or .kid source file as a
downloadable file?

Not if you want to base access control on the identity model of your app and without resorting to filters, I think.

What I'm most interested in is that anything under /Users/$username/files/
are all static files which are downloadable.

You could always configure your web server to serve files from this directory directly, bypassing CherryPy, and use some other means of authentication, i.e. HTTP Basic/Digest.

I just want to make sure
$username matches "identity.current.user" correct?

I you make sure the user is logged in, yes, i.e. identity.not_anonymous() == True. But you have to match the user name against identity.current.user.user_name not identity.current.user. The latter is a 'User' object not a string.

Chris

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to