Ejemplo n.º 1
0
 def test_resolve_query(self):
     results = models.resolve_query(TestModel.select().where(TestModel.name == "test"))
     self.assertIsInstance(results, list)
     self.assertEqual(len(results), 1)
     # Make sure this is a dict and not a TestModel
     self.assertIsInstance(results[0], dict)
     self.assertEqual(results[0]["name"], "test")
Ejemplo n.º 2
0
 def test_resolve_query(self):
     results = models.resolve_query(
         TestModel.select().where(TestModel.name == 'test'))
     self.assertIsInstance(results, list)
     self.assertEqual(len(results), 1)
     # Make sure this is a dict and not a TestModel
     self.assertIsInstance(results[0], dict)
     self.assertEqual(results[0]['name'], 'test')
Ejemplo n.º 3
0
 def __get_registered_containers(self, topic):
     return resolve_query(
         Registration.select().where(Registration.topic == topic))
Ejemplo n.º 4
0
def get_registrations():
    query = Registration.select()
    if 'creator' in request.query:
        query = query.where(Registration.creator == request.query['creator'])
    return {'results': resolve_query(query)}
Ejemplo n.º 5
0
 def __get_registered_containers(self, topic):
     return resolve_query(Registration.select().where(Registration.topic == topic))