queries.py

Go to the documentation of this file.
00001 import UserList
00002 
00003 ##
00004 # This Class exists to facilitate the process of choosing items from a SQLAlchemy Query Object.
00005 class QueryWrapper(UserList.UserList):
00006     def __init__(self, qry):
00007         self.__qry__ = qry
00008 
00009     def __getitem__(self, i):
00010         return self.qry[i]
00011     
00012     def __setitem__(self, i, item): 
00013         raise NotImplementedError('Cannot set an item at this time.  This is a Wrapper that facilitates choosing items from a Query Object.')
00014         
00015     def __delitem__(self, i): 
00016         raise NotImplementedError('Cannot delete an item at this time.  This is a Wrapper that facilitates choosing items from a Query Object.')
00017 
00018     def __len__(self): 
00019         return int(self.qry.count())
00020 
00021     def qry():
00022         doc = "qry"
00023         def fget(self):
00024             return self.__qry__
00025         return locals()
00026     qry = property(**qry())
00027 
00028 
00029 

© Copyright 2008-2009 Vyper Logix Corp., All Right Reserved; If you reference this document or any part of this document you must use the citation verbatim (including the link) "© Copyright 2008-2009 Vyper Logix Corp., All Right Reserved."

Notice: This source code contained in this document is NOT open source and is NOT being distributed as open source.

122,241 lines of code and growing...