Home | Trees | Indices | Help |
|
---|
|
1 #!/usr/bin/python 2 # 3 # Copyright (c) 2010 Red Hat, Inc. 4 # 5 # This software is licensed to you under the GNU General Public License, 6 # version 2 (GPLv2). There is NO WARRANTY for this software, express or 7 # implied, including the implied warranties of MERCHANTABILITY or FITNESS 8 # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 9 # along with this software; if not, see 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 11 # 12 # Red Hat trademarks are not licensed under GPLv2. No permission is 13 # granted to use or replicate Red Hat trademarks that are incorporated 14 # in this software or its documentation. 15 16 import logging 17 18 # logging and db connection 19 20 log = logging.getLogger(__name__)21 22 # base api class -------------------------------------------------------------- 23 24 -class BaseApi(object):256527 self.objectdb = self._getcollection()28 29 @property 32 33 @property 3638 """ 39 Delete all the Objects in the database. WARNING: Destructive 40 """ 41 self.objectdb.remove(safe=True)4244 """ 45 Insert the object document to the database 46 """ 47 self.objectdb.insert(object, check_keys=check_keys, safe=True) 48 return object4951 """ 52 Write the object document to the database 53 """ 54 self.objectdb.save(object, safe=True) 55 return object56 62
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Sep 7 12:30:39 2010 | http://epydoc.sourceforge.net |