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

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: Matt Giuca
  • Date: 2009-01-19 03:45:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: matt.giuca@gmail.com-20090119034503-niz2yx34pojryrds
ivle.database: Added __all__ to the top of the file.
    Added heading comments to separate the various sections.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
import ivle.conf
34
34
import ivle.caps
35
35
 
 
36
__all__ = ['get_store',
 
37
            'User',
 
38
            'Subject', 'Semester', 'Offering', 'Enrolment',
 
39
            'ProjectSet', 'Project', 'ProjectGroup', 'ProjectGroupMembership',
 
40
        ]
 
41
 
36
42
def _kwarg_init(self, **kwargs):
37
43
    for k,v in kwargs.items():
38
44
        if k.startswith('_') or not hasattr(self, k):
55
61
    """
56
62
    return Store(create_database(get_conn_string()))
57
63
 
 
64
# USERS #
 
65
 
58
66
class User(Storm):
59
67
    """
60
68
    Represents an IVLE user.
178
186
        """
179
187
        return store.find(cls, cls.login == unicode(login)).one()
180
188
 
 
189
# SUBJECTS AND ENROLMENTS #
 
190
 
181
191
class Subject(Storm):
182
192
    __storm_table__ = "subject"
183
193
 
244
254
        return "<%s %r in %r>" % (type(self).__name__, self.user,
245
255
                                  self.offering)
246
256
 
 
257
# PROJECTS #
 
258
 
247
259
class ProjectSet(Storm):
248
260
    __storm_table__ = "project_set"
249
261