Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

root/trunk/errors.py

Revision 101 (checked in by fumanchu, 8 years ago)

Fix for #20 (awareness of to-one or to-many).

  1. Magic Unit relation methods may now return a single Unit (or None) if they are to-one. To-many methods still return a list.
  2. dejavu.associate is replaced by Unit.associate, one_to_many, one_to_one, and many_to_one.
  3. Unit.first is removed.
  4. One-way associations are now possible via dejavu.ToOne? and .ToMany?. Customization of relation descriptors is easier (override UnitAssociation?.related).
  5. Unit._associations dict has changed protocol.
  6. Lots of module breakouts to make reading easier.
  • Property svn:eol-style set to native
Line 
1
2 class DejavuError(Exception):
3     """Base class for errors which occur within Dejavu."""
4     def __init__(self, *args):
5         Exception.__init__(self)
6         self.args = args
7    
8     def __str__(self):
9         return u'\n'.join([unicode(eachArg) for eachArg in self.args])
10
11 class AssociationError(DejavuError):
12     """Exception raised when a Unit association fails."""
13     pass
14
15 class UnrecallableError(DejavuError):
16     """Exception raised when a Unit was sought but not recalled."""
17     pass
18
Note: See TracBrowser for help on using the browser.