This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pipe(object): | |
def __init__(self, name, id=None): | |
self.name = name | |
self.id = id | |
self.children = [] | |
def __rshift__(self, other): | |
if other.id: | |
self.children.append(other) | |
elif other.name in [x.id for x in self.children]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def join_to(self, table1, table2, field1, field2, queryset, alias='', left=True): | |
def extra_join_cond(where_class, alias, related_alias): | |
if (alias, related_alias) == ('[sys].[columns]', | |
'[sys].[database_permissions]'): | |
where = '[sys].[columns].[column_id] = ' \ | |
'[sys].[database_permissions].[minor_id]' | |
children = [ExtraWhere([where], ())] | |
wh = where_class(children) | |
return wh | |
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main.py | |
class WliBlogApplication(Application): | |
db = AsyncIOMotorClient().wli | |
db_instance = MotorAsyncIOInstance() | |
db_instance.init(db) | |
def main(): | |
return WliBlogApplication() | |
if __name__ == '__main__': |