I believe what you think is happening is that an UploadFile controller
is being created for each request, and that it is ok to store
information in the controller's namespace and it will be maintained for
that request/user.  That's not really the situation.  What really
happens is that the controllers are instantiated at startup, and are
used to process each request.  So, putting stuff in the controllers
'self' is VERY unsafe, as it could be changed by subsequent requests to
that controller (that's not happening in your case, but you have other
problems you are seeing). It's best to program so that the controller
just shuttles data back and forth, and doesn't store any data on its
own.

Without going into it too much detail, I think you need to reorganize
the controller as follows:

- Create a method (not exposed) to find the folders that belong to a
user.  For argument's sake let's call it user_folders(self).
- You should probably have another method (not exposed) that creates
your upload_form table widget and is based on user_folders().  Let's
call it upload_form(self).  You _could_ put the creation in index, but
having it separate will allow you to do validation in "save_file" (if
you want).
- index(self) will contain return dict(upload_form=self.upload_form),
but now self.upload_form is a callable instead of a variable reference.
- search(self, input) does it's thing, but first needs to grab the
folder list from user_folders()

As a side benefit, this will get rid of your RequestRequiredException.
:-)

The above may not be terribly clear, so post if you have questions.


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