예제 #1
0
    def test_builder(self):

        _yql = _YQLBuilder("user")

        _yql.filter("name", "sathya")
        _yql.filter("age", 26, type='integer')

        actual = "SELECT * FROM user WHERE name = 'sathya' and age = 26"

        self.assertEqual(_yql.el, actual)
예제 #2
0
    def test_builder(self):

        _yql = _YQLBuilder("user")

        _yql.filter("name", "sathya")
        _yql.filter("age", 26, type='integer')

        actual = "SELECT * FROM user WHERE name = 'sathya' and age = 26"

        self.assertEqual(_yql.el, actual)
예제 #3
0
    def test_builder_1(self):

        _yql = _YQLBuilder("user")

        g = _yql.filter("name","sathya")
        g.get("age", "page")

        actual = "SELECT age,page FROM user WHERE name = 'sathya'"

        self.assertEqual(_yql.el, actual)
        self.assertNotEqual(_yql.el, actual)
예제 #4
0
    def test_builder_1(self):

        _yql = _YQLBuilder("user")

        g = _yql.filter("name", "sathya")
        g.get("age", "page")

        actual = "SELECT age,page FROM user WHERE name = 'sathya'"

        self.assertEqual(_yql.el, actual)
        self.assertNotEqual(_yql.el, actual)
예제 #5
0
    def __init__(self, *args, **kwargs):
        """

         Object block consistes of a table name
         and builder get initialised for constructing
         the quries.

        """

        self.__tablename = kwargs.pop('table', None)
        self.__yql = _YQLBuilder(self.__tablename)
        super(_Api_Request, self).__init__(*args, **kwargs)
예제 #6
0
    def __init__(self, *args, **kwargs):
        """

         Object block consistes of a table name
         and builder get initialised for constructing
         the quries.

        """

        self.__tablename = kwargs.pop('table', None)
        self.__yql = _YQLBuilder(self.__tablename)
        super(_Api_Request, self).__init__(*args, **kwargs)