[web2py] Web2py for full site - novice question

2013-02-22 Thread adohertyd
I'm familiar with web2py for building a web app and I have no problem with it but I'm now looking at building my own complete website which will have a structure as follows: 1. Home page: Small bio and introduction along with recent tweets, blog posts, news stories etc 2. Portfolio page: portfo

[web2py] Re: if statement with multiple conditions in view

2012-08-03 Thread adohertyd
I'm sorry guys I'm an idiot. I've just spotted my mistake in the code. It was a naming error leaving ConditionB not being assigned. Sorry for wasting your time thanks for the help. On Saturday, 4 August 2012 00:34:50 UTC+1, adohertyd wrote: > > Just wondering if anyone has

Re: [web2py] if statement with multiple conditions in view

2012-08-03 Thread adohertyd
t;}} returns output. The problem is definitely the multiple condition On Saturday, 4 August 2012 00:47:19 UTC+1, Jonathan Lundell wrote: > > On 3 Aug 2012, at 4:45 PM, adohertyd wrote: > > Yes that's correct. The data comes from a radio button so the 2 conditions > are always t

Re: [web2py] if statement with multiple conditions in view

2012-08-03 Thread adohertyd
Yes that's correct. The data comes from a radio button so the 2 conditions are always true or false (boolean) On Saturday, 4 August 2012 00:40:53 UTC+1, Jonathan Lundell wrote: > > On 3 Aug 2012, at 4:34 PM, adohertyd wrote: > > Just wondering if anyone has a solution to t

[web2py] if statement with multiple conditions in view

2012-08-03 Thread adohertyd
Just wondering if anyone has a solution to this. I have an if statement in a view: {{if conditionA == True:}} {{for obj in ListA:}} {{=obj}} {{pass}} {{pass}} This works fine. Now, if I add another condition to the if statement, that I know exists: {{if conditionA == True and conditionB==Tru

[web2py] Simple guide to putting my application online

2012-07-31 Thread adohertyd
Can anyone give me a simple guide to putting my web2py app online? I have been looking for ages and getting nowhere. The book is too complicated for me to understand what I'm meant to do. I need to be able to access the application from another computer for testing purposes. I also have to make

[web2py] Re: Changing a function variable from a view

2012-07-26 Thread adohertyd
Display?userQuery=suggestion. The suggestion will > then be accessible as request.vars.userQuery in the resultsDisplay function. > > Anthony > > On Thursday, July 26, 2012 5:52:34 PM UTC-4, adohertyd wrote: >> >> How do I assign the query value to the request.vars? I'm ok

[web2py] Re: Changing a function variable from a view

2012-07-26 Thread adohertyd
w userQuery. > In the resultsDisplay function, check for a userQuery in request.vars, and > if present, process that value instead of processing session.userQuery. > > Anthony > > On Thursday, July 26, 2012 4:21:22 PM UTC-4, adohertyd wrote: >> >> I posted a related

[web2py] Changing a function variable from a view

2012-07-26 Thread adohertyd
I posted a related question earlier but given the response I don't think my question was clear. My index page contains a form and the index() function assigns the user input in this form to a variable: session.userQuery session.userquery is then processed in resultsDisplay() and sent to a numbe

[web2py] Re: Replacing session.var with another value

2012-07-26 Thread adohertyd
= {} # for a dictionary > > > > On Thursday, July 26, 2012 8:43:33 AM UTC-4, adohertyd wrote: >> >> Hope you guys can give me a hand here. I have two central functions in my >> controller: index() and resultsDisplay() >> >> In index() the user enters a s

Re: [web2py] Replacing session.var with another value

2012-07-26 Thread adohertyd
It's not the auto complete function that I'm looking for. I just want the form to be populated with the original search term, and to be able to submit a new search term from the results page On Thursday, 26 July 2012 14:34:05 UTC+1, Johann Spies wrote: > > On 26 July 2012 14:43,

[web2py] Re: Replacing session.var with another value

2012-07-26 Thread adohertyd
conditionally show results if there are any. > > Anthony > > On Thursday, July 26, 2012 8:43:33 AM UTC-4, adohertyd wrote: >> >> Hope you guys can give me a hand here. I have two central functions in my >> controller: index() and resultsDisplay() >> >> I

[web2py] Replacing session.var with another value

2012-07-26 Thread adohertyd
Hope you guys can give me a hand here. I have two central functions in my controller: index() and resultsDisplay() In index() the user enters a string into a form and it is assigned to session.var.a session.var.a is passed to resultsDisplay() and it is processed. In the resultsDisplay() view,

[web2py] Re: Pagination with no database

2012-07-23 Thread adohertyd
ecords = 137 > records_per_page = 10 > urls = [URL('myapp', 'mycontroller', 'myfunction', args=[page+1]) forpage > in range(all_records+1)] > > > > On Monday, July 23, 2012 10:20:48 PM UTC+2, adohertyd wrote: >> >> I have an application tha

[web2py] Pagination with no database

2012-07-23 Thread adohertyd
I have an application that returns a list of between 50-100 items. I have no database layer it isn't required for my app. I want to display 10 of those items on a page, and only generate the number of pages needed to view those results. Can anyone point me in the right direction (not the docs,

[web2py] Altering the appearance of form fields & buttons

2012-07-18 Thread adohertyd
I have a form that is generated in the controller as follows: form = FORM( INPUT(_name='query', requires=IS_NOT_EMPTY()), INPUT(_type='submit')) if form.process().accepted: session.term=request.vars.query redirect(URL('results_page')) else:

[web2py] Re: Accessing non-returned items in Views

2012-07-17 Thread adohertyd
Simple as that :) thanks Massimo Web2py is fantastic On Tuesday, 17 July 2012 22:45:48 UTC+1, Massimo Di Pierro wrote: > > replace > > return dict(ReturnedDict = OtherDict) > > with > > return locals() > > On Tuesday, 17 July 2012 16:40:00 UTC-5, adohertyd wrote: &

Re: [web2py] Accessing non-returned items in Views

2012-07-17 Thread adohertyd
I need all of them! On Tuesday, 17 July 2012 22:47:02 UTC+1, Lucas R. Martins wrote: > > Just curious: > > There is a special reason to not simply return the needed dicts? > > Em Ter 17 Jul 2012 18:40:00 BRT, adohertyd escreveu: > > In my function page2(): I return a d

[web2py] Accessing non-returned items in Views

2012-07-17 Thread adohertyd
In my function page2(): I return a dictionary to be accessed by the page2 HTML view. In the page2 function I have some other dictionaries. What I want to do to be able to use the non-returned dictionaries in the HTML code to show some items. This is a sample of what I want: Hope it's clear def

[web2py] Re: No handlers could be found for logger web2py

2012-07-13 Thread adohertyd
Ok managed to sort it. Uninstalled python and pywin32. Reinstalled 32 bit version of python and ran pywin32 installer in compatibility mode after seeing someone posting an issue in a different forum. Problem solved On Friday, 13 July 2012 13:18:06 UTC+1, adohertyd wrote: > > I had ini

[web2py] No handlers could be found for logger web2py

2012-07-13 Thread adohertyd
I had initially installed the binary version of web2py with Python version 2.5 built in. I needed 2 or 3 modules that were only compatible with version 2.7 so I installed the source version of web2py instead and downloaded the 64 bit version of pywin32. All was working fine. I then needed to in

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
want. (Maybe there is a limit but I have no idea what it is) > The dictionary names/keys can be whatever you want to call them. > > Then in your results.html > > {{=results_1}} > {{=results_2}} > {{=results_3}} > > On Thu, Jul 5, 2012 at 1:41 PM, adohertyd wrote: > &g

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
> On Thu, Jul 5, 2012 at 1:34 PM, adohertyd wrote: > >> Yeah it works now. Thanks very much Bruce much appreciated. Still have >> quite a bit to learn about all of this stuff. >> >> >> On Thursday, 5 July 2012 21:32:10 UTC+1, Bruce Wade wrote: >> >&

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
Jul 5, 2012 at 1:30 PM, adohertyd wrote: > >> Thanks Bruce will try that. Why does 'return blekkoresults' work though? >> >> >> On Thursday, 5 July 2012 21:24:53 UTC+1, Bruce Wade wrote: >> >>> Ok exactly it is complaining that {{=results}} do

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
r > controller > > On Thu, Jul 5, 2012 at 1:23 PM, adohertyd wrote: > >> This is my results.html, all of it :) >> >> {{extend 'layout.html'}} >> >> {{=results}} >> >> On Thursday, 5 July 2012 21:20:59 UTC+1, Bruce Wade wrote: >

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
s,bingresults > we would need to see results.html > > On Thu, Jul 5, 2012 at 1:16 PM, adohertyd wrote: > >> No tried that and got 'unsupported format character 'A' at index 7' >> >> >> On Thursday, 5 July 2012 21:08:20 UTC+1, Richard wrote: &

Re: [web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
No tried that and got 'unsupported format character 'A' at index 7' On Thursday, 5 July 2012 21:08:20 UTC+1, Richard wrote: > > Maybe you should encode your bing url. > > Richard > > On Thu, Jul 5, 2012 at 4:05 PM, adohertyd wrote: > >> I am trying

[web2py] Redirect not working can't find issue

2012-07-05 Thread adohertyd
I am trying to get a json response from 2 URL's and showing in on a results page. I'm getting an error saying that the page I'm redirecting to in order to show the json data is not defined but this only happens with one of the url's being contacted. I'm probably not being very clear with this so

Re: [web2py] Re: Dict object has no attribute 'rstrip'

2012-07-05 Thread adohertyd
w is outputting the json data but that's another beast entirely. Thanks for your time and help Jonathan On Thursday, 5 July 2012 16:06:16 UTC+1, Jonathan Lundell wrote: > > On 5 Jul 2012, at 8:04 AM, adohertyd wrote: > > Oh I see now. Ok tried to implement that still no joy. I

Re: [web2py] Re: Dict object has no attribute 'rstrip'

2012-07-05 Thread adohertyd
Oh I see now. Ok tried to implement that still no joy. I'm trying a number of different things still no luck. It's just a matter of perseverance I think! On Thursday, 5 July 2012 15:49:50 UTC+1, Jonathan Lundell wrote: > > On 5 Jul 2012, at 7:47 AM, adohertyd wrote: > > N

[web2py] Re: Dict object has no attribute 'rstrip'

2012-07-05 Thread adohertyd
No that's not it either Jonathan. The problem I think is with the {'term' : urllib.quote(term)}. I think that because 'term' is a dict type, the urllib.quote is having issues with it. On Thursday, 5 July 2012 14:55:06 UTC+1, adohertyd wrote: > > Me again! I d

Re: [web2py] Dict object has no attribute 'rstrip'

2012-07-05 Thread adohertyd
amp;$format=json " API_KEY= 'mykey' term = __process() r = requests.get(URL % {'term': urllib.quote(term)}, auth=('', API_KEY)) bingresults = r.json['d']['results'] On Thursday, 5 July 2012 15:12:20 UTC+1, Jonathan Lundell wrote

[web2py] Dict object has no attribute 'rstrip'

2012-07-05 Thread adohertyd
Me again! I don't know why I am getting this error. The process() function takes in a value session.term, processes it, and returns it as a dict type so that it can be mapped to URL's in the next function. The results() function sends the variable 'term' to 3 different API URL's which all shoul

[web2py] Re: Send HTML form submission to python script

2012-07-04 Thread adohertyd
Thanks Anthony. This has been bothering me for ages because I couldn't decide where to put the python code. Much appreciated. On Wednesday, 4 July 2012 14:10:02 UTC+1, Anthony wrote: > > Thanks for that but it doesn't really answer my question. When I return >> dict(results=results), I want to p

[web2py] Re: Send HTML form submission to python script

2012-07-04 Thread adohertyd
Hi Massimo, Thanks for that but it doesn't really answer my question. When I return dict(results=results), I want to pass that to a script, lets say 'process.py' to tokenize it etc. My question is: Do I create a new controller called process.py (which won't have a corresponding HTML page), or

[web2py] Send HTML form submission to python script

2012-07-03 Thread adohertyd
I need to send some HTML form data to a python script for formatting but don't know how to do this. The user enters the data into a HTML form. The data is sent to a script where it is cleaned up and tokenized. The revised data is sent to another python function where it is to be used. How do I g

[web2py] Obtaining search results from Blekko API

2012-07-03 Thread adohertyd
Hi all, I'm trying to get to grips with web2py. I want to get the user to fill in a search form, the term they search for is sent to my python script which should send the query to the blekko API and output the results to them in a new HTML page. I've implemented the following code but instead

[web2py] Send form submission to python script

2012-05-23 Thread adohertyd
I'm new to both python and web2py. I'm trying to build a meta-search engine and I need the search box to send the user input to a python script which will pre-process the query and obtain the results from 3 different search engines. I've created a very basic HTML form as in the example in the bo