~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: William Grant
  • Date: 2010-02-26 13:27:55 UTC
  • Revision ID: grantw@unimelb.edu.au-20100226132755-6aya9set3q8nkgyv
Tags: 1.0
Bump version to 1.0. This is it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import hashlib
27
27
import datetime
28
28
import os
29
 
import urlparse
30
29
 
31
30
from storm.locals import create_database, Store, Int, Unicode, DateTime, \
32
31
                         Reference, ReferenceSet, Bool, Storm, Desc
230
229
        """Find a user in a store by login name."""
231
230
        return store.find(cls, cls.login == unicode(login)).one()
232
231
 
233
 
    def get_svn_url(self, config):
234
 
        """Get the subversion repository URL for this user or group."""
235
 
        path = 'users/%s' % self.login
236
 
        return urlparse.urljoin(config['urls']['svn_addr'], path)
237
 
 
238
232
    def get_permissions(self, user, config):
239
233
        """Determine privileges held by a user over this object.
240
234
 
731
725
            Semester.id == Offering.semester_id,
732
726
            (not active_only) or (Semester.state == u'current'))
733
727
 
734
 
    def get_svn_url(self, config):
735
 
        """Get the subversion repository URL for this user or group."""
736
 
        path = 'groups/%s_%s_%s_%s' % (
737
 
                self.project_set.offering.subject.short_name,
738
 
                self.project_set.offering.semester.year,
739
 
                self.project_set.offering.semester.semester,
740
 
                self.name
741
 
                )
742
 
        return urlparse.urljoin(config['urls']['svn_addr'], path)
743
728
 
744
729
    def get_permissions(self, user, config):
745
730
        if user.admin or user in self.members: