Example #1
0
 def get_all_missing(db: CouchDatabase) -> List['PhotoEncoding']:
     return_list: List['PhotoEncoding'] = []
     selector = {'type': {'$eq': 'photoencoding'}, 'missing': {'$eq': True}}
     resp = db.get_query_result(selector)
     for doc in resp:
         return_list.append(PhotoEncoding.from_dict(doc))
     return return_list
Example #2
0
 def get_all_by_ngo(db: CouchDatabase, ngo: str) -> List['PhotoEncoding']:
     return_list: List['PhotoEncoding'] = []
     selector = {
         '$and': [{
             'type': {
                 '$eq': 'photoencoding'
             }
         }, {
             'ngoId': {
                 '$eq': ngo
             }
         }, {
             'missing': {
                 '$eq': False
             }
         }]
     }
     resp = db.get_query_result(selector)
     for doc in resp:
         return_list.append(PhotoEncoding.from_dict(doc))
     return return_list