A lot of what I've done is simplify the logic of the two modules to use GSoCConnection rather than GSoCRequest - nothing too elaborate yet. Here's a snippet from request.py, which handles the POST request when a User requests to become a mentor for a particular organization. It generates a GSoCConnection instance between the User and the organization properly and forwards the user onto the view_request page (which I'm going to replace later). I've made changes to the checkAccess() and context() methods to facilitate this change, though the latter isn't done yet. Here's the post snippet from invite.py, again context() is still in progress.
One big hangup I've run into is the dashboard presentation and query of these connections. I tried changing a few columns of the ListConfiguration in the __init__() method of my ConnectionComponent class only to find that the table no longer displayed. That said, I dug into the ListConfiguration class and then rewrote the init method to fit my needs (discovering the Python lambda functions in the process, which are fantastic). However, I'm stumped on the following query in the getListData() method:
No matter what I do I cannot seem to get any Organization or User objects to equate or match in this query, even when I know that there are valid objects meeting the criteria in the datastore. I've used the logging module extensively to try to get to the root of the problem but am at a loss as to what I need to do to fix it. Other than that, this week has been an excellent learning experience and I feel far more comfortable with the view system and the lifecycle of a RequestHandler subclass, which will be useful when building the connection module.q = GSoCConnection.all()if self.for_admin:q.filter('organization IN', self.data.org_admin_for)else:q.filter('user =', self.data.user)
No comments:
Post a Comment