Exemplo n.º 1
0
def index(password):
    print >> sys.stderr, "within index"
    try:
        if password == PASSWORD:
            print >> sys.stderr, "within try"
            sellerList = Seller.select()
            smsList = SMS.select()
            numberList = Number.select()
            l = List.select()
            marketList = Market.select()
            lrList = ListRelationship.select()
            outboxList = Outbox.select()
            return render_template("index.html", title = 'TABLES', sellerList = sellerList, smsList = smsList, l = l, marketList = marketList)
            #return 'hello world'
        else:
            print >> sys.stderr, "wrong password"
    except:
        print >> sys.stderr, "within except"
        print >> sys.stderr, str(sys.exc_info()[0]) # These write the nature of the error
        print >> sys.stderr, str(sys.exc_info()[1])
        statement = 'An exception has Occured'+ str(sys.exc_type) + '[' + str(sys.exc_value) + ']'
        return statement
Exemplo n.º 2
0
def get_Mini_Sellers_ListNumbers(sellersListName):
    sellersListNumbers = []
    sellersList = List.get(List.name == sellersListName)
    for listRelationship in ListRelationship.select().where(ListRelationship.listName == sellersList):
        sellersListNumbers.append(listRelationship.number)
    return sellersListNumbers
Exemplo n.º 3
0
def check_ListRelationship_Exists(listObject, numberObject):
    for lr in ListRelationship.select():
        if lr.listName == listObject and lr.number == numberObject:
            print 'this list relationship already exists and was created by ' + str(lr.createdBy)
            return True
Exemplo n.º 4
0
def get_Mini_ListNames(number):
    listNames = []
    for l in ListRelationship.select().where(ListRelationship.number == number):
        listNames.append(l.listName.name)
    return listNames