Exemple #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)
     ))
Exemple #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)
Exemple #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)
Exemple #4
0
 def setUpAll(self):
     tables.create()
     tables.data()
Exemple #5
0
 def setUpAll(self):
     tables.create()
 def setUpAll(self):
     tables.create()
     tables.data()
 def setUp(self):
     self.conn = sqlite3.connect(':memory:')
     self.conn.row_factory = namedtuple_factory
     self.c = self.conn.cursor()
     tables.create(self.conn)
Exemple #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)
Exemple #9
0
 def setUpAll(self):
     tables.create()