コード例 #1
0
    def get(self, key="", topic="", ident=""):
        if not key:
            garages = Garage.query()
            self.render_response("/detail/garage-list.html", garages=garages)
        else:
            garage = Garage.get(key)
            import logging

            logging.warning("Got garage " + garage.name)
            pass
コード例 #2
0
    def datastore_test(self):
        from practice.model.garage import Garage

        props = {"name": "test", "postal_country": "NL", "brand": "Lamborghini"}

        Garage.add(props=props)
        o = Garage.query().filter(Garage.name == props["name"]).get()
        if o:
            o.key.delete()
            if Garage.query().filter(Garage.name == props["name"]).get() is None:
                self.log("Datastore test OK!")
コード例 #3
0
    def test_twee(self):
        g = Garage()
        g.name = "test1"
        g.brande = "Patat"
        g.note = """ Testing note
        for multi line
        hueaah"""
        g.put()

        self.assertEqual(2, Garage.query().count(), "No you suck")
コード例 #4
0
 def test_datastore(self):
     """ start with test_ to get function started
     """
     g = Garage()
     g.name = "test2222"
     g.brande = "Volvo"
     g.note = """ Testing note
     for multi line
     hueaah"""
     print str(g.id)
     g.put()
     self.assertEqual(1, Garage.query().count())  # yay success
コード例 #5
0
 def get(self):
     garages = Garage.query()
     self.render_response("/home.html", garages=garages)