Пример #1
0
def mkusr():
    u = User()
    u.id = 1
    u.email = '*****@*****.**'
    u.username = '******'
    u.name = 'Kurohai'
    u.password = '******'
    u.admin = True

    session.add(u)
    session.commit()
Пример #2
0
def mkusr():
    u = User()
    u.id = 1
    u.email = '*****@*****.**'
    u.username = '******'
    u.name = 'Kurohai'
    u.password = '******'
    u.admin = True

    session.add(u)
    session.commit()
Пример #3
0
 def emit(self, record):
     trace = None
     exc = record.__dict__['exc_info']
     if exc:
         trace = traceback.format_exc(exc)
     log = Log(
         logger=record.__dict__['name'],
         level=record.__dict__['levelname'],
         trace=trace,
         msg=record.__dict__['msg'],)
     session.add(log)
     session.commit()
Пример #4
0
def mkusr():
    print 'adding user'

    u = User()
    a = Admin()

    u.username = a.username
    u.id = a.id
    u.email = a.email
    u.password = a.password
    u.admin = a.admin

    session.add(u)
    session.commit()
Пример #5
0
def mkdir():
    d = Directory()
    d.name = 'test'
    d.path = 'd:/dropbox/'
    session.add(d)
    session.commit()
Пример #6
0
def data():
    day = ColorSet()

    yellow = Color()
    yellow.name = 'yellow'
    yellow.colorset = day

    white = Color()
    white.name = 'white'
    white.colorset = day

    pink = Color()
    pink.name = 'pink'
    pink.colorset = day

    purple = Color()
    purple.name = 'purple'
    purple.colorset = day

    olive = Color()
    olive.name = 'olive'
    olive.colorset = day

    azure = Color()
    azure.name = 'azure'
    azure.colorset = day

    camo = Color()
    camo.name = 'camo'
    camo.colorset = day

    session.add(day)
    session.add(yellow)
    session.add(white)
    session.add(pink)
    session.add(purple)
    session.add(olive)
    session.add(azure)
    session.add(camo)
    session.commit()

    d = session.query(ColorSet).all()
    for i in d:
        print i.date
        print i.id
        for c in i.colors:
            print c.name
Пример #7
0
def data():
    day = ColorSet()

    yellow = Color()
    yellow.name = 'yellow'
    yellow.colorset = day

    white = Color()
    white.name = 'white'
    white.colorset = day

    pink = Color()
    pink.name = 'pink'
    pink.colorset = day

    purple = Color()
    purple.name = 'purple'
    purple.colorset = day

    olive = Color()
    olive.name = 'olive'
    olive.colorset = day

    azure = Color()
    azure.name = 'azure'
    azure.colorset = day

    camo = Color()
    camo.name = 'camo'
    camo.colorset = day

    session.add(day)
    session.add(yellow)
    session.add(white)
    session.add(pink)
    session.add(purple)
    session.add(olive)
    session.add(azure)
    session.add(camo)
    session.commit()

    d = session.query(ColorSet).all()
    for i in d:
        print i.date
        print i.id
        for c in i.colors:
            print c.name