Ejemplo n.º 1
0
 def setUpAll(self):
     global data
     tables.create()
     mapper(tables.User, tables.users, properties = dict(
         address = relation(mapper(tables.Address, tables.addresses), lazy = False, uselist = False, private = True),
         orders = relation(
             mapper(tables.Order, tables.orders, properties = dict (
                 items = relation(mapper(tables.Item, tables.orderitems), lazy = False, uselist =True, private = True)
             )), 
             lazy = True, uselist = True, private = True)
     ))
Ejemplo n.º 2
0
def home():
    title=request.form.get("title",None)
    material=request.form.get("material",None)
    #print title
    #print material
    #Add sqlite3 interface for title and material of posts
    tables.create()
    #dict = tables.loadDict()
    if (title != None and material != None):
        tables.insert(title, material)
        dict[title] = material
        #return render_template("postbase.html",title=title,post=material,comments=[])
        return redirect("/" + title)
    else:
        return render_template("home.html",dict=dict)
Ejemplo n.º 3
0
 def setUp(self):
     self.conn = sqlite3.connect(':memory:')
     self.conn.row_factory = namedtuple_factory
     self.c = self.conn.cursor()
     tables.create(self.conn)
     logging.info('Setting up %s', self._testMethodName)
Ejemplo n.º 4
0
 def setUpAll(self):
     tables.create()
     tables.data()
Ejemplo n.º 5
0
 def setUpAll(self):
     tables.create()
Ejemplo n.º 6
0
 def setUpAll(self):
     tables.create()
     tables.data()
Ejemplo n.º 7
0
 def setUp(self):
     self.conn = sqlite3.connect(':memory:')
     self.conn.row_factory = namedtuple_factory
     self.c = self.conn.cursor()
     tables.create(self.conn)
Ejemplo n.º 8
0
 def setUp(self):
     self.conn = sqlite3.connect(':memory:')
     self.conn.row_factory = namedtuple_factory
     self.c = self.conn.cursor()
     tables.create(self.conn)
     logging.info('Setting up %s', self._testMethodName)
Ejemplo n.º 9
0
 def setUpAll(self):
     tables.create()