Example #1
0
    def do_demo_setup(self):
        Session.add(Address(name='John Doe', email_address='*****@*****.**'))
        Session.add(Address(name='Jane Johnson', email_address='*****@*****.**'))
        Session.add(Address(name='Jack Black', email_address='*****@*****.**'))

        Session.flush()
        Session.commit()
Example #2
0
    def do_demo_setup(self):
        self.address_book
        self.account
        self.other_account
        self.other_address_book

        Session.flush()
        Session.commit()
Example #3
0
    def do_demo_setup(self):
        self.address_book
        john = self.account
        jane = self.new_account(email='*****@*****.**')
        jane_book = self.new_address_book(owner=jane)
        someone = self.new_account(email='*****@*****.**')
        someone_book = self.new_address_book(owner=someone)
        someone_else = self.new_account(email='*****@*****.**')
        someone_else_book = self.new_address_book(owner=someone_else)

        jane_book.allow(john, can_add_addresses=True, can_edit_addresses=True)
        someone_book.allow(john,
                           can_add_addresses=False,
                           can_edit_addresses=True)
        someone_else_book.allow(john,
                                can_add_addresses=False,
                                can_edit_addresses=False)

        Address(address_book=jane_book,
                email_address='*****@*****.**',
                name='Friend1').save()
        Address(address_book=jane_book,
                email_address='*****@*****.**',
                name='Friend2').save()
        Address(address_book=jane_book,
                email_address='*****@*****.**',
                name='Friend3').save()
        Address(address_book=jane_book,
                email_address='*****@*****.**',
                name='Friend4').save()

        Address(address_book=someone_book,
                email_address='*****@*****.**',
                name='Friend11').save()
        Address(address_book=someone_book,
                email_address='*****@*****.**',
                name='Friend12').save()
        Address(address_book=someone_book,
                email_address='*****@*****.**',
                name='Friend13').save()
        Address(address_book=someone_book,
                email_address='*****@*****.**',
                name='Friend14').save()

        Address(address_book=someone_else_book,
                email_address='*****@*****.**',
                name='Friend21').save()
        Address(address_book=someone_else_book,
                email_address='*****@*****.**',
                name='Friend22').save()
        Address(address_book=someone_else_book,
                email_address='*****@*****.**',
                name='Friend23').save()
        Address(address_book=someone_else_book,
                email_address='*****@*****.**',
                name='Friend24').save()
        Session.flush()
        Session.commit()
Example #4
0
    def do_demo_setup(self):

        Address(email_address='*****@*****.**', name='Friend1').save()
        Address(email_address='*****@*****.**', name='Friend2').save()
        Address(email_address='*****@*****.**', name='Friend3').save()
        Address(email_address='*****@*****.**', name='Friend4').save()

        Session.flush()
        Session.commit()
Example #5
0
def init():
    ExecutionContext().install()

    config_dir = sys.argv[1]
    config = StoredConfiguration(config_dir)
    config.configure()

    db_uri = config.reahlsystem.connection_uri
    print("DB URI = {}".format(db_uri))

    metadata.bind = db_uri

    setup()

    Session.commit()
Example #6
0
 def do_demo_setup(self):
     self.account
     Session.commit()
 def make_stuff(self):
     self.user
     Session.commit()