~free.ekanayaka/storm/any-expr

« back to all changes in this revision

Viewing changes to storm/store.py

  • Committer: Guilherme Salgado
  • Date: 2010-02-01 18:26:10 UTC
  • mfrom: (353.1.2 bug-506536)
  • Revision ID: salgado@canonical.com-20100201182610-7evdxngiixc7x5o3
Add a get_database() method to Store, fixing bug 506536

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        @param database: The L{storm.database.Database} instance to use.
69
69
        @param cache: The cache to use.  Defaults to a L{Cache} instance.
70
70
        """
 
71
        self._database = database
71
72
        self._event = EventSystem(self)
72
73
        self._connection = database.connect(self._event)
73
74
        self._alive = WeakValueDictionary()
80
81
        self._implicit_flush_block_count = 0
81
82
        self._sequence = 0 # Advisory ordering.
82
83
 
 
84
    def get_database(self):
 
85
        """Return this Store's Database object."""
 
86
        return self._database
 
87
 
83
88
    @staticmethod
84
89
    def of(obj):
85
90
        """Get the Store that the object is associated with.