Package bosco :: Module base
[hide private]
[frames] | no frames]

Source Code for Module bosco.base

 1  # 
 2  #    Copyright (C) 2008  Gaudenz Steinlin <gaudenz@soziologie.ch> 
 3  # 
 4  #    This program is free software: you can redistribute it and/or modify 
 5  #    it under the terms of the GNU General Public License as published by 
 6  #    the Free Software Foundation, either version 3 of the License, or 
 7  #    (at your option) any later version. 
 8  # 
 9  #    This program is distributed in the hope that it will be useful, 
10  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
11  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
12  #    GNU General Public License for more details. 
13  # 
14  #    You should have received a copy of the GNU General Public License 
15  #    along with this program.  If not, see <http://www.gnu.org/licenses/>. 
16   
17  """ 
18  base.py - Base classes 
19  """ 
20   
21  from storm.locals import * 
22  from storm.exceptions import NoStoreError 
23   
24 -class MyStorm(Storm):
25 """ 26 @todo: Find a better name for this class. 27 """ 28
29 - def _get_store(self):
30 store = Store.of(self) 31 if store is None: 32 raise NoStoreError('Operation not possible without a store.') 33 return store
34
35 - def _set_store(self, store):
36 store.add(self)
37 38 _store = property(_get_store, _set_store)
39