示例#1
0
def list_defaults():
    subs = (SiteMetadata.select(Sub.name).join(
        Sub, on=Sub.sid == SiteMetadata.value).where(
            (SiteMetadata.key == "default")).dicts())
    print("Default subs: ")
    for i in subs:
        print("  ", i["name"])
示例#2
0
def listSubs():
    defaults = [
        x.value
        for x in SiteMetadata.select().where(SiteMetadata.key == 'default')
    ]
    defaults = Sub.select(Sub.sid, Sub.name).where(Sub.sid << defaults)
    print("Default Subs: ")
    for i in defaults:
        print("  ", i.name)