def collection(name): # deal with message msg = utils.msgHandle(session) data = {} c = models.Collection.objects.get(name=name) data['collection'] = c # stringify search terms data['collection']['search_terms'] = ", ".join(data['collection']['search_terms']) # get job cron try: job = mycron.find_comment('twitore_{name}'.format(name=name)).next() logging.debug(job.command) except: logging.warning('could not find cron') return render_template('collection.html', data=data, msg=msg)
def collections(): # deal with message msg = utils.msgHandle(session) data = [] collections = models.Collection.objects() ''' This needs to be paginated ''' for collection in collections: s = models.MongoTweet.objects().filter(twitore_collection=collection.name) data.append({ "count":s.count(), "name":collection.name, 'minute_frequency':collection.minute_frequency }) logging.debug(mycron.user) logging.debug(mycron.crons) return render_template('collections.html', data=data, msg=msg)