Example #1
0
 def getLocationNameList(self):
     '''
     Returns a list of home location names
     '''
     cur = self.cursor()
     cur.execute("SELECT name FROM Locations ORDER BY name")
     return rows2list(cur.fetchall())
Example #2
0
 def getLocationNameList(self):
     '''
     Returns a list of home location names
     '''
     cur = self.cursor()
     cur.execute("SELECT name FROM Locations ORDER BY name")
     return rows2list(cur.fetchall())
Example #3
0
 def getCacheCodeList(self):
     '''
     Returns a list of the codes of each cache in the database
     '''
     cur = self.cursor()
     cur.execute("SELECT code FROM Caches ORDER BY code")
     return rows2list(cur.fetchall())
Example #4
0
 def getAddWaypointCodes(self):
     '''Returns a list of the codes of the waypoints associated with the cache'''
     cur = geocacher.db().cursor()
     cur.execute(
         "SELECT code FROM Waypoints WHERE cache_id = ? ORDER BY code",
         (self.id, ))
     return rows2list(cur.fetchall())
Example #5
0
 def getCacheCodeList(self):
     '''
     Returns a list of the codes of each cache in the database
     '''
     cur = self.cursor()
     cur.execute("SELECT code FROM Caches ORDER BY code")
     return rows2list(cur.fetchall())
Example #6
0
 def getTravelBugRefs(self):
     '''Returns a list of the ref's of the travel bugs in the cache'''
     cur = geocacher.db().cursor()
     cur.execute(
         "SELECT ref FROM Travelbugs WHERE cache_id = ? ORDER BY ref",
         (self.id, ))
     return rows2list(cur.fetchall())
Example #7
0
 def getLogDates(self):
     '''
     Returns a sorted list of the dates on which the cache has been logged
     with the most recent first
     '''
     cur = geocacher.db().cursor()
     cur.execute("SELECT date FROM Logs WHERE cache_id = ? ORDER BY date DESC", (self.id,))
     return rows2list(cur.fetchall())
Example #8
0
 def getLogDates(self):
     '''
     Returns a sorted list of the dates on which the cache has been logged
     with the most recent first
     '''
     cur = geocacher.db().cursor()
     cur.execute(
         "SELECT date FROM Logs WHERE cache_id = ? ORDER BY date DESC",
         (self.id, ))
     return rows2list(cur.fetchall())
Example #9
0
    def getLogIdList(self, sort=True, descending=True, maxLen=None):
        '''
        Returns a list of the ID's of the logs associated with the cache

        Keyword arguments
        sort       Enable sorting of the log list by date
        descending Sort with the most recent log first
        maxLen     Truncate the list at this position
        '''
        cur = geocacher.db().cursor()
        sql = "SELECT id FROM Logs WHERE cache_id = ?"
        if sort:
            sql = sql + " ORDER BY log_date"
        if descending:
            sql = sql + " DESC"
        cur.execute(sql, (self.id, ))
        rows = cur.fetchall()
        if maxLen is not None:
            if descending:
                rows = rows[:maxLen]
            else:
                rows = rows[-maxLen:]
        return rows2list(rows)
Example #10
0
    def getLogIdList(self, sort=True, descending=True, maxLen=None):
        '''
        Returns a list of the ID's of the logs associated with the cache

        Keyword arguments
        sort       Enable sorting of the log list by date
        descending Sort with the most recent log first
        maxLen     Truncate the list at this position
        '''
        cur = geocacher.db().cursor()
        sql = "SELECT id FROM Logs WHERE cache_id = ?"
        if sort:
            sql = sql + " ORDER BY log_date"
        if descending:
            sql = sql + " DESC"
        cur.execute(sql , (self.id,))
        rows = cur.fetchall()
        if maxLen is not None:
            if descending:
                rows = rows[:maxLen]
            else:
                rows = rows[-maxLen:]
        return rows2list(rows)
Example #11
0
 def getAttributeIds(self):
     '''Returns a list of the id's of the caches attributes'''
     cur = geocacher.db().cursor()
     cur.execute("SELECT id FROM Attributes WHERE cache_id = ? ORDER BY id",
                 (self.id, ))
     return rows2list(cur.fetchall())
Example #12
0
 def getAddWaypointCodes(self):
     '''Returns a list of the codes of the waypoints associated with the cache'''
     cur = geocacher.db().cursor()
     cur.execute("SELECT code FROM Waypoints WHERE cache_id = ? ORDER BY code",(self.id,))
     return rows2list(cur.fetchall())
Example #13
0
 def getTravelBugRefs(self):
     '''Returns a list of the ref's of the travel bugs in the cache'''
     cur = geocacher.db().cursor()
     cur.execute("SELECT ref FROM Travelbugs WHERE cache_id = ? ORDER BY ref" , (self.id,))
     return rows2list(cur.fetchall())
Example #14
0
 def getAttributeIds(self):
     '''Returns a list of the id's of the caches attributes'''
     cur = geocacher.db().cursor()
     cur.execute("SELECT id FROM Attributes WHERE cache_id = ? ORDER BY id" , (self.id,))
     return rows2list(cur.fetchall())