Re: [web2py] Python for Android (any takers to run web2py)
I'll try as soon as possible! I've previously used sl4a + python and web2py works flawlessy, but it a bit difficult to setup, it cannot be done by a newbie like installing an apk! 2012/1/9 Marco Mansilla > El Mon, 9 Jan 2012 00:08:09 -0200 > Bruno Rocha escribió: > > > Look this project > > > > https://github.com/kivy/python-for-android > > > > May be someone has time to spend trying to run web2py with this. > > > > > > here's a little more info, looks nice > > http://txzone.net/2012/01/introducing-python-for-android/ > -- Profile: http://it.linkedin.com/in/compagnucciangelo
[web2py] AttributeError: 'Rows' object has no attribute '_db'
Hi All, Why do I get this error Error - AttributeError: 'Rows' object has no attribute '_db'. Please have a look at the code given below. Whenever I hit the myfriends url, I get the below issue. =ERROR Ticket ID 127.0.0.1.2012-01-09.16-23-52.fb79b661-40af-4431-bdfa-7f1d5d3af482 'Rows' object has no attribute '_db' Version web2py™ (1, 99, 4, datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable') Python Python 2.7.2: C:\Python27\python.exe Traceback 1.2.3.4.5.6.7.8.9.10.11.12. Traceback (most recent call last): File "D:\WEB2PY\web2py\gluon\restricted.py", line 204, in restrictedexec ccode in environment File "D:/WEB2PY/web2py/applications/Build_Connect/controllers/ default.py", line 735, in File "D:\WEB2PY\web2py\gluon\globals.py", line 172, in self._caller = lambda f: f() File "D:/WEB2PY/web2py/applications/Build_Connect/controllers/ default.py", line 707, in myfriendscsv=False, maxtextlength=128, paginate=50) File "D:\WEB2PY\web2py\gluon\sqlhtml.py", line 1455, in griddb = query._dbAttributeError: 'Rows' object has no attribute '_db' = ---Here's the code- My Controller: #This lists friends def myfriends(): db.friends.id.readable=False query = db((db.friends.reguserid==session.logged_in_user_id) & (db.friends.status=="Friend")).select(db.friends.friend_name) print db._lastsql fields = (db.friends.id, db.friends.reguserid, db.friends.friendid, db.friends.status, db.friends.friend_name,) headers ={'friends.id': 'ID', 'friends.reguserid': 'ReguserID', 'friends.friendid': 'FriendID', 'friends.status': 'Status', 'friends.friend_name': 'Friend Name', } #default_sort_order = [db.friends.friendid] #, db.projects_posts.expected_start_date links = [lambda row: A(SPAN(_class='icon check'),'View Profile',_class='positive button',_title='View this friends profile', _href=URL("default","view_friend_profile",args=[row.friendid])), lambda row: A(SPAN(_class='icon cross'),'Remove Friend',_class='negative button',_title='Remove from friend list', _href=URL("default","remove_friend",args=[row.friendid]))] table = SQLFORM.grid( query=query, #fields=fields, #headers=headers, #orderby=default_sort_order, user_signature=False, links=links, create=False, searchable=False, details=False, showbuttontext=False, deletable=False, editable=False, csv=False, maxtextlength=128, paginate=50) return dict(table=table) #View Friends Profile def view_friend_profile(): session.myfriendid = request.args[0] #print session.myfriendid query = db(db.reguser.id==session.myfriendid).select() table = SQLFORM.grid(query=query) return dict(table= table) #Remove Friend from Friends list def remove_friend(): session.myfriendid = request.args[0] db((db.friends.reguserid==session.logged_in_user_id) & (db.friends.friendid==session.myfriendid) ).update(status='Rejected') #print db._lastsql return dict() x--- My View: (myfriends.html) {{extend 'layout.html'}} Friends List {{=table}} ---x- My Table in db.py reqstatus = ["Friend","Rejected","Sent"] db.define_table('friends', Field('reguserid'), Field('friendid'), Field('status', requires=IS_IN_SET(reqstatus)), Field('friend_name'), ) I am using - web2py1.99.4 , Win7 and python 2.7 Sincerely, Rahul D
[web2py] Re: Receiving Email
I am working in a prototype to encapsulate imap queries and mails with imaplib to interface with simple web2py commands. Is there any prior implemetation available (web2pyslice, open source app/plugin)? The idea is to support imap queries like this (just a subset of db query operations): mail_query = mail.date > date_obj & mail.body.contains("") & mail.box=="inbox" Then the user should be able to retrieve messages as rows with: db(mail_query).select() or get and set service elements like mailbox names with dot syntax: >>print mail.settings.add_box("mybox") >>True >>print mail.mailboxes ["inbox", "sent", "other"] I think this is not a trivial implementation and perhaps DAL should not be used for this feature since it is not intended for imap database interface, i suppose. But the syntax would be very coherent with other queries On 8 ene, 08:36, Peter O wrote: > Hihi, after a quick look at the code and the past discussions of the forum, > I found the Mail class doesn't read emails. Is that right? > > There are python modules doing this. Just want to do make sure, before I > start. > > Thank you very much.
[web2py] Re: Receiving Email
A mistake: > ...mail.settings.add_box("mybox") would be mail.add_box("mybox"), i don't want to modify the Storage class
[web2py] Re: AttributeError: 'Rows' object has no attribute '_db'
Please Note, if I use this alternate query (just to test) -- It would not give me the error BUT, this is not the query I intend to run.. #query = ((db.friends.reguserid==session.logged_in_user_id) and (db.friends.status=="Sent")) It gives me the error even if I use below query-- query = db.executesql("Select friend_name from friends where status='Friend' and reguserid=" + "%s" % session.logged_in_user_id) Can anyone provide a quick help and let me know what I am doing wrong here...? Also I am unable to understand this error message. :( Sincerely, Rahul D On Jan 9, 4:12 pm, Rahul wrote: > Hi All, > Why do I get this error Error - AttributeError: 'Rows' object > has no attribute '_db'. Please have a look at the code given below. > Whenever I hit the myfriends url, I get the below issue. > =ERROR > Ticket ID > 127.0.0.1.2012-01-09.16-23-52.fb79b661-40af-4431-bdfa-7f1d5d3af482 > 'Rows' object has no attribute > '_db' > > Version > web2py™ > (1, 99, 4, datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable') > > Python > Python 2.7.2: C:\Python27\python.exe > > Traceback > 1.2.3.4.5.6.7.8.9.10.11.12. > Traceback (most recent call last): > File "D:\WEB2PY\web2py\gluon\restricted.py", line 204, in > restricted exec ccode in environment > File "D:/WEB2PY/web2py/applications/Build_Connect/controllers/ > default.py", line 735, in > File "D:\WEB2PY\web2py\gluon\globals.py", line 172, in > self._caller = lambda f: f() > File "D:/WEB2PY/web2py/applications/Build_Connect/controllers/ > default.py", line 707, in myfriends csv=False, maxtextlength=128, > paginate=50) > File "D:\WEB2PY\web2py\gluon\sqlhtml.py", line 1455, in grid db = > query._dbAttributeError: 'Rows' object has no attribute '_db' > > = > > ---Here's the code- > My Controller: > > #This lists friends > def myfriends(): > db.friends.id.readable=False > query = db((db.friends.reguserid==session.logged_in_user_id) & > (db.friends.status=="Friend")).select(db.friends.friend_name) > print db._lastsql > > fields = (db.friends.id, db.friends.reguserid, > db.friends.friendid, db.friends.status, db.friends.friend_name,) > headers ={'friends.id': 'ID', > 'friends.reguserid': 'ReguserID', > 'friends.friendid': 'FriendID', > 'friends.status': 'Status', > 'friends.friend_name': 'Friend Name', > } > > #default_sort_order = [db.friends.friendid] #, > db.projects_posts.expected_start_date > > links = [lambda row: A(SPAN(_class='icon check'),'View > Profile',_class='positive button',_title='View this friends profile', > _href=URL("default","view_friend_profile",args=[row.friendid])), > lambda row: A(SPAN(_class='icon cross'),'Remove > Friend',_class='negative button',_title='Remove from friend list', > _href=URL("default","remove_friend",args=[row.friendid]))] > > table = SQLFORM.grid( query=query, #fields=fields, > #headers=headers, #orderby=default_sort_order, > user_signature=False, links=links, > create=False, searchable=False, > details=False, showbuttontext=False, > deletable=False, editable=False, > csv=False, maxtextlength=128, paginate=50) > > return dict(table=table) > > #View Friends Profile > def view_friend_profile(): > session.myfriendid = request.args[0] > #print session.myfriendid > query = db(db.reguser.id==session.myfriendid).select() > table = SQLFORM.grid(query=query) > return dict(table= table) > > #Remove Friend from Friends list > def remove_friend(): > session.myfriendid = request.args[0] > db((db.friends.reguserid==session.logged_in_user_id) & > (db.friends.friendid==session.myfriendid) ).update(status='Rejected') > #print db._lastsql > return dict() > > x--- > > My View: (myfriends.html) > > {{extend 'layout.html'}} > Friends List > > > > > {{=table}} > ---x- > My Table in db.py > reqstatus = ["Friend","Rejected","Sent"] > db.define_table('friends', > Field('reguserid'), > Field('friendid'), > Field('status', requires=IS_IN_SET(reqstatus)), > Field('friend_name'), > ) > > > > I am using - web2py1.99.4 , Win7 and python 2.7 > > Sincerely, Rahul D
[web2py] Domain and DNS
Dear All , i have a private server at ARVIXE and i am using wamp server , i used the deployment for apache in the book but now how can i assign domains to a virtual host , how can i get the reqested domain , i dont know what to do new , web2py is working at localhost:8080 now whats next ??!
[web2py] Re: Receiving Email
I changed my mind (again) :P: Instead of db(...) maybe there should be a __call__ method in Mail to do: mail(query).select()
[web2py] Re: AttributeError: 'Rows' object has no attribute '_db'
SQLFORM.grid takes a query as the first argument, and you are passing a Rows object instead (i.e., you have applied the .select() method to your query). Just pass in the query without the .select(). Anthony On Monday, January 9, 2012 6:12:55 AM UTC-5, Rahul wrote: > > Hi All, > Why do I get this error Error - AttributeError: 'Rows' object > has no attribute '_db'. Please have a look at the code given below. > Whenever I hit the myfriends url, I get the below issue. > =ERROR > Ticket ID > 127.0.0.1.2012-01-09.16-23-52.fb79b661-40af-4431-bdfa-7f1d5d3af482 > 'Rows' object has no attribute > '_db' > > Version > web2py™ > (1, 99, 4, datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable') > > Python > Python 2.7.2: C:\Python27\python.exe > > > Traceback > 1.2.3.4.5.6.7.8.9.10.11.12. > Traceback (most recent call last): > File "D:\WEB2PY\web2py\gluon\restricted.py", line 204, in > restrictedexec ccode in environment > File "D:/WEB2PY/web2py/applications/Build_Connect/controllers/ > default.py", line 735, in > File "D:\WEB2PY\web2py\gluon\globals.py", line 172, in > self._caller = lambda f: f() > File "D:/WEB2PY/web2py/applications/Build_Connect/controllers/ > default.py", line 707, in myfriendscsv=False, maxtextlength=128, > paginate=50) > File "D:\WEB2PY\web2py\gluon\sqlhtml.py", line 1455, in griddb = > query._dbAttributeError: 'Rows' object has no attribute '_db' > > = > > ---Here's the code- > My Controller: > > #This lists friends > def myfriends(): > db.friends.id.readable=False > query = db((db.friends.reguserid==session.logged_in_user_id) & > (db.friends.status=="Friend")).select(db.friends.friend_name) > print db._lastsql > > fields = (db.friends.id, db.friends.reguserid, > db.friends.friendid, db.friends.status, db.friends.friend_name,) > headers ={'friends.id': 'ID', > 'friends.reguserid': 'ReguserID', > 'friends.friendid': 'FriendID', > 'friends.status': 'Status', > 'friends.friend_name': 'Friend Name', > } > > #default_sort_order = [db.friends.friendid] #, > db.projects_posts.expected_start_date > > links = [lambda row: A(SPAN(_class='icon check'),'View > Profile',_class='positive button',_title='View this friends profile', > _href=URL("default","view_friend_profile",args=[row.friendid])), > lambda row: A(SPAN(_class='icon cross'),'Remove > Friend',_class='negative button',_title='Remove from friend list', > _href=URL("default","remove_friend",args=[row.friendid]))] > > table = SQLFORM.grid( query=query, #fields=fields, > #headers=headers, #orderby=default_sort_order, > user_signature=False, links=links, > create=False, searchable=False, > details=False, showbuttontext=False, > deletable=False, editable=False, > csv=False, maxtextlength=128, paginate=50) > > return dict(table=table) > > #View Friends Profile > def view_friend_profile(): > session.myfriendid = request.args[0] > #print session.myfriendid > query = db(db.reguser.id==session.myfriendid).select() > table = SQLFORM.grid(query=query) > return dict(table= table) > > #Remove Friend from Friends list > def remove_friend(): > session.myfriendid = request.args[0] > db((db.friends.reguserid==session.logged_in_user_id) & > (db.friends.friendid==session.myfriendid) ).update(status='Rejected') > #print db._lastsql > return dict() > > > x--- > > My View: (myfriends.html) > > {{extend 'layout.html'}} > Friends List > > > > > {{=table}} > ---x- > My Table in db.py > reqstatus = ["Friend","Rejected","Sent"] > db.define_table('friends', > Field('reguserid'), > Field('friendid'), > Field('status', requires=IS_IN_SET(reqstatus)), > Field('friend_name'), > ) > > > > I am using - web2py1.99.4 , Win7 and python 2.7 > > Sincerely, Rahul D >
[web2py] Re: Log tickets
I agree. In the future I can see myself wanting to using something like this. Do want /Daniel
[web2py] Web2py instant admin
Dear all, i am trying to use web2py instant admin , i installed it like in the documentation but when i use the username a and pass a it dosent login and when i use my own authentication it enters the admin interface but i cant see any of my tables ?? how can i fix this ???
[web2py] Re: Python for Android (any takers to run web2py)
would python-for-android make it possible to create and apk? On Jan 9, 2:23 am, Angelo Compagnucci wrote: > I'll try as soon as possible! > > I've previously used sl4a + python and web2py works flawlessy, but it a bit > difficult to setup, it cannot be done by a newbie like installing an apk! > > 2012/1/9 Marco Mansilla > > > El Mon, 9 Jan 2012 00:08:09 -0200 > > Bruno Rocha escribió: > > > > Look this project > > > >https://github.com/kivy/python-for-android > > > > May be someone has time to spend trying to run web2py with this. > > > here's a little more info, looks nice > > >http://txzone.net/2012/01/introducing-python-for-android/ > > -- > Profile:http://it.linkedin.com/in/compagnucciangelo
Re: [web2py] Re: Python for Android (any takers to run web2py)
>From my understanding, it could be possible to make an apk complete with python, libraries and web2py. I'm setting up a dev env! 2012/1/9 Massimo Di Pierro > would python-for-android make it possible to create and apk? > > On Jan 9, 2:23 am, Angelo Compagnucci > wrote: > > I'll try as soon as possible! > > > > I've previously used sl4a + python and web2py works flawlessy, but it a > bit > > difficult to setup, it cannot be done by a newbie like installing an apk! > > > > 2012/1/9 Marco Mansilla > > > > > El Mon, 9 Jan 2012 00:08:09 -0200 > > > Bruno Rocha escribió: > > > > > > Look this project > > > > > >https://github.com/kivy/python-for-android > > > > > > May be someone has time to spend trying to run web2py with this. > > > > > here's a little more info, looks nice > > > > >http://txzone.net/2012/01/introducing-python-for-android/ > > > > -- > > Profile:http://it.linkedin.com/in/compagnucciangelo > -- Profile: http://it.linkedin.com/in/compagnucciangelo
[web2py] web2py wins an InfoWorld 2012 Technology of the Year Award
http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-the-year-award-winners-183313#slide23 http://www.infoworld.com/t/application-development/picking-the-top-technologies-in-wild-year-183463 Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, iPad 2, and other well-known brands/technologies -- pretty good company. Anthony
Re: [web2py] web2py wins an InfoWorld 2012 Technology of the Year Award
congratulations Massimo! kudos, too, to everyone who makes this mailing list an excellent peer-to-peer support site. (That goes for you, Anthony.) ;-) On Monday, January 9, 2012, Anthony wrote: > > http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-the-year-award-winners-183313#slide23 > > http://www.infoworld.com/t/application-development/picking-the-top-technologies-in-wild-year-183463 > > Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, > iPad 2, and other well-known brands/technologies -- pretty good company. > > Anthony >
Re: [web2py] web2py wins an InfoWorld 2012 Technology of the Year Award
once again the slideshow is not very intuitive. I send the link to my boss and he doesnt know where to click or to get details of the award of web2py Infoworld Slideshow - Worst slideshow 2012 :) :) 2012/1/9 Nik Go > congratulations Massimo! > > kudos, too, to everyone who makes this mailing list an excellent > peer-to-peer support site. (That goes for you, Anthony.) ;-) > > > On Monday, January 9, 2012, Anthony wrote: > >> >> http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-the-year-award-winners-183313#slide23 >> >> http://www.infoworld.com/t/application-development/picking-the-top-technologies-in-wild-year-183463 >> >> Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, >> iPad 2, and other well-known brands/technologies -- pretty good company. >> >> Anthony >> >
Re: [web2py] Web2py instant admin
The last time I used it, I had some problems and it seems that its no longer supported (or maybe you should try with past versions of web2py) Javier
Re: [web2py] web2py wins an InfoWorld 2012 Technology of the Year Award
great!!! the website now needs a page to post every award web2py wins! Congratulations everyone, users and developers! http://zerp.ly/rochacbruno Em 09/01/2012 13:48, "Anthony" escreveu: > > http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-the-year-award-winners-183313#slide23 > > http://www.infoworld.com/t/application-development/picking-the-top-technologies-in-wild-year-183463 > > Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, > iPad 2, and other well-known brands/technologies -- pretty good company. > > Anthony >
[web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
+1 on Bruno's suggestion! On Jan 10, 12:42 am, Bruno Rocha wrote: > great!!! > > the website now needs a page to post every award web2py wins! > > Congratulations everyone, users and developers! > > http://zerp.ly/rochacbruno > Em 09/01/2012 13:48, "Anthony" escreveu: > > > > > > > > > > >http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-t... > > >http://www.infoworld.com/t/application-development/picking-the-top-te... > > > Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, > > iPad 2, and other well-known brands/technologies -- pretty good company. > > > Anthony
Re: [web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
Great news! This year has to be Web2py year! Javier
[web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
Yeah !! On Jan 9, 9:48 am, Anthony wrote: > http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-t...http://www.infoworld.com/t/application-development/picking-the-top-te... > > Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, > iPad 2, and other well-known brands/technologies -- pretty good company. > > Anthony
Re: [web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
+1 Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2012/1/9 Omi Chiba > Yeah !! > > On Jan 9, 9:48 am, Anthony wrote: > > > http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-t...http://www.infoworld.com/t/application-development/picking-the-top-te. > .. > > > > Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, > > iPad 2, and other well-known brands/technologies -- pretty good company. > > > > Anthony >
[web2py] LOAD, javascript and a loading gif
Hi all, I'm currently writing a plugin for part of a bigger project that can take some time doing processing server side and I'm trying to make it as modular as possible; thus the plugins and components. The problem I'm trying to solve is this: The application uses LOAD to embed some html generated by the plugin in the page. A link in the LOADed html will start some analyses and will be replaced by an image of a loading gif while waiting for the analyses to complete and the html to be returned. I've been trying to return javascript with the html from the plugin that activates when the link is clicked without any success. I don't even know if the javascript will be applied to the link in the html that it is returned with. I've tried a few approaches: 1. Script elements seem to disappear if placed inside the view/controller. 2. response.files.append(...) doesn't add a js script to the outer page's files. 3. _onclick="..." in the A helper gets overwritted by the web2py_component function that allows the plugin html and responses to be loaded inside the page I've done a day's digging, but turned up nothing. 4. I've also tried setting response.js in the component controller, but I'm having trouble debugging this because nothing turns up in FireBug. Does someone have any ideas? It doesn't need to deal directly with javascript, but it does need to be a component plugin. Cheers, Liam
[web2py] PIL and Windows 7
Hi, maybe a simple question, but I did not find the answer for some hours :-( I am using Web2Py 1.99.4 on a Windows 7 computer. Reportlabs works fine, but I need PIL for pictures in pdf-files. - I have tried to install the "Python Image Library1.1.7 for Python 2.5". But the installer asks for Python 2.5 and cannot find it in the registry. - Next try: I have installed Python 2.5 and afterwards PIL 1.1.7. I copied the PIL directory from \Python25\Lib\site-packages to \web2py\site-packages. No success! - In THE BOOK (4th edition) I have found in the index "PIL, 399". But: nothing about PIL on page 399... I have understood that it would be better to use a Linux installation. But I think there must be a solution for Windows. Any ideas? Regards, Martin
Re: [web2py] LOAD, javascript and a loading gif
There is a loading gif already built into web2py. Look at the parameters of the LOAD function it was added almost a year ago. On 1/9/12 1:58 PM, Liam wrote: Hi all, I'm currently writing a plugin for part of a bigger project that can take some time doing processing server side and I'm trying to make it as modular as possible; thus the plugins and components. The problem I'm trying to solve is this: The application uses LOAD to embed some html generated by the plugin in the page. A link in the LOADed html will start some analyses and will be replaced by an image of a loading gif while waiting for the analyses to complete and the html to be returned. I've been trying to return javascript with the html from the plugin that activates when the link is clicked without any success. I don't even know if the javascript will be applied to the link in the html that it is returned with. I've tried a few approaches: 1. Script elements seem to disappear if placed inside the view/controller. 2. response.files.append(...) doesn't add a js script to the outer page's files. 3. _onclick="..." in the A helper gets overwritted by the web2py_component function that allows the plugin html and responses to be loaded inside the page I've done a day's digging, but turned up nothing. 4. I've also tried setting response.js in the component controller, but I'm having trouble debugging this because nothing turns up in FireBug. Does someone have any ideas? It doesn't need to deal directly with javascript, but it does need to be a component plugin. Cheers, Liam
[web2py] Re: PIL and Windows 7
Are you running the web2py binary for Windows? If so, switch to running the source code version of web2py if you want to make use of your own Python installation. The web2py binary comes with its own Python interpreter, so it won't use your machine's Python installation (with PIL). It's just as easy to run web2py from source if you've already got Python installed. Anthony On Monday, January 9, 2012 2:06:21 PM UTC-5, mweissen wrote: > > Hi, > > maybe a simple question, but I did not find the answer for some hours :-( > > I am using Web2Py 1.99.4 on a Windows 7 computer. > Reportlabs works fine, but I need PIL for pictures in pdf-files. > >- I have tried to install the "Python Image Library1.1.7 for Python >2.5". But the installer asks for Python 2.5 and cannot find it in the >registry. >- Next try: I have installed Python 2.5 and afterwards PIL 1.1.7. I >copied the PIL directory from \Python25\Lib\site-packages to >\web2py\site-packages. No success! >- In THE BOOK (4th edition) I have found in the index "PIL, 399". But: >nothing about PIL on page 399... > > I have understood that it would be better to use a Linux installation. But > I think there must be a solution for Windows. > Any ideas? > > Regards, Martin > >
[web2py] Re: PIL and Windows 7
Note, you might consider running Python 2.7 rather than Python 2.5 (web2py runs fine with 2.7). On Monday, January 9, 2012 2:30:07 PM UTC-5, Anthony wrote: > > Are you running the web2py binary for Windows? If so, switch to running > the source code version of web2py if you want to make use of your own > Python installation. The web2py binary comes with its own Python > interpreter, so it won't use your machine's Python installation (with PIL). > It's just as easy to run web2py from source if you've already got Python > installed. > > Anthony > > On Monday, January 9, 2012 2:06:21 PM UTC-5, mweissen wrote: >> >> Hi, >> >> maybe a simple question, but I did not find the answer for some hours :-( >> >> I am using Web2Py 1.99.4 on a Windows 7 computer. >> Reportlabs works fine, but I need PIL for pictures in pdf-files. >> >>- I have tried to install the "Python Image Library1.1.7 for Python >>2.5". But the installer asks for Python 2.5 and cannot find it in the >>registry. >>- Next try: I have installed Python 2.5 and afterwards PIL 1.1.7. I >>copied the PIL directory from \Python25\Lib\site-packages to >>\web2py\site-packages. No success! >>- In THE BOOK (4th edition) I have found in the index "PIL, 399". >>But: nothing about PIL on page 399... >> >> I have understood that it would be better to use a Linux installation. >> But I think there must be a solution for Windows. >> Any ideas? >> >> Regards, Martin >> >>
Re: [web2py] Re: Movuca - The Social CMS - Need Testers and Contributors
Hi all, I am writing a post explaining how datamodels works and how to create your own content types with just a Python class and a view. In this post I will show how to transform the Movuca CMS in a social commerce adding a "Product" content type. http://movu.ca/demo/article/show/15/how-to-create-content-types-in-movuca-cms The post is in progress, if you login and click in subscribe you will receive an e-mail alerting post updates. Comments are open for you to give me suggestions. -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] New select widget plugin available for testing
I've written a new plugin that provides a select widget that can be refreshed via ajax, along with a button that opens a dialog to add new items to the linked table. When the dialog is closed, the select widget is automatically refreshed via ajax and the added item(s) are available as selectable options. You can download or clone the file from the github repository: https://github.com/monotasker/plugin_ajaxselect In one sense this is a duplication of the "select_or_add" module that has been available on web2py slices. Under the hood, though, they are quite different. My ajaxselect plugin does not manipulate the select widget on the user side (inserting options via jquery). Instead, I use web2py's built in ajax functionality to refresh the widget *from the db*. I think this will make for a more robust and versatile plugin. Please test it out and let me know about (a) bugs and (b) additional features you would like to see (more customizability, etc.). My immediate plan is to expand the plugin to use the same approach for filtering the contents of one select widget based on the value of another. The plugin is licensed under GPL3, so feel free to adapt and reuse it as you like. Cheers, Ian
[web2py] pack application
Hello, I want to pack my application from a script/command line (not running in web2py). How can I achieve this? I can compile the application with gluon.compileapp.compile_application('applications/myapp') there is gluon.admin.app_pack_compiled to pack it, but this function needs the request object so I don't know how I can call it. Please also let me know In case it is not possible so I don't spend more time searching for possible solutions. Alex PS: I already asked this question 1 month ago but did not get any answers, I hope it's ok to try again.
Re: [web2py] New select widget plugin available for testing
Would be very nice to see some screenshots or a live demo! Thank you for sharing it, I am testing! On Mon, Jan 9, 2012 at 5:38 PM, monotasker wrote: > I've written a new plugin that provides a select widget that can be > refreshed via ajax, along with a button that opens a dialog to add new > items to the linked table. When the dialog is closed, the select widget is > automatically refreshed via ajax and the added item(s) are available as > selectable options. You can download or clone the file from the github > repository: https://github.com/monotasker/plugin_ajaxselect > > In one sense this is a duplication of the "select_or_add" module that has > been available on web2py slices. Under the hood, though, they are quite > different. My ajaxselect plugin does not manipulate the select widget on > the user side (inserting options via jquery). Instead, I use web2py's built > in ajax functionality to refresh the widget *from the db*. I think this > will make for a more robust and versatile plugin. > > Please test it out and let me know about (a) bugs and (b) additional > features you would like to see (more customizability, etc.). My immediate > plan is to expand the plugin to use the same approach for filtering the > contents of one select widget based on the value of another. > > The plugin is licensed under GPL3, so feel free to adapt and reuse it as > you like. > > Cheers, > > Ian > -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: New select widget plugin available for testing
I forgot to add that the one dependency of this plugin is jquery-ui (for the dialog). I'd be interested to know what people think of this. Should I write a little dialog script of my own so that there are no external dependencies, or should I avoid reinventing the wheel and use jquery-ui?
Re: [web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
FYI - probably been thrown out there already, but it also won a 2011 BOSSIE award: http://bit.ly/yjdq1l On Mon, Jan 9, 2012 at 11:36 AM, Ovidio Marinho wrote: > +1 > > > >Ovidio Marinho Falcao Neto > Web Developer > ovidio...@gmail.com > ovidiomari...@itjp.net.br > ITJP - itjp.net.br >83 8826 9088 - Oi >83 9334 0266 - Claro > Brasil > > Apóio > > > > 2012/1/9 Omi Chiba > >> Yeah !! >> >> On Jan 9, 9:48 am, Anthony wrote: >> > >> http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-t...http://www.infoworld.com/t/application-development/picking-the-top-te. >> .. >> > >> > Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, >> > iPad 2, and other well-known brands/technologies -- pretty good company. >> > >> > Anthony >> > >
[web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
Congratulations, Massimo and thanks to all who contribute. On Jan 9, 12:36 pm, Ovidio Marinho wrote: > +1 > > Ovidio Marinho Falcao Neto > Web Developer > ovidio...@gmail.com > ovidiomari...@itjp.net.br > ITJP - itjp.net.br > 83 8826 9088 - Oi > 83 9334 0266 - Claro > Brasil > > Apóio > > 2012/1/9 Omi Chiba > > > > > > > > > Yeah !! > > > On Jan 9, 9:48 am, Anthony wrote: > > >http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-t > > .. > > > > Other winners include Amazon Web Services, Heroku, Node.js, Apple iOS 5, > > > iPad 2, and other well-known brands/technologies -- pretty good company. > > > > Anthony
[web2py] Re: LOAD, javascript and a loading gif
On Monday, January 9, 2012 1:58:30 PM UTC-5, Liam wrote: > > Hi all, > > I'm currently writing a plugin for part of a bigger project that can take > some time doing processing server side and I'm trying to make it as modular > as possible; thus the plugins and components. The problem I'm trying to > solve is this: The application uses LOAD to embed some html generated by > the plugin in the page. A link in the LOADed html will start some analyses > and will be replaced by an image of a loading gif while waiting for the > analyses to complete and the html to be returned. > If you want to click a link in the component and have the contents of the component replaced with the response from that link, you can use the A() helper with the "cid" argument, as described here: http://web2py.com/books/default/chapter/29/12#Trapped-Ajax-links. You would then have to add some Javascript code to display the "loading" gif while waiting. > > I've been trying to return javascript with the html from the plugin that > activates when the link is clicked without any success. I don't even know > if the javascript will be applied to the link in the html that it is > returned with. I've tried a few approaches: > 1. Script elements seem to disappear if placed inside the view/controller. > Not sure what you mean by that -- can you show some code? > 2. response.files.append(...) doesn't add a js script to the outer page's > files. > Right. response.files generally won't do anything when a component loads (unless the component view includes code that calls response.include_files(), which is generally not the case, and would be tricky for CSS files in particular, which must be loaded in the document head). Anthony
Re: [web2py] LOAD, javascript and a loading gif
On Monday, January 9, 2012 2:28:43 PM UTC-5, David J wrote: > > There is a loading gif already built into web2py. > > Look at the parameters of the LOAD function it was added almost a year ago. > I believe that only shows up on the initial display of the full page that contains the component, not on subsequent reloads of the component within the page. Anthony
Re: [web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
On Monday, January 9, 2012 2:52:16 PM UTC-5, Dragonfyre13 wrote: > > FYI - probably been thrown out there already, but it also won a 2011 > BOSSIE award: http://bit.ly/yjdq1l Yes, InfoWorld reviewed six Python web frameworks and rated web2py best among them. It then awarded web2py one of ten Bossie awards in the open source development software category. I think four of the ten Bossie award winners in that category (including web2py) then ended up among the 22 Technology of the Year Award winners (which covers a range of hardware and software categories). So, best Python framework, top 10 open source development software, and top 22 across all technology. Anthony
Re: [web2py] New select widget plugin available for testing
Thanks, Bruno. I've been writing this for an app that isn't finished yet, but I'll try to at least get some screenshots up soon. And thanks, by the way, for all your coaching as I've been learning web2py. I need to add a "thanks" section to the README.
[web2py] Re: pack application
cd applications/app tar zcvf web2py.app.name.w2p * On Jan 9, 1:39 pm, Alex wrote: > Hello, > > I want to pack my application from a script/command line (not running > in web2py). How can I achieve this? > > I can compile the application with > gluon.compileapp.compile_application('applications/myapp') > there is > gluon.admin.app_pack_compiled > to pack it, but this function needs the request object so I don't know > how I can call it. Please also let me know In case it is not possible > so I don't spend more time searching for possible solutions. > > Alex > > PS: I already asked this question 1 month ago but did not get any > answers, I hope it's ok to try again.
[web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
This is indeed good news. Thanks to everybody who has contributed to web2py to make it what it is. :-) massimo On Jan 9, 2:03 pm, Anthony wrote: > On Monday, January 9, 2012 2:52:16 PM UTC-5, Dragonfyre13 wrote: > > > FYI - probably been thrown out there already, but it also won a 2011 > > BOSSIE award:http://bit.ly/yjdq1l > > Yes, InfoWorld reviewed six Python web frameworks and rated web2py best > among them. It then awarded web2py one of ten Bossie awards in the open > source development software category. I think four of the ten Bossie award > winners in that category (including web2py) then ended up among the 22 > Technology of the Year Award winners (which covers a range of hardware and > software categories). So, best Python framework, top 10 open source > development software, and top 22 across all technology. > > Anthony
[web2py] Re: LOAD, javascript and a loading gif
uhm, don't know if it'll help you, BTW, I also had to figure a "way" to display some "loading pictures" (from now on, I'll call them "spinners") to my pages. I had to face 2 distinct problems: - loading components via Ajax (through LOAD() or web2py_component()) - prevent FOUC on very complex pages for the first problem I actually "hacked" web2py.js (web2py_ajax.js or so). the ajax function needs to be modified the basic idea is to replace content of the target with a spinner (in this case, a div containing the message "loading...") before sending the request, and upon success replace it with the content actually loaded... you can add a beforeSend parameter for that and take care of replacing the content adding something to the success function. My code actually is something like this... function ajax(u,s,t) { query = ''; if (typeof s == "string") { d = jQuery(s).serialize(); if(d){ query = d; } } else { pcs = []; if (s != null && s != undefined) for(i=0; i0){query = pcs.join("&");} } jQuery.ajax({ type: "POST", url: u, data: query, beforeSend: function( xhr ) { if(t) {jQuery("#" + t).html('Loading...')}; }, success: function(msg) { if(t) { if(t==':eval') eval(msg); else { jQuery("#loadingwindow").fadeOut(400, function () { jQuery("#" + t).html(msg).hide().fadeIn(400); }); } } } }); } for the second problem, I had to hide window contents because of some complex javascript needs to be run to validate several fields and to rearrange heavily the DOM (tabs, selects with a large number of options to turn into multiselects, a tree with jstree) until the "transformation" completes. Fortunately I could figure out what was the "script" block that is going to be always the last to be finished (not executed), so I can address that "event" with the "action" of displaying my page again. All this introduction to warn you about an hiccup in the following method: if you have built (like me) some widgets to be modular, you'll end up having various
[web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
kudos to all devs. I'm happy to be a web2py user for the last couple of years.
[web2py] Re: pack application
thanks! do I really need everything in the archive or would the directories 'compiled' and 'static' be enough? On 9 Jan., 22:21, Massimo Di Pierro wrote: > cd applications/app > tar zcvf web2py.app.name.w2p * > > On Jan 9, 1:39 pm, Alex wrote: > > > > > > > > > Hello, > > > I want to pack my application from a script/command line (not running > > in web2py). How can I achieve this? > > > I can compile the application with > > gluon.compileapp.compile_application('applications/myapp') > > there is > > gluon.admin.app_pack_compiled > > to pack it, but this function needs the request object so I don't know > > how I can call it. Please also let me know In case it is not possible > > so I don't spend more time searching for possible solutions. > > > Alex > > > PS: I already asked this question 1 month ago but did not get any > > answers, I hope it's ok to try again.
[web2py] Re: LOAD, javascript and a loading gif
> > for the first problem I actually "hacked" web2py.js (web2py_ajax.js or > so). > the ajax function needs to be modified > the basic idea is to replace content of the target with a spinner (in > this case, a div containing the message "loading...") before sending > the request, and upon success replace it with the content actually > loaded... > Note, if there are no other Ajax requests happening on the page other than the one(s) for which you want to trigger a loading message, you can use the jQuery .ajaxStart() and .ajaxStop() event handlers to show and hide the message, rather than hacking web2py.js. Anthony
[web2py] Re: LOAD, javascript and a loading gif
I don't recall the exact one happened to be my case, but plenty of jquery plugins use ajax, one was working oddly (maybe a js master could see if that plugin was bugged, but I'm not): I didn't want to mess with that one and those following that, so I hacked web2py.js (didn't think much about that, the functionality is fully preserved and there are 3-4 additional lines in total, not a big "hack" anyway...)
Re: [web2py] Re: Movuca - The Social CMS - Need Testers and Contributors
El Sat, 7 Jan 2012 00:46:16 -0200 Bruno Rocha escribió: > Got a domain name! http://movu.ca > Awesome!, congrats!, and thanks for sharing it's a cool idea
Re: [web2py] Re: Movuca - The Social CMS - Need Testers and Contributors
I just finished the article http://movu.ca/demo/article/show/15/how-to-create-content-types-in-movuca-cms "subscribers should receive an alert e-mail" I am open for suggestions and also I appreciate code reviews! -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: web2py wins an InfoWorld 2012 Technology of the Year Award
Congratulations! On 1月10日, 午前7:24, Niphlod wrote: > kudos to all devs. I'm happy to be a web2py user for the last couple > of years.
[web2py] Re: pack application
compiled and static are enough if you do not want to distribute the source. On Jan 9, 4:49 pm, Alex wrote: > thanks! do I really need everything in the archive or would the > directories 'compiled' and 'static' be enough? > > On 9 Jan., 22:21, Massimo Di Pierro > wrote: > > > > > > > > > cd applications/app > > tar zcvf web2py.app.name.w2p * > > > On Jan 9, 1:39 pm, Alex wrote: > > > > Hello, > > > > I want to pack my application from a script/command line (not running > > > in web2py). How can I achieve this? > > > > I can compile the application with > > > gluon.compileapp.compile_application('applications/myapp') > > > there is > > > gluon.admin.app_pack_compiled > > > to pack it, but this function needs the request object so I don't know > > > how I can call it. Please also let me know In case it is not possible > > > so I don't spend more time searching for possible solutions. > > > > Alex > > > > PS: I already asked this question 1 month ago but did not get any > > > answers, I hope it's ok to try again.
[web2py] Re: Python for Android (any takers to run web2py)
what is the use case for running a web framework on your Android phone?
Re: [web2py] Python for Android (any takers to run web2py)
Offhand, I could think of a custom app for that itch you want to scratch .. On Tuesday, January 10, 2012, Plumo wrote: > what is the use case for running a web framework on your Android phone?
[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?
Thank you for letting me know a wonderful technique. Web2py rocks! For the sake of laziness, I want local database to be sqlite. Then, I see a little problem that the deployed code will also create its sqlite on the web server too. I hope the deployed code stores its data to production db only and not to sqlite of the web server. Can there be a programmable solution of this too?
[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?
Thank you for the solid reference. Reference is like "fog of war." One only discovers it when he/she explores even though it was there all the time.
[web2py] Re: redirecting python console output to web browser page
like hard to implement.. i want simple approach for them On Jan 3, 3:17 am, Paolo Caruccio wrote: > There is another HTML5 technology to push stream from server to client : > EventSource aka Sent-Server Events (http://dev.w3.org/html5/eventsource/). > Its behaviour is like ajax long polling. > I'm - just now - experimenting a simple mechanism to send to clients a > message when the database changes. > Pros : The implementation is enough simple. > Cons : IE9 doesn't support EventSource.
[web2py] Re: redirecting python console output to web browser page
i'm still pretty newbie for them.. but i'll try to search. On Jan 2, 11:42 pm, Ross Peoples wrote: > Yes, you can, though it's much more difficult to stream it live to a web > page. You would need to use JavaScript (comet or polling) to get the output > as it is generated and display it in the browser. There are many ways to do > this, but it's not the simplest thing in the world. > > Off the top of my head, I can think of a few different ways to implement > this (though each has pros and cons): > > - Simplest: load a page as usual with an tag that runs the command > and streams the output as it happens > - Better: Start the process and just AJAX calls to grab latest output and > display > - Best/Hardest: Use comet (AJAX push) to push output to the web page > > Using is sometimes frowned upon as it's seen as the "easy way out" > of doing complicated tasks. Using JavaScript offers some extra flexibility > on how the output is displayed in the browser (and could even allow the > user to interact).
[web2py] Re: redirecting python console output to web browser page
Ross, i think i don't want to use external script, like my_script.py ... On Jan 2, 12:20 am, Ross Peoples wrote: > I use subprocess.Popen a lot to run shell commands from Python. There is no > need for a specific web2py feature. > > This is the method I use whenever I need to call something: > > import subprocess > def run_command(self, *args): > """ > Returns the output of a command as a tuple (output, error). > """ > p = subprocess.Popen(args, stdout=subprocess.PIPE, > stderr=subprocess.PIPE) > return p.communicate() > > It's very simple to use: > > output, error = run_command('python', 'my_script.py', 'arg1', 'arg2', ...) > > This runs the command, waits for it to exit, and then you have a string > "output" for the output from the command, and a string "error" for any > error output from the command.
[web2py] web2py iteration output
i have a little problem with web2py. i'm doing simple writing application with web2py. the code look like this for controller : import apt_pkg def important(): apt_pkg.init() cache = apt_pkg.Cache() for pkg in cache.packages: if pkg.essential: return dict(t=pkg) and for related view : {{extend 'layout.html'}} {{=t.name}}{{pass}} if we run this script on python shell, the output should like this base-files sysvinit-utils util-linux diffutils perl-base bash login e2fsprogs dash coreutils bsdutils base-passwd dpkg findutils debianutils sed tar ncurses-base grep mount gzip ncurses-bin hostname sysvinit but when we run through web2py, the output just first entry from list of essential packages above. it looks like this . base-files what wrong with my code.. i'm still pretty newbie on python and web2py framework
[web2py] Re: web2py iteration output
> > import apt_pkg > def important(): > apt_pkg.init() > cache = apt_pkg.Cache() > for pkg in cache.packages: >if pkg.essential: >return dict(t=pkg) > When you call "return" in Python, the function terminates, so this will exit the loop after the first iteration. > {{extend 'layout.html'}} > > {{=t.name}}{{pass}} > > Views don't simply iterate automatically -- if you want to repeat some elements in a loop, you have to write an explicit loop. Instead, maybe something like: def important(): [snip] return dict(packages=[package.name for package in cache.packages if package.essential]) View: {{for package in packages:}} {{=package}} {{pass}} or even easier: {{=UL(packages)}} Note, if you pass a list to the UL() helper, it automatically converts its elements to LI's. Anthony
[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?
On Monday, January 9, 2012 10:04:54 PM UTC-5, seongjoo wrote: > > Thank you for letting me know a wonderful technique. Web2py rocks! > > For the sake of laziness, I want local database to be sqlite. Then, I see > a little problem that the deployed code will also create its sqlite on the > web server too. I hope the deployed code stores its data to production db > only and not to sqlite of the web server. Can there be a programmable > solution of this too? The DAL will try the db's in the order listed in DAL(), so even though it will create the SQLite db on the server, it should never actually use it as long as the production db is listed first and the production db is always accessible. Anthony
[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?
> For the sake of laziness, I want local database to be sqlite. Bad idea. You need to be testing on your production database from the beginning. For example, the Postgres driver will throw an error when it sees a query like "SELECT foo FROM bar WHERE foo.id NOT IN ()..." Sqlite will accept the query same query. You can create such queries with a statement like "~(db.foo.id.belongs(foobar))" if foobar is an empty list. Likewise the collating orders for different databases are different as are the upper/lower case boolean matching rules. You can encounter surprises in your sorting and searching widgets if your development and unit test database is different from your acceptance test/ production database. LIKE clauses in MySQL are case insensitive, whereas in Postgres they are case sensitive. On Jan 9, 10:04 pm, seongjoo wrote: > Thank you for letting me know a wonderful technique. Web2py rocks! > > For the sake of laziness, I want local database to be sqlite. Then, I see a > little problem that the deployed code will also create its sqlite on the > web server too. I hope the deployed code stores its data to production db > only and not to sqlite of the web server. Can there be a programmable > solution of this too?
[web2py] Re: web2py iteration output
Thanks Anthony, it was works greatfully On Jan 10, 10:53 am, Anthony wrote: > > import apt_pkg > > def important(): > > apt_pkg.init() > > cache = apt_pkg.Cache() > > for pkg in cache.packages: > > if pkg.essential: > > return dict(t=pkg) > > When you call "return" in Python, the function terminates, so this will > exit the loop after the first iteration. > > > {{extend 'layout.html'}} > > > > {{=t.name}}{{pass}} > > > > Views don't simply iterate automatically -- if you want to repeat some > elements in a loop, you have to write an explicit loop. Instead, maybe > something like: > > def important(): > [snip] > return dict(packages=[package.name for package in cache.packages if > package.essential]) > > View: > > {{for package in packages:}} > {{=package}} > {{pass}} > > > or even easier: > > {{=UL(packages)}} > > Note, if you pass a list to the UL() helper, it automatically converts its > elements to LI's. > > Anthony
[web2py] Re: AttributeError: 'Rows' object has no attribute '_db'
I did not get it... What would be an equivalent query I would need to pass for below? I need to just select rows (Friend_name column for all status that are Friend and reguserid is whatever the logged in users id) for below conditions - I thought select was a valid query! Please suggest Existing - query = db((db.friends.reguserid==session.logged_in_user_id) & (db.friends.status=="Friend")).select(db.friends.friend_name) FYI, The Database Table: reqstatus = ["Friend","Rejected","Sent"] db.define_table('friends', Field('reguserid'), Field('friendid'), Field('status', requires=IS_IN_SET(reqstatus)), Field('friend_name'), ) Thanks, Sincerely, Rahul D. On Jan 9, 7:00 pm, Anthony wrote: > SQLFORM.grid takes a query as the first argument, and you are passing a > Rows object instead (i.e., you have applied the .select() method to your > query). Just pass in the query without the .select(). > > Anthony > > > > > > > > On Monday, January 9, 2012 6:12:55 AM UTC-5, Rahul wrote: > > > Hi All, > > Why do I get this error Error - AttributeError: 'Rows' object > > has no attribute '_db'. Please have a look at the code given below. > > Whenever I hit the myfriends url, I get the below issue. > > =ERROR > > Ticket ID > > 127.0.0.1.2012-01-09.16-23-52.fb79b661-40af-4431-bdfa-7f1d5d3af482 > > 'Rows' object has no attribute > > '_db' > > > Version > > web2py™ > > (1, 99, 4, datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable') > > > Python > > Python 2.7.2: C:\Python27\python.exe > > > Traceback > > 1.2.3.4.5.6.7.8.9.10.11.12. > > Traceback (most recent call last): > > File "D:\WEB2PY\web2py\gluon\restricted.py", line 204, in > > restricted exec ccode in environment > > File "D:/WEB2PY/web2py/applications/Build_Connect/controllers/ > > default.py", line 735, in > > File "D:\WEB2PY\web2py\gluon\globals.py", line 172, in > > self._caller = lambda f: f() > > File "D:/WEB2PY/web2py/applications/Build_Connect/controllers/ > > default.py", line 707, in myfriends csv=False, maxtextlength=128, > > paginate=50) > > File "D:\WEB2PY\web2py\gluon\sqlhtml.py", line 1455, in grid db = > > query._dbAttributeError: 'Rows' object has no attribute '_db' > > > = > > > ---Here's the code- > > My Controller: > > > #This lists friends > > def myfriends(): > > db.friends.id.readable=False > > query = db((db.friends.reguserid==session.logged_in_user_id) & > > (db.friends.status=="Friend")).select(db.friends.friend_name) > > print db._lastsql > > > fields = (db.friends.id, db.friends.reguserid, > > db.friends.friendid, db.friends.status, db.friends.friend_name,) > > headers ={'friends.id': 'ID', > > 'friends.reguserid': 'ReguserID', > > 'friends.friendid': 'FriendID', > > 'friends.status': 'Status', > > 'friends.friend_name': 'Friend Name', > > } > > > #default_sort_order = [db.friends.friendid] #, > > db.projects_posts.expected_start_date > > > links = [lambda row: A(SPAN(_class='icon check'),'View > > Profile',_class='positive button',_title='View this friends profile', > > _href=URL("default","view_friend_profile",args=[row.friendid])), > > lambda row: A(SPAN(_class='icon cross'),'Remove > > Friend',_class='negative button',_title='Remove from friend list', > > _href=URL("default","remove_friend",args=[row.friendid]))] > > > table = SQLFORM.grid( query=query, #fields=fields, > > #headers=headers, #orderby=default_sort_order, > > user_signature=False, links=links, > > create=False, searchable=False, > > details=False, showbuttontext=False, > > deletable=False, editable=False, > > csv=False, maxtextlength=128, paginate=50) > > > return dict(table=table) > > > #View Friends Profile > > def view_friend_profile(): > > session.myfriendid = request.args[0] > > #print session.myfriendid > > query = db(db.reguser.id==session.myfriendid).select() > > table = SQLFORM.grid(query=query) > > return dict(table= table) > > > #Remove Friend from Friends list > > def remove_friend(): > > session.myfriendid = request.args[0] > > db((db.friends.reguserid==session.logged_in_user_id) & > > (db.friends.friendid==session.myfriendid) ).update(status='Rejected') > > #print db._lastsql > > return dict() > > > x--- > > > My View: (myfriends.html) > > > {{extend 'layout.html'}} > > Friends List > > > > > > > > > > {{=table}} > > ---x- > > My Table in db.py > > reqstatus = ["Friend","Rejected","Sent"] > > db.define_table('friends', > > Field('reguserid'), > > Field('friendid'), > > Field('status', requires=IS_IN_SET(reqstatus)), > > Field('friend_name'), >
Re: [web2py] Re: PIL and Windows 7
You are right, that is the best solution. I have tried it and it works fine. Maybe my approch was a little too academic... By the way: reportlab does not need a temp file, a StringIO does the same job. Somethink like import StringIO out = StringIO.StringIO() c = Canvas(out) # or: doc = SimpleDocTemplate(out) ... c.save() result = out.getvalue() out.close() works fine. 2012/1/9 Anthony > Note, you might consider running Python 2.7 rather than Python 2.5 (web2py > runs fine with 2.7). > > > On Monday, January 9, 2012 2:30:07 PM UTC-5, Anthony wrote: >> >> Are you running the web2py binary for Windows? If so, switch to running >> the source code version of web2py if you want to make use of your own >> Python installation. The web2py binary comes with its own Python >> interpreter, so it won't use your machine's Python installation (with PIL). >> It's just as easy to run web2py from source if you've already got Python >> installed. >> >> Anthony >> >> On Monday, January 9, 2012 2:06:21 PM UTC-5, mweissen wrote: >>> >>> Hi, >>> >>> maybe a simple question, but I did not find the answer for some hours :-( >>> >>> I am using Web2Py 1.99.4 on a Windows 7 computer. >>> Reportlabs works fine, but I need PIL for pictures in pdf-files. >>> >>>- I have tried to install the "Python Image Library1.1.7 for Python >>>2.5". But the installer asks for Python 2.5 and cannot find it in the >>>registry. >>>- Next try: I have installed Python 2.5 and afterwards PIL 1.1.7. I >>>copied the PIL directory from \Python25\Lib\site-packages to >>>\web2py\site-packages. No success! >>>- In THE BOOK (4th edition) I have found in the index "PIL, 399". >>>But: nothing about PIL on page 399... >>> >>> I have understood that it would be better to use a Linux installation. >>> But I think there must be a solution for Windows. >>> Any ideas? >>> >>> Regards, Martin >>> >>>