Re: [web2py] how do i return several rows from json using ajax?

2013-11-03 Thread Mihir Lade
still encounter the same error message.. SyntaxError: JSON.parse: unexpected character -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this

[web2py] Re: how do i return several rows from json using ajax?

2013-11-02 Thread Mihir Lade
I have made changes to the $.ajax which now gives me a different error but i think it's moving forward.. i have changed this line.. url:"{{=URL('suzannecollins', 'onlineStore', 'purchaseHistoryJson')}}", the error i encounte

[web2py] how do i return several rows from json using ajax?

2013-11-02 Thread Mihir Lade
hi, i have a function in a controller which queries the database if the user is logged in and then grabs the information using json (as below) def pruchaseHistoryJson(): if auth.user: rows = db(db.sale.auth_id == auth.user.id ).select(db.sale.title,

[web2py] Re: displaying associated information

2013-10-03 Thread Mihir Lade
my understanding behind how it should work is.. "when the products button is hit, it should grab the auth_id and pass it to some function, maybe something like "getProducts()" which then queries the products database and only returns the results which are associated with the auth_id" could be

[web2py] displaying associated information

2013-10-03 Thread Mihir Lade
hi guys, i am working on a part of a project where i need to display data associated with each author.. the author's page currently looks like: http://webeng.gwillz.com/suzannecollins/default/authors which is generated using the code: {{extend 'layout.html'}} Authors {{for Author in Autho

[web2py] Re: View not displaying the pictures

2013-01-17 Thread Mihir Lade
Actually got this to work however the issue now is its iterating thorugh the table and printing out the information twice.. so for example.. if i have one picture there is information next to that picture.. and the next picture should have another bit of info.. how do i get that to work? --

[web2py] View not displaying the pictures

2013-01-17 Thread Mihir Lade
Can't get my view to display the pictures in the database.. {{for xxx in records:}} {{pass}} Encounter error: Error traceback 1. 2. 3. 4. 5. 6. Traceback (most recent call last): File "I:\wdd-softw\web2py\gluon\restricted.p

[web2py] Re: Query not returning correct data

2013-01-17 Thread Mihir Lade
Hi Alan, Sorry for the late reply.. Table Definition: ##Customer table. db.define_table('Customer', Field('CustID', type = 'string', length = 10, notnull = True, unique = True), Field('Surname', type = 'string', length = 15, notnull = True), Field('FirstName', type = 'string', len

[web2py] Re: Query not returning correct data

2013-01-16 Thread Mihir Lade
Hello Sir, I've tried that however when I hit search flight button it returns an empty page with no data from the database... --

[web2py] Re: Query not returning correct data

2013-01-16 Thread Mihir Lade
Hi Anthony, I am currently working with this code: def displayFlights(): query1 = SQLTABLE(db().select(db.Flight.DepartureDate == request.vars.DepartureDate)) query2 = SQLTABLE(db().select(db.Flight.ArrivalLocation == request.vars.ArrivalLocation)) query3 = SQLTABLE(db().select(db

[web2py] Re: Query not returning correct data

2013-01-16 Thread Mihir Lade
Hi Anthony, I tired as you recommended above with the INPUT statement.. however another I encounter another ticket: if form.accepts(request.vars, session): AttributeError: 'tuple' object has no attribute 'accepts' --

[web2py] Re: Query not returning correct data

2013-01-16 Thread Mihir Lade
Hi Anthony, Thanks for the reply.. this all seems a bit out of my league.. --

[web2py] Re: Query not returning correct data

2013-01-16 Thread Mihir Lade
Hi Anthony, As mentioned on Stack Overflow: I am currently working with the FORM because this is very frustrating that the query isn't working properly or I can't seen to figure out how to get it working properly.. with the form this is the code that I am using.. this is just a prototype to

[web2py] Re: Query not returning correct data

2013-01-16 Thread Mihir Lade
Hi Alan, I tried changing to == however now it won't return any data at all... Another way i was trying was.. def displayFlights(): tuples=db((db.Flight.DepartureLocation is request.vars.DepartureLocation)& (db.Flight.ArrivalLocation is request.vars.ArrivalLocation)& (db.Fli

[web2py] Query not returning correct data

2013-01-16 Thread Mihir Lade
Hi Guys, I am currently working on a query which is meant to search the database and return the flights that the users wants.. The query is as follows: def displayFlights(): query1 = db.Flight.DepartureDate is request.vars.DepartureDate query2 = db.Flight.ArrivalLocation is request.vars.

[web2py] Re: Web2Py function to query the database...

2013-01-15 Thread Mihir Lade
ry. > > Anthony > > On Saturday, January 12, 2013 6:10:05 PM UTC-5, Mihir Lade wrote: >> >> Hi Alan, >> >> I've read the chapters a few times however having difficulty >> understanding a HTML search page would pass the information to a function >

[web2py] Re: Web2Py function to query the database...

2013-01-15 Thread Mihir Lade
Hi Anthony, Thanks for your reply. The code to searchFlights is as below: def searchFlights(): return dict() def show(): *receivedFlights = request.vars.originCity+','+request.vars.destCity+','+request.vars.type+','+request.vars.deptDate+','+request.vars.arrivalDate+','+request.vars.v

[web2py] Re: Web2Py function to query the database...

2013-01-12 Thread Mihir Lade
t; http://www.web2py.com/appliances > > Once you have learned using the basic API you can check for more examples > at: > > http://www.web2pyslices.com > > > El sábado, 12 de enero de 2013 07:13:11 UTC-3, Mihir Lade escribió: >> >> Hi Guys, >> >>

[web2py] Web2Py function to query the database...

2013-01-12 Thread Mihir Lade
Hi Guys, I am currently working on an assignment where I need to create a function which would query the database to search flights available according to the users input through the HTML form. I have attached a picture of the HTML form. Basically the user, selects the origin, the destination,