goa/overrides/rqlannotation.py
author Sandrine Ribeau <sandrine.ribeau@logilab.fr>
Wed, 05 Nov 2008 13:02:09 -0800
changeset 2 3847ffe2f86c
parent 0 b97547f5f1fa
child 444 c6f20e605b84
permissions -rw-r--r--
Make SQLGenAnnotator work with GoogleAppEngine.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
def set_qdata(union, noinvariant):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
    pass
2
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
     3
        
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
     4
class SQLGenAnnotator(object):
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
     5
    def __init__(self, schema):
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
     6
        self.schema = schema
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
     7
        self.nfdomain = frozenset(eschema.type for eschema in schema.entities()
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
     8
                                  if not eschema.is_final())
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
     9
    def annotate(self, rqlst):
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
    10
        rqlst.has_text_query = False
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
    11
        rqlst.need_distinct = False
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
    12
        
3847ffe2f86c Make SQLGenAnnotator work with GoogleAppEngine.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 0
diff changeset
    13