Re: [web2py] SQL syntax error when trying to create db...

2012-05-23 Thread Johann Spies
On 24 May 2012 07:35, Jason Brower wrote: > Field ('user', db. > auth_user, label=T ( > "Creator")), > 'user' is a reserved word in many databases. I found a nice url to check reserved words in seve

[web2py] SQL syntax error when trying to create db...

2012-05-23 Thread Jason Brower
I get this: File"/home/jason/Desktop/InterestID_4/Development_Environment/gluon/dal.py",line1386,inlog_execute ret=self.cursor.execute(*a, **b) ProgrammingError:syntax error atornear"user" LINE4:user INTEGER REFERENCES auth_user(id)ON DELETE CASCADE, When web2py tries creating it's mode

Re: [web2py] Re: Problem tranfering to a new database...

2012-05-23 Thread Jason Brower
I was looking at dal.py and it seems to me, that it wants all the tables first in my DAL object, and will not create them. Just import them and if they don't exist it throws an error. It will take some time to create the database here but let's see if this fixes the problem. If so, a better e

Re: [web2py] bootstrap-pagination.js an

2012-05-23 Thread Annet
Hi Johann, Thanks for your reply. It gives me a starting point to find out how this plugin works. Best regards, Annet

[web2py] Who are logged in?

2012-05-23 Thread IVINH
HI, How can i know the users who are logged in? or number of client online? I will use "ram cache" to store information of each request (differentiated by IP or username)? Thanks for your suggestions.

Re: [web2py] Where do we submit book errata?

2012-05-23 Thread Shane Tzen
BTW: http://web2py.com/books/default/chapter/29/3 - "isx" should be "six" http://web2py.com/books/default/chapter/29/4 - Sentences - "The first time you start web2py, two new folders are created: deposit and applications. The "welcome" app is zipped into a "welcome.w2p" file to be used as a scaf

Re: [web2py] Re: Problem tranfering to a new database...

2012-05-23 Thread Jason Brower
I got the connection to work. However, it's now throwing the same error as before. Dang. This is on a blank database to csv. Attached... On 05/24/2012 12:54 AM, pbreit wrote: It might. Can you try with an empty DB? On Wednesday, May 23, 2012 10:50:48 AM UTC-7, encompass wrote: Would havin

Re: [web2py] Re: Problem tranfering to a new database...

2012-05-23 Thread Jason Brower
When I emptied my database locally and tried to connect to the server remotely I get ProgrammingError: ('FATAL','28000','no pg_hba.conf entry for host "85.23.56.232", user "postgres", database "postgres", SSL off') This is because I haven't setup this computer as a connectable host, I guess.

[web2py] Re: Send form submission to python script

2012-05-23 Thread pbreit
Oops. Thanks for catching. On Wednesday, May 23, 2012 3:41:51 PM UTC-7, Anthony wrote: > > def search(): >> import urllib >> q = request.args(0) >> > > That would have to be q = request.vars.q, not request.args(0). > > Anthony >

[web2py] Strange value for HTTP_HOST when using ssh tunneling

2012-05-23 Thread Chris
This seems like a problem in web2py or mod_wsgi -- or else I am confused. Would appreciate any pointers from the experts. I'm running web2py 1.99.7 on a Red Hat (RHEL 6) server using Apache 2.2.15 and mod_wsgi 3.3. This is all running on a small virtual server at Amazon Web Services. Since I

[web2py] Re: pass table name in rows

2012-05-23 Thread Anthony
Why not just: def index(): news = db(db.news.public == True).select(orderby=~db.news.added_on,limitby =(0,10)) articles = db(db.articles.public == True).select(orderby=~db.articles. added_on, limitby=(0,10)) return dict(news=news, articles=articles) {{for row in news:}} {{=H4(A(ro

[web2py] Re: gweb2py

2012-05-23 Thread Ricardo Pedroso
The url, of course: https://github.com/rpedroso/gweb2py On Thu, May 24, 2012 at 1:11 AM, Ricardo Pedroso wrote: > Hi, > > I've made lot's of changes. Lot's of bug fixes and > new features, mainly: >  reload webserver >  ability to create new application >  session files viewer >  cache file viewe

[web2py] gweb2py

2012-05-23 Thread Ricardo Pedroso
Hi, I've made lot's of changes. Lot's of bug fixes and new features, mainly: reload webserver ability to create new application session files viewer cache file viewer error files viewer file/new and file/open better syntax highlight when using StyledTextCtrl On Linux there is possible to u

Re: [web2py] Development Environments vs Live Environment

2012-05-23 Thread Jonathan Lundell
On May 23, 2012, at 8:40 AM, Anthony wrote: > If you use the built-in Rocket server in development but another server > (e.g., Apache, Nginx) on production, you could also do: > > if request.env.server_software.startswith('Rocket'): > con = 'sqlite://...' > etc. > The only real problem wit

[web2py] pass table name in rows

2012-05-23 Thread CtrlSoft
hi, i have this controller: def index(): rows1 = db(db.news.public == True).select(orderby=~db.news.added_on, limitby=(0,10)) rows2 = db(db.articles.public == True).select(orderby=~db.articles.added_on, limitby=(0,10)) rows = rows1.as_list()+rows2.as_list() return dict(ro

[web2py] Re: Send form submission to python script

2012-05-23 Thread Anthony
> > def search(): > import urllib > q = request.args(0) > That would have to be q = request.vars.q, not request.args(0). Anthony

[web2py] Re: Send form submission to python script

2012-05-23 Thread pbreit
I'd suggest keeping it simple. Maybe something like this: def search(): import urllib q = request.args(0) result1 = urllib.open('http://www.google.com/search?q=%s' % q) result2 = urllib.open('http://www.bing.com/search?q=%s' % q) result = result1 + result2 return dict(resul

[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

Re: [web2py] Re: Problem tranfering to a new database...

2012-05-23 Thread pbreit
It might. Can you try with an empty DB? On Wednesday, May 23, 2012 10:50:48 AM UTC-7, encompass wrote: > > Would having an empty table raise this error? > > On 05/23/2012 08:14 PM, pbreit wrote: > > Apparently choking on this line: > > > > elif not line.startswith('TABLE ') or not

Re: [web2py] json2excel

2012-05-23 Thread Manuele Pesenti
Il 22/05/2012 22:49, Richard Vézina ha scritto: Hello, Export to excel from json could make simpler the exportation of a excel file from web2py ?? well for manageing excell file I found that this library can help a lot... openpyxl.reader.excel if you are interested let's look for it in pypi

[web2py] custom SuggestLatLonWidget

2012-05-23 Thread Manuele Pesenti
I don't know if it could be difficult to implement it... I know that I need more js and jQuery knowledge to do it myself... I'd like to write a custom text widget that when I introduce a blank space after a word (supposed to be a name of a city, country, etc.) it uses the geocode function to su

Re: [web2py] json2excel

2012-05-23 Thread Derek
That's a java application anyway, not python - that website will not help at all. On Wednesday, May 23, 2012 2:28:06 PM UTC-7, Derek wrote: > > All you have to do to export to excel is return a html table and set the > headers content-type to -- application/vnd.ms-excel > Excel might complain t

Re: [web2py] json2excel

2012-05-23 Thread Derek
All you have to do to export to excel is return a html table and set the headers content-type to -- application/vnd.ms-excel Excel might complain that it's not properly an excel file, but it will open anyway, and display correctly. On Tuesday, May 22, 2012 1:49:11 PM UTC-7, Richard wrote: > > He

Re: [web2py] Re: Google Translate

2012-05-23 Thread Derek
Well, if you are using Google Chrome, it will offer to translate sites that are in a language that you don't understand. That works well enough for most websites. I don't bother to offer a "translate this site to your language" because if they want to do that, they can. If you care about people

[web2py] Re: hot to Run Python 2.5 scripts from python (for automating PSSE)

2012-05-23 Thread Derek
Then it is an unhandled exception. Which one? Run it in debug mode and see if you can get the stack trace. On Wednesday, May 23, 2012 10:50:41 AM UTC-7, Janath wrote: > > when following runs at the initialisation, even the web2py server goes > down. the line in the bold face, tries to initialise

[web2py] Redirecting to a mobile website?

2012-05-23 Thread RKS
What is the best way to redirect uses to the mobile version of your site? I.e. redirecting to http://m.yoursite.com when it detects a mobile viewport? I tried to do this the normal way that I redirect in other places but I keep getting invalid errors. We're just using js to detect the browser and

Re: [web2py] Re: Problem tranfering to a new database...

2012-05-23 Thread Jason Brower
Would having an empty table raise this error? On 05/23/2012 08:14 PM, pbreit wrote: Apparently choking on this line: elif not line.startswith('TABLE ') or not line[6:] in self.tables: raise SyntaxError, 'invalid file format' Does your file look OK when taking this

[web2py] Re: hot to Run Python 2.5 scripts from python (for automating PSSE)

2012-05-23 Thread Janath
when following runs at the initialisation, even the web2py server goes down. the line in the bold face, tries to initialise psse and make trouble. for me it seems, that psse needs the exact version (which is 2.5) to run the api commands. (I am not sure whether it checks the registry entry for p

Re: [web2py] Re: DesignPatterns

2012-05-23 Thread pbreit
Do you have a link?

[web2py] Re: Problem tranfering to a new database...

2012-05-23 Thread pbreit
Apparently choking on this line: elif not line.startswith('TABLE ') or not line[6:] in self.tables: raise SyntaxError, 'invalid file format' Does your file look OK when taking this into consideration? Hard to think linefeeds are the problem but you could try saving t

[web2py] Problem tranfering to a new database...

2012-05-23 Thread Jason Brower
I now have the database up and running, but when I try to do this: db.export_to_csv_file(open('/home/www-data/web2py/applications/welcome/uploads/file.csv', 'wb')) db2.import_from_csv_file(open('/home/www-data/web2py/applications/welcome/uploads/file.csv', 'rb')) It tells me: Traceback(most

Re: [web2py] Re: How to prevent delete of a row with SQLFORM.grid -

2012-05-23 Thread Jim Steil
FWIW - I'm seeing the same behavior. -jim On 5/23/2012 10:29 AM, François Delpierre wrote: ... working but I have a side effect : It looks like the "Delete" on a row is just removing the row from the screen, without full refresh of the page. So, the last line is always "deletable", but i

Re: [web2py] Re: Trying to create a DAL connection and getting some errors...

2012-05-23 Thread Jason Brower
And I just noticed the comment here: "Creating new tables dynamically is not allowed." Isn't this just what I am about to do? --- BR, Jason Brower On 05/23/2012 07:04 PM, Massimo Di Pierro wrote: This has been fixed in trunk some time ago self.driver = drivers.get('pg8000') should be self.d

[web2py] Re: Trying to create a DAL connection and getting some errors...

2012-05-23 Thread Massimo Di Pierro
This has been fixed in trunk some time ago self.driver = drivers.get('pg8000') should be self.driver = self.drivers.get('pg8000') On Wednesday, 23 May 2012 11:01:59 UTC-5, encompass wrote: > > In the console I type this: > db2 = DAL('postgres://postgres:@localhost:5432/postgres')

[web2py] Re: How to prevent delete of a row with SQLFORM.grid -

2012-05-23 Thread Massimo Di Pierro
It should do an ajax callback. Use chrome to see what is going on there. On Wednesday, 23 May 2012 10:29:36 UTC-5, François Delpierre wrote: > > ... working but I have a side effect : > > It looks like the "Delete" on a row is just removing the row from the > screen, without full refresh of the p

Re: [web2py] Development Environments vs Live Environment

2012-05-23 Thread Jason Brower
On 05/23/2012 06:40 PM, Anthony wrote: If you use the built-in Rocket server in development but another server (e.g., Apache, Nginx) on production, you could also do: || ifrequest.env.server_software.startswith('Rocket'): con ='sqlite://...' etc. Anthony On Wednesday, May 23, 2012 11:14:1

[web2py] Trying to create a DAL connection and getting some errors...

2012-05-23 Thread Jason Brower
In the console I type this: db2 = DAL('postgres://postgres:@localhost:5432/postgres') And I get this: In [7] : print "hi" hi In [8] : db2 = DAL('postgres://postgres:@localhost:5432/postgres') DEBUG: connect attempt 0, connection error: Traceback (most recent call last): File "/h

Re: [web2py] Development Environments vs Live Environment

2012-05-23 Thread Anthony
If you use the built-in Rocket server in development but another server (e.g., Apache, Nginx) on production, you could also do: if request.env.server_software.startswith('Rocket'): con = 'sqlite://...' etc. Anthony On Wednesday, May 23, 2012 11:14:18 AM UTC-4, rochacbruno wrote: > > if requ

[web2py] Re: How to prevent delete of a row with SQLFORM.grid -

2012-05-23 Thread François Delpierre
... working but I have a side effect : It looks like the "Delete" on a row is just removing the row from the screen, without full refresh of the page. So, the last line is always "deletable", but in fact it does not deletes.

Re: [web2py] Development Environments vs Live Environment

2012-05-23 Thread Bruno Rocha
if request.is_local(): con = "sqlite://." else: con = "postgres://..." db = DAL(con) On Wed, May 23, 2012 at 12:06 PM, Jason Brower wrote: > Locally I only want to use SQLite. And on the deployment I want to use > Postgres. > Is there a way to make this happen automatically? > BR,

[web2py] Development Environments vs Live Environment

2012-05-23 Thread Jason Brower
Locally I only want to use SQLite. And on the deployment I want to use Postgres. Is there a way to make this happen automatically? BR, Jason Brower

[web2py] Re: bug with authenticated email

2012-05-23 Thread Massimo Di Pierro
Thanks. fixed in trunk. On Tuesday, 22 May 2012 17:07:05 UTC-5, Carlos wrote: > > Hi, > > Using latest web2py trunk, there's a bug with authenticated email in > Mail.send (line # 649) @ tools.py. > >if *not *self.settings.login: > > Must remove "not". > > Thanks, > >Carlos > >

[web2py] Re: A web2py BBS in c-hina has been launched, since in c-hina, this web2py group is forbidden.

2012-05-23 Thread Massimo Di Pierro
Added to the list of web2py users groups. Thanks and welcome to all our new chinese friends :-) On Wednesday, 23 May 2012 05:08:27 UTC-5, web2py_lover wrote: > > A web2py BBS in c-hina has been launched, since in c-hina, this web2py > group is forbidden. > > http://web2py.sinaapp.com/ > >

[web2py] Re: Cron problems

2012-05-23 Thread Massimo Di Pierro
Please open a ticket about this. cron was not designed to do this but there is no reason it cannot do it. On Tuesday, 22 May 2012 22:33:57 UTC-5, Michael Toomim wrote: > > I'm finding multiple problems getting cron to start the scheduler. Here's > the cron line: > @reboot dummyuser python web

[web2py] Re: auth.has_membership(None) == True # is this correct?

2012-05-23 Thread Massimo Di Pierro
I do not have a strong opinion on this. If other people feel it should be changed we can, as it is an undocumented behavior. On Tuesday, 22 May 2012 22:03:49 UTC-5, weheh wrote: > > LOL. I mean, we could get quantum and say everybody is a member of None > (nothing), which is what web2py appears

[web2py] Re: hot to Run Python 2.5 scripts from python (for automating PSSE)

2012-05-23 Thread Massimo Di Pierro
Can you point us to some code? On Tuesday, 22 May 2012 21:07:37 UTC-5, Janath wrote: > > I have written python scripts to automate PSSE (Siemens power system > simulation tool) using the pythonAPI provided. > > I can run them using the gui I have made for python 2.5. > > Psse 32 needs the exact

[web2py] Re: bug with authenticated email

2012-05-23 Thread Carlos
http://code.google.com/p/web2py/issues/detail?id=818 On Tuesday, May 22, 2012 5:07:05 PM UTC-5, Carlos wrote: > > Hi, > > Using latest web2py trunk, there's a bug with authenticated email in > Mail.send (line # 649) @ tools.py. > >if *not *self.settings.login: > > Must remove "not". > > Tha

Re: [web2py] Re: Google Translate

2012-05-23 Thread Bruce Wade
Thanks for the feed back, I suppose it is more like a toy or for people who can't afford or don't know anyone to do a professional translation. I think it maybe a good start for some sites who are just starting out and want to see which languages are most used on their site. (You can track google t

[web2py] Re: Google Translate

2012-05-23 Thread greaneym
It is fine if you want to figure out vocabulary, but it is not very good with grammatical structures, yet. It keeps improving though. On Tuesday, May 22, 2012 5:56:44 PM UTC-5, Bruce Wade wrote: > > Has anyone tried this before? http://translate.google.com/translate_tools > > -- > -- > Regards

[web2py] Re: db two selects

2012-05-23 Thread BlueShadow
thank you so much for your help you really made my day > rows=db().select(db.Article.ALL, orderby=~db.Article.Submitted, limitby=(0 >> ,5)).sort(lambda row: >> row.Views, reverse=True) >> >

[web2py] Re: db two selects

2012-05-23 Thread Anthony
Documentation here: http://web2py.com/books/default/chapter/29/6#find,-exclude,-sort (though it appears the "reverse" argument isn't documented). Anthony On Wednesday, May 23, 2012 9:13:24 AM UTC-4, Anthony wrote: > > Sorry, I misunderstood what you were trying to do. I thought you wanted to >

[web2py] Re: db two selects

2012-05-23 Thread Anthony
Sorry, I misunderstood what you were trying to do. I thought you wanted to sort by date submitted and then by views, but you simply want to select the 5 most recently submitted and then sort those 5 by views only. To do that, first select the 5 most recent, and then use the Rows.sort() method:

Re: [web2py] Re: like face book post and power by web2py

2012-05-23 Thread Michele Comitini
Or you can use chromedriver. https://code.google.com/p/selenium/wiki/ChromeDriver mic 2012/5/23 Anthony : > Sorry, the web2py poweredby site does not automatically grab screenshots -- > when you add a site, you have to manually upload a thumbnail image of the > site. > > Anthony > > > On Wednes

[web2py] Re: like face book post and power by web2py

2012-05-23 Thread Anthony
Sorry, the web2py poweredby site does not automatically grab screenshots -- when you add a site, you have to manually upload a thumbnail image of the site. Anthony On Wednesday, May 23, 2012 4:55:26 AM UTC-4, Ramkrishan Bhatt wrote: > > We have create a post where people can post url, meesage e

Re: [web2py] A web2py BBS in c-hina has been launched, since in c-hina, this web2py group is forbidden.

2012-05-23 Thread Carlos Costa
好的。 Good. 2012/5/23 web2py_lover : > A web2py BBS in c-hina has been launched, since in c-hina, this web2py group > is forbidden. > > http://web2py.sinaapp.com/ > > -- Carlos J. Costa Cientista da Computação Esp. Gestão em Telecom EL MELECH NEEMAN! אָמֵן

[web2py] A web2py BBS in c-hina has been launched, since in c-hina, this web2py group is forbidden.

2012-05-23 Thread web2py_lover
A web2py BBS in c-hina has been launched, since in c-hina, this web2py group is forbidden. http://web2py.sinaapp.com/

[web2py] like face book post and power by web2py

2012-05-23 Thread Ramkrishan Bhatt
We have create a post where people can post url, meesage etc like face book where we need to fatch automatically thumnail or screenshot whith some text ot titel. we are using web2py please suggest us best way to buid. Since its already there in power by web2py i am sure Massimo can share code fo

Re: [web2py] Google Translate

2012-05-23 Thread Johann Spies
On 23 May 2012 00:56, Bruce Wade wrote: > Has anyone tried this before? http://translate.google.com/translate_tools > Yes, I have played with it. It is interesting, but if you want a professional job done, you will have to do the translation by hand. As it is, it is a tool that can give someb

Re: [web2py] bootstrap-pagination.js an

2012-05-23 Thread Johann Spies
On 22 May 2012 18:42, Annet wrote: > > The common usage is like this: > > function callback(page){ > //do what you want to do > } > > This is an empty function. I suspect the code below has to go in before the last } > var options = { > pageRows:page_nums > , onChange:callback > , next: 'Ne