[web2py] email updates not recd for this group
I was looking for the email ID of administrator for this group, but couldn't find one. Of late, I am not receiving daily digest email. I have ensured that correct option is checked in 'edit my membership'. Is it only me -or- anybody else is also experiencing the same? -- Vineet
Re: [web2py] Re: Chunked downloads and corrupt files with Internet Explorer 8 (IE8)
I am using 1.99.1 and it happens to me frequently. If download is big ( for my case 100,200 MB) it usually end up with corrupted file. Tested on Local wifi network with 300 Mbps. On Wed, Jun 15, 2011 at 4:21 PM, Stefan Scholl stefan.sch...@gmail.comwrote: Is nobody else experiencing this problem? Is nobody using Internet Explorer to download more than 64KiB from a web2py app? On 6 Mai, 13:03, Stefan Scholl stefan.sch...@gmail.com wrote: The classicdownloadfunction: defdownload(): return response.download(request, db) I'm developing on localhost (127.0.0.1, no SSL) and one strange thing happened: Downloads in IE8 (Windows XP) were all corrupt/broken if they weren't below 64KiB in size. Very easy to see with large images. Using a higher value for the argument 'chunk_size' solves this problem, up to this new maximum. web2py 1.91.6
Re: [web2py] cluster: distributed locks
ok, I guess that the answer is no... (or I didn't formulate the question correctly) On Thu, Jan 19, 2012 at 11:51 PM, sebastian sebastianov...@gmail.comwrote: Hi All, just thinking on how to implement a distributed locking system in web2py using a DB: one row per each lock, lock_name is unique, if the row doesn't exist, then it is locked, if the row exist already, then it cannot be lock as it is already locked ! I'd like to create a module like this (that can be called from anywhere in web2py) def lock(lock name): begin transaction does the row exist ? no = insert new row commit transaction return result def unlock(lock_name): begin transaction delete row where name = lock_name commit transaction BUT not sure if this is possible (of course it is !) in web2py... consider this controller def hello1(): do a lot of things db.commit() do more things in the DB ### here is my doubt: ### if lock(some resource): ### I'm calling a method that opens and close a transaction inside a transaction !!! do something unlock(some resource) else do something else another example 3 if lock(resource A): if lock(resource B): do a lot of things woth both resources unlock(resource B) unlock(resource A) else so other things unlock(resource A) do more things db.commit() do more staff any better idea ? thansk -- Sebastian E. Ovide
Re: [web2py] Re: begin a transaction manually ?
2) yes but not concurrently, unless you have two db objects. Is it possible to clone a db object ? instead of declare 2 (or n) db objects in the model, can I create a new one a controller based on db declared in the model ? -- Sebastian E. Ovide
Re: [web2py] cluster: distributed locks
I dont know if it is related, but there is a Locking plugin http://web2py.com/plugins/default/locking On Thu, Jan 26, 2012 at 7:05 AM, Sebastian E. Ovide sebastianov...@gmail.com wrote: ok, I guess that the answer is no... (or I didn't formulate the question correctly) On Thu, Jan 19, 2012 at 11:51 PM, sebastian sebastianov...@gmail.comwrote: Hi All, just thinking on how to implement a distributed locking system in web2py using a DB: one row per each lock, lock_name is unique, if the row doesn't exist, then it is locked, if the row exist already, then it cannot be lock as it is already locked ! I'd like to create a module like this (that can be called from anywhere in web2py) def lock(lock name): begin transaction does the row exist ? no = insert new row commit transaction return result def unlock(lock_name): begin transaction delete row where name = lock_name commit transaction BUT not sure if this is possible (of course it is !) in web2py... consider this controller def hello1(): do a lot of things db.commit() do more things in the DB ### here is my doubt: ### if lock(some resource): ### I'm calling a method that opens and close a transaction inside a transaction !!! do something unlock(some resource) else do something else another example 3 if lock(resource A): if lock(resource B): do a lot of things woth both resources unlock(resource B) unlock(resource A) else so other things unlock(resource A) do more things db.commit() do more staff any better idea ? thansk -- Sebastian E. Ovide -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] addtoany problem
Il 25/01/2012 10:33, Bruno Rocha ha scritto: You can try the LazyLoader http://www.itthinx.com/plugins/lazy-widget-loader/ maybe it could be adopted directly from web2py? M.
[web2py] Re: email updates not recd for this group
I am also not receiving group messages digest since january 19 On 26 ene, 05:51, Vineet vineet.deod...@gmail.com wrote: I was looking for the email ID of administrator for this group, but couldn't find one. Of late, I am not receiving daily digest email. I have ensured that correct option is checked in 'edit my membership'. Is it only me -or- anybody else is also experiencing the same? -- Vineet
[web2py] Re: Problem with legacy tables
In this issue: http://code.google.com/p/web2py/issues/detail?id=634 I am trying to solve a (supposedly) similar problem, when using SQLFORM with tables wich have custom id field names. Maybe there could be used a common workaround to solve both problems. Anyway, the custom id problem reproduces only in the new non-stable version. On 25 ene, 18:25, Omi Chiba ochib...@gmail.com wrote: Sound like it's related to the issue I posted before.http://code.google.com/p/web2py/issues/detail?id=547 The bottom line is you cannot use SQLFORM.grid/SQLTABLE if you don't have id field.I have also legacy table which doesn't have field called id. I gave using SQLFORM.grid and create the list with table/table. If you're looking for paging, you can use the following plugin which I use. http://dev.s-cubism.com/plugin_paginator On Jan 25, 8:51 am, brushek brus...@gmail.com wrote: I'm using vim, editing files directly on server. On 25 Sty, 15:47, Marin Pranjić marin.pran...@gmail.com wrote: What do you use for development? If you use an IDE with debugging step-by-step featues, you can find out where does id come from On Wed, Jan 25, 2012 at 3:35 PM, brushek brus...@gmail.com wrote: On 25 Sty, 15:17, Anthony abasta...@gmail.com wrote: I left the following comment with the issue: shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id ,db.gk_shop.nazwa_modulu],user_signature=False,deletable=False) Note, your refer to db.gk_shop.id, but there is no id field in that table. The name of the id field is actually db.gk_shop.id_modulo (the field _type_ is id, but the field _name_ is id_modulo). In your code, you have to refer to the field name. Anthony OK, I changed the controller: shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id_modulu,db.gk_shop.nazwa_ modulu],user_signature=False,deletable=False) and it isn't the case, the error still remain: Traceback (most recent call last): File /home/users/brushek/web2py-dev/gluon/restricted.py, line 204, in restricted exec ccode in environment File /home/users/brushek/web2py-dev/applications/sdadmin/ controllers/default.py, line 138, in module File /home/users/brushek/web2py-dev/gluon/globals.py, line 172, in lambda self._caller = lambda f: f() File /home/users/brushek/web2py-dev/gluon/tools.py, line 2551, in f return action(*a, **b) File /home/users/brushek/web2py-dev/applications/sdadmin/ controllers/default.py, line 16, in shop shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id_modulu,db.gk_shop.nazwa_ modulu],user_signature=False,deletable=False) File /home/users/brushek/web2py-dev/gluon/sqlhtml.py, line 1587, in grid _class='web2py_form', File /home/users/brushek/web2py-dev/gluon/html.py, line 1960, in process self.validate(**kwargs) File /home/users/brushek/web2py-dev/gluon/html.py, line 1907, in validate if self.accepts(**kwargs): File /home/users/brushek/web2py-dev/gluon/sqlhtml.py, line 1042, in accepts formname_id = '.'.join(str(self.record[k]) File /home/users/brushek/web2py-dev/gluon/dal.py, line 5317, in __getattr__ 'firebird': FireBirdAdapter, File /home/users/brushek/web2py-dev/gluon/dal.py, line 5308, in __getitem__ 'postgres': PostgreSQLAdapter, KeyError: 'id'
[web2py] Re: email_auth works on web2py server, but not GAE - ANSWER: No sockets in the sandbox, no smtp connections! That's all. No email_auth on GAE
Some built-in web2py functions have conditional commands for addressing AppEngine compatibility issues, it seems that this is not performed for the email authentication. Perhaps this problem could added to the web2py issues list? On 26 ene, 02:43, pattu itapplicationmanagem...@gmail.com wrote: I didn't get much success in getting logging to work with the GAE - there is a slice for it, but it all is pretty complicated. BUT... I tried the following code in the interactive console on the dev engine: import smtplib host = 'gmail.com' port = 587 server = smtplib.SMTP(host, port) server.help AND got a traceback: /home/pattu/google_appengine/google/appengine/ext/admin/__init__.py, line 317, in post exec(compiled_code, globals()) File string, line 7, in module File /usr/lib/python2.6/smtplib.py, line 239, in __init__ (code, msg) = self.connect(host, port) File /usr/lib/python2.6/smtplib.py, line 295, in connect self.sock = self._get_socket(host, port, self.timeout) File /usr/lib/python2.6/smtplib.py, line 273, in _get_socket return socket.create_connection((port, host), timeout) AttributeError: 'module' object has no attribute 'create_connection' Googling about sockets and google app engine lead you to the following informative threads: http://code.google.com/appengine/docs/python/runtime.html: The Sandbox ... (snip,snip) ... An App Engine application cannot: ... (snip,snip) ... open a socket or access another host directly. An application can use the App Engine URL fetch service to make HTTP and HTTPS requests to other hosts on ports 80 and 443, respectively. So SMTP auth on 587 will not work, you must use the GAE email interface as documented other places. Life goes on. A bit of a shame for me, because for a little app, deployment on GAE seems like the easiest answer. GAE is a special environment with special restrictions. Web2py really shines for the quick little app development... but decent lowend python shared hosting seems to be a bit hard to find at this time. Several places I have wandered to imply the need to get Apache configured... not really a fun job for a quick little app. - pattu On Jan 24, 8:24 pm, Alan Etkin spame...@gmail.com wrote: You could try printing this command's output to the console in development: ... server.login(email, password) ... It is in line 29 of web2py source installation/gluon/contrib/ login_methods/email_auth.py gluon/contrib/login_methods/email_auth.py On 23 ene, 13:48,pattuitapplicationmanagem...@gmail.com wrote: Hi - Fairly silently. In the case of running the dev_appserver.py - submitting a correct email and password to login form just shows a very quick response of invalid login (flash message). Compared to running the web2py built in web server the response is too fast to let me believe that my computer talked to the smtp server I am validating against.. i.e. the request just failed as a failed login. But I am testing against my organization's smtp and against the gmail smtp, which work fine with the web2py built in server. I am not an experienced python debugger, and my attempts to try and step through the smtplib code fail with the GAE - funny errors like non-ascii characters in the source files, which make me think that debugger I tried (winpdb) didn't like the GAE environment. The deployed application also shares the same problem. Somehow debugging whether GAE is letting a TLS request go through correctly seems puzzling. I was fairly interested in using the GAE because it came with an easy https access option, (I don't mind the appspot subdomain). I have a short term app that I wanted security for. Googling I've seen some mentions that sockets are not implemented fully on GAE, but I don't know if that is currently the case. I would be delighted to get an error message or exception - let me know how to turn that on if it exists in inside the smtplib, for example. There could be some silly mistake I am making - I have made a few hundred so far, but because the implementation in this case seems so simple, I think that GAE might be at fault. Is there a workaround do you think? In anycase this development process has really been fun - web2py is a nice environment to work in. On Jan 23, 7:21 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Did you try it? How does it fail? On Jan 23, 4:07 am,pattuitapplicationmanagem...@gmail.com wrote: Hi - I have found 150 answers to different questions already by googling my way through this list, but I didn't find anything addressing email_auth (using an smtp server). Here is code that works fine running the web2py server, but seems to fail both on the GAE development server and also deployed. I might have missed something, but I have tried to be exhaustive here:
[web2py] using Janrain Oauth and normal login at the same time
Dear all , how can i use Janrain Oauth and normal login at the same time ??
[web2py] Bug in DAL update shortcut
Hi, I've been bugged by a bug in DAL update lately. The shortcut db.table[i] = dict(field=value,...) fails with an error No such record : i, even if the record 'i' definitely exists. I'm running against a MySQL database, and it turns out MySQL reports 0 (records affected) on update if all the field values you mention in your dict() already has the new/correct values - it probably optimizes and check whether an actual record change really is needed. The code causing the bug is in dal.py: Table.__setitem__() where one assumes 0 from update indicates an error, while it really is simply the number of rows affected - an error presumable results in an exception of some sort. So, the update is actually successful, but no records has been changed. The error message is definitely misleading/wrong. My real question is how to proceed on reporting this bug... And for somebody else to consider the implications on other db drivers :-) Best regards Jens Andersen, Langhus, Norway
Re: [web2py] Change the case in auth.navbar?
Remember you can do it with css: .auth_navbar a { text-transform:capitalize; } Now I prefer to do my own bar because I think is too long now. I'm using something like this: Unlogged user: Log in | Register. Logged User: Profile | Logout The other things I move it into user.html. So if you want to recover a pass or a user name you have to go to login page. 2012/1/25 naveed w...@naveed.net The navbar for me shows like this: Login | Register | forgot username? | Lost password? The forgot username? is in all lowercase, while the others are in sentence case. What is the cleanest way of making them consistent? Thanks! -- http://www.tecnodoc.com.ar
[web2py] Re: Bug in DAL update shortcut
What I usually do is check here: http://code.google.com/p/web2py/issues/list If the issue isn't posted by other user I apply for a fix there, appending a proposed modification if I managed to find it However, I've seen web2py developers just modify the source with information provided in the users list, posting back when it was solved. On 26 ene, 08:45, Jens Andersen jens.andersen.pri...@gmail.com wrote: Hi, I've been bugged by a bug in DAL update lately. The shortcut db.table[i] = dict(field=value,...) fails with an error No such record : i, even if the record 'i' definitely exists. I'm running against a MySQL database, and it turns out MySQL reports 0 (records affected) on update if all the field values you mention in your dict() already has the new/correct values - it probably optimizes and check whether an actual record change really is needed. The code causing the bug is in dal.py: Table.__setitem__() where one assumes 0 from update indicates an error, while it really is simply the number of rows affected - an error presumable results in an exception of some sort. So, the update is actually successful, but no records has been changed. The error message is definitely misleading/wrong. My real question is how to proceed on reporting this bug... And for somebody else to consider the implications on other db drivers :-) Best regards Jens Andersen, Langhus, Norway
[web2py] DAL equivalent of SQL's 'HAVING' clause
How would a do a query like this in DAL? SELECT count(uuid) as aantal, ltitle from akb_articles group by ltitle having count(uuid) 1 Regards. Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)
Re: [web2py] DAL equivalent of SQL's 'HAVING' clause
try: _count = db.akb_articles.uuid.count() rows = db(db.akb_articles).select(_count, db.akb_articles.ltitle, groupby= db.akb_articles.ltitle, having=_count1)
Re: [web2py] DAL equivalent of SQL's 'HAVING' clause
On 26 January 2012 14:48, Vasile Ermicioi elff...@gmail.com wrote: try: _count = db.akb_articles.uuid.count() rows = db(db.akb_articles).select(_count, db.akb_articles.ltitle, groupby= db.akb_articles.ltitle, having=_count1) Thanks. How did I miss 'having' in the book? I could not find it there. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)
[web2py] Re: Bug in DAL update shortcut
Thx! Added issue#638
Re: [web2py] Re: Mixing/supporting CMS with Web2py
I switched the editor of instant press to cleditor. A lightweight and simple WYSIWYG editor. http://premiumsoftware.net/cleditor/ 2012/1/25 Bruno Rocha rochacbr...@gmail.com For those who are looking for inspiration on how to develop a good traditional-cms with web2py, take a look in to http://www.fork-cms.com/before starting your code! -- Bruno Rocha [http://rochacbruno.com.br] -- http://www.tecnodoc.com.ar
Re: [web2py] DAL equivalent of SQL's 'HAVING' clause
Pity one cannot use it as a query for SQLForm.grid. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)
[web2py] Re: using Janrain Oauth and normal login at the same time
Ok i did it its like this , with the help of http://www.web2pyslices.com/slices/take_slice/124 : db.py : from gluon.contrib.login_methods.rpx_account import RPXAccount from gluon.contrib.login_methods.extended_login_form import ExtendedLoginForm url = http://localhost:8000/%s/default/user/login; % request.application rpxform = RPXAccount(request, api_key='a096b5b9ccb5cdecb2d29ab993746e10338b4d3b', domain='hassanalnator', url = url, embed=True ) in the controller : def user(): rpx = '' registerurl=URL('default','user',args='register',vars=dict(_next='/ %s/default/index'%request.application)) if request.vars.token: auth.settings.login_form = rpxform return dict(form=auth()) if 'login' in request.args: rpx = rpxform.login_form() html = DIV(H1('Login'), rpx,BR(),BR(), H1(A('Click here to register', _href=registerurl),BR(), 'Or sign-in using your email and password'), auth(), ) else: html = auth() return dict(form=html) and in the user view : {{extend 'layout.html'}} {{title=dict( login='', register=H1('Register'), logout=H1('Logged out'), profile=H1('Change your profile'), change_password=H1('Change your password'), request_reset_password=H1('Reset your password'), reset_password=H1('Define a new password'), verify_email=H1('Verification mail'), retrieve_username=H1('Request username'), not_authorized=H1('Denied!') )}} {{=title[request.args(0)]}} {{=form}} {{if request.args(0)=='login':}} {{if not 'request_reset_password' in auth.settings.actions_disabled:}} br/a href={{=URL(r=request,args='request_reset_password')}}Remember Password/a {{pass}} {{pass}} Enjoy ...
Re: [web2py] DAL equivalent of SQL's 'HAVING' clause
How did I miss 'having' in the book? I could not find it there. I also can't find it in the book. But I used it before
[web2py] Re: Chunked downloads and corrupt files with Internet Explorer 8 (IE8)
which python version? Did you try different python versions? On Jan 26, 2:52 am, Phyo Arkar phyo.arkarl...@gmail.com wrote: I am using 1.99.1 and it happens to me frequently. If download is big ( for my case 100,200 MB) it usually end up with corrupted file. Tested on Local wifi network with 300 Mbps. On Wed, Jun 15, 2011 at 4:21 PM, Stefan Scholl stefan.sch...@gmail.comwrote: Is nobody else experiencing this problem? Is nobody using Internet Explorer to download more than 64KiB from a web2py app? On 6 Mai, 13:03, Stefan Scholl stefan.sch...@gmail.com wrote: The classicdownloadfunction: defdownload(): return response.download(request, db) I'm developing on localhost (127.0.0.1, no SSL) and one strange thing happened: Downloads in IE8 (Windows XP) were all corrupt/broken if they weren't below 64KiB in size. Very easy to see with large images. Using a higher value for the argument 'chunk_size' solves this problem, up to this new maximum. web2py 1.91.6
[web2py] Re: begin a transaction manually ?
You cannot clone it. but can make two. On Jan 26, 3:10 am, Sebastian E. Ovide sebastian.ov...@gmail.com wrote: 2) yes but not concurrently, unless you have two db objects. Is it possible to clone a db object ? instead of declare 2 (or n) db objects in the model, can I create a new one a controller based on db declared in the model ? -- Sebastian E. Ovide
Re: [web2py] Re: begin a transaction manually ?
maybe if there's a way to .close() the db to be able to define it again. http://zerp.ly/rochacbruno Em 26/01/2012 12:18, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: You cannot clone it. but can make two. On Jan 26, 3:10 am, Sebastian E. Ovide sebastian.ov...@gmail.com wrote: 2) yes but not concurrently, unless you have two db objects. Is it possible to clone a db object ? instead of declare 2 (or n) db objects in the model, can I create a new one a controller based on db declared in the model ? -- Sebastian E. Ovide
[web2py] language translation in web2py
Dear All, How can i change the language of my website with a click of a button or how can i use the translation plugin in my site or can make Google translate my site
[web2py] Re: Error with ignore_common_filters when using a select string (instead of a DAL query)
bump
[web2py] Re: Problem with legacy tables
Yes indeed. But the quistion is, if this will be solved some day ? I can stick with old version for a while, but some day I will have to/ need to upgrade. The best of web2py was for me that it is backward compatible. On 26 Sty, 11:51, Alan Etkin spame...@gmail.com wrote: In this issue:http://code.google.com/p/web2py/issues/detail?id=634 I am trying to solve a (supposedly) similar problem, when using SQLFORM with tables wich have custom id field names. Maybe there could be used a common workaround to solve both problems. Anyway, the custom id problem reproduces only in the new non-stable version. On 25 ene, 18:25, Omi Chiba ochib...@gmail.com wrote: Sound like it's related to the issue I posted before.http://code.google.com/p/web2py/issues/detail?id=547 The bottom line is you cannot use SQLFORM.grid/SQLTABLE if you don't have id field.I have also legacy table which doesn't have field called id. I gave using SQLFORM.grid and create the list with table/table. If you're looking for paging, you can use the following plugin which I use. http://dev.s-cubism.com/plugin_paginator On Jan 25, 8:51 am, brushek brus...@gmail.com wrote: I'm using vim, editing files directly on server. On 25 Sty, 15:47, Marin Pranjić marin.pran...@gmail.com wrote: What do you use for development? If you use an IDE with debugging step-by-step featues, you can find out where does id come from On Wed, Jan 25, 2012 at 3:35 PM, brushek brus...@gmail.com wrote: On 25 Sty, 15:17, Anthony abasta...@gmail.com wrote: I left the following comment with the issue: shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id ,db.gk_shop.nazwa_modulu],user_signature=False,deletable=False) Note, your refer to db.gk_shop.id, but there is no id field in that table. The name of the id field is actually db.gk_shop.id_modulo (the field _type_ is id, but the field _name_ is id_modulo). In your code, you have to refer to the field name. Anthony OK, I changed the controller: shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id_modulu,db.gk_shop.nazwa_ modulu],user_signature=False,deletable=False) and it isn't the case, the error still remain: Traceback (most recent call last): File /home/users/brushek/web2py-dev/gluon/restricted.py, line 204, in restricted exec ccode in environment File /home/users/brushek/web2py-dev/applications/sdadmin/ controllers/default.py, line 138, in module File /home/users/brushek/web2py-dev/gluon/globals.py, line 172, in lambda self._caller = lambda f: f() File /home/users/brushek/web2py-dev/gluon/tools.py, line 2551, in f return action(*a, **b) File /home/users/brushek/web2py-dev/applications/sdadmin/ controllers/default.py, line 16, in shop shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id_modulu,db.gk_shop.nazwa_ modulu],user_signature=False,deletable=False) File /home/users/brushek/web2py-dev/gluon/sqlhtml.py, line 1587, in grid _class='web2py_form', File /home/users/brushek/web2py-dev/gluon/html.py, line 1960, in process self.validate(**kwargs) File /home/users/brushek/web2py-dev/gluon/html.py, line 1907, in validate if self.accepts(**kwargs): File /home/users/brushek/web2py-dev/gluon/sqlhtml.py, line 1042, in accepts formname_id = '.'.join(str(self.record[k]) File /home/users/brushek/web2py-dev/gluon/dal.py, line 5317, in __getattr__ 'firebird': FireBirdAdapter, File /home/users/brushek/web2py-dev/gluon/dal.py, line 5308, in __getitem__ 'postgres': PostgreSQLAdapter, KeyError: 'id'
[web2py] Re: Need help with selecting multiple rows into a single row
This is one way. You surely will find a more fast/enhanced ways by searching web2py and Python features: order_numbers = set([row.purchase_order.po_number for row in rows]) new_data = [[number,] + [row.item.id for row in rows if row.purchase_order.po_number == number] for number in order_numbers] new_data.insert([purchase_order.po_number,]) max_fields = max([len(row) for row in new data]) csv_output = for row in new_data: extra_fields = max_fields - len(row) csv_output += ,.join(row) + ,*extra_fields + \n On 24 ene, 22:34, Adi adnan.smajlo...@gmail.com wrote: Thanks Alan for your advise, but I'm not sure how I would implement what you are suggesting? For now I use smartgrid's onpdate and oncreate events to update purchase order items field (type list:string) with all items for that particular order, but I hate this solution since it's computed value. This way I can product csv easier, but would rather flatten two tables into one at the time when the report is run. Thanks once again... and i'm still open for more suggestions, if anyone has any idea. Adi
[web2py] Re: email updates not recd for this group
i also have not received the digest since the 19th.
[web2py] getting started with dotcloud
Hi, I'm trying to follow the web2py tutorial that was posted here a while back. Unfortunately that was written using the older version of the command line tools, so some things just don't exist anymore. But I'm going back and forth between the new documentation and the old. I've done the following: dotcloud created myapp I've create the dotcloud.yml file I've symlinked wsgihandler.py to wsgi.py as instructed I've got a requirements.txt file listing my dependencies When I do dotcloud deploy myapp . It uploads, starts the build, then I get: 17:15:44 [www] running build_scripts 17:15:44 [www] creating build/scripts-2.6 17:15:44 [www] error: file '/home/dotcloud/rsync-1327598128997/web2py/ w2p_apps' does not exist 17:15:45 [www] -- Build failed: python ./setup.py install failed with return code 1 17:15:45 --- Aborting due to build failure Any help would be very much appreciated. Thanks, Brad
[web2py] Re: email updates not recd for this group
I've seen a few other reports of this problem from other Google Groups (specifically no digests since Jan. 19), so seems to be a general problem. Maybe try reporting it to Google. Doesn't appear to be anything we can control on our end (there's no admin option that controls the availability of digests). Also, maybe confirm that you are still signed up for the digests -- don't know if the problem is that digests are not going out, or the system is somehow unsubscribing users from the digests (if the latter, maybe you can just subscribe again). Anthony On Thursday, January 26, 2012 12:29:24 PM UTC-5, howesc wrote: i also have not received the digest since the 19th.
[web2py] Re: web2py with Plesk Control Panel ?
Ok, so if I install python 2.6 how do I tell apache, web2py, mod_wsgi and/or mod_python to use the python2.6 version ?
Re: [web2py] getting started with dotcloud
2012/1/26 Brad Miller bonel...@gmail.com: Hi, I'm trying to follow the web2py tutorial that was posted here a while back. Unfortunately that was written using the older version of the command line tools, so some things just don't exist anymore. But I'm going back and forth between the new documentation and the old. I've done the following: dotcloud created myapp I've create the dotcloud.yml file I've symlinked wsgihandler.py to wsgi.py as instructed I've got a requirements.txt file listing my dependencies When I do dotcloud deploy myapp . It uploads, starts the build, then I get: 17:15:44 [www] running build_scripts 17:15:44 [www] creating build/scripts-2.6 17:15:44 [www] error: file '/home/dotcloud/rsync-1327598128997/web2py/ w2p_apps' does not exist 17:15:45 [www] -- Build failed: python ./setup.py install failed with return code 1 17:15:45 --- Aborting due to build failure you must delete the file setup.py included in web2py directory. Dotcloud interprets it as an installer and it's not. José L.
[web2py] Re: web2py with Plesk Control Panel ?
would I change the first line in wsgihandler.py from #!/usr/bin/env python to #!/usr/bin/env /usr/bin/python26 ?
Re: [web2py] Problem with .smartgrid on tables with links
I've been away for a few days but came back today and updated my install again. Now this is working on the list page from .smartgrid, but when I try to update a record I'm getting the following traceback... Traceback(most recent call last): FileC:\dev\web2py\gluon\restricted.py,line204,inrestricted execccodeinenvironment FileC:/dev/web2py/applications/infocenter/controllers/administration.py http://127.0.0.1:8000/admin/default/edit/infocenter/controllers/administration.py,line1816,inmodule FileC:\dev\web2py\gluon\globals.py,line172,inlambda self._caller=lambdaf:f() FileC:\dev\web2py\gluon\tools.py,line2551,inf returnaction(*a, **b) FileC:/dev/web2py/applications/infocenter/controllers/administration.py http://127.0.0.1:8000/admin/default/edit/infocenter/controllers/administration.py,line457,inassetTypes paginate=15,maxtextlength=45) FileC:\dev\web2py\gluon\sqlhtml.py,line1975,insmartgrid user_signature=user_signature,**kwargs) FileC:\dev\web2py\gluon\sqlhtml.py,line1593,ingrid next=referrer) FileC:\dev\web2py\gluon\html.py,line1960,inprocess self.validate(**kwargs) FileC:\dev\web2py\gluon\html.py,line1907,invalidate if self.accepts(**kwargs): FileC:\dev\web2py\gluon\sqlhtml.py,line1088,inaccepts hideerror=hideerror, FileC:\dev\web2py\gluon\html.py,line1807,inaccepts status=self._traverse(status,hideerror) FileC:\dev\web2py\gluon\html.py,line749,in_traverse newstatus=c._traverse(status,hideerror)andnewstatus FileC:\dev\web2py\gluon\html.py,line749,in_traverse newstatus=c._traverse(status,hideerror)andnewstatus FileC:\dev\web2py\gluon\html.py,line749,in_traverse newstatus=c._traverse(status,hideerror)andnewstatus FileC:\dev\web2py\gluon\html.py,line749,in_traverse newstatus=c._traverse(status,hideerror)andnewstatus FileC:\dev\web2py\gluon\html.py,line756,in_traverse newstatus=self._validate() FileC:\dev\web2py\gluon\html.py,line1572,in_validate (value,errors) =validator(value) FileC:\dev\web2py\gluon\validators.py,line549,in__call__ elifstr(rows[0]._id) !=str(self.record_id): FileC:\dev\web2py\gluon\dal.py,line5466,in__getattr__ return self[key] FileC:\dev\web2py\gluon\dal.py,line5457,in__getitem__ returndict.__getitem__(self,key) KeyError:'_id' I'm assuming it has something to do with my use of primary key-field being something other than 'id'. Here is the setup for the tables being updated in this case: assetType = db.define_table('assetType', Field('assetTypeId', 'id'), Field('name', length=50, required=True, unique=True), format='%(name)s') assetType.name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'assetType.name')] assetType['_plural'] = 'Asset Types' -Jim On 1/19/2012 10:45 AM, Jim Steil wrote: Hi Just updated to the latest trunk this morning and now my smartgrids aren't working where the table being used has links. Here is what I'm getting: Traceback(most recent call last): FileC:\dev\web2py\gluon\restricted.py,line204,inrestricted execccodeinenvironment FileC:/dev/web2py/applications/infocenter/controllers/administration.py http://127.0.0.1:8000/admin/default/edit/infocenter/controllers/administration.py,line1816,inmodule FileC:\dev\web2py\gluon\globals.py,line172,inlambda self._caller=lambdaf:f() FileC:\dev\web2py\gluon\tools.py,line2530,inf returnaction(*a, **b) FileC:/dev/web2py/applications/infocenter/controllers/administration.py http://127.0.0.1:8000/admin/default/edit/infocenter/controllers/administration.py,line457,inassetTypes paginate=15,maxtextlength=45) FileC:\dev\web2py\gluon\sqlhtml.py,line1971,insmartgrid user_signature=user_signature,**kwargs) FileC:\dev\web2py\gluon\sqlhtml.py,line1819,ingrid iflink(row): FileC:\dev\web2py\gluon\sqlhtml.py,line1968,inlambda args=request.args[:nargs]+[args0,row.id]))) FileC:\dev\web2py\gluon\dal.py,line4996,in__getattr__ return self[key] FileC:\dev\web2py\gluon\dal.py,line4987,in__getitem__ returndict.__getitem__(self,key) KeyError:'id' If the table doesn't have any fields referencing other tables, then it works fine. Is it just me? -Jim
Re: [web2py] Change the case in auth.navbar?
Thanks, I didn’t think of that. This will help. From: Martín Mulone Sent: Thursday, January 26, 2012 06.17 To: web2py@googlegroups.com Subject: Re: [web2py] Change the case in auth.navbar? Remember you can do it with css: .auth_navbar a { text-transform:capitalize; }
Re: [web2py] Problem with .smartgrid on tables with links
Hi, I am not using smartgrid, and I am using regular tables (with the 'id' field), and I still get the same error (as described in my post): https://groups.google.com/d/topic/web2py/zH9rLsbxI_I/discussion I guess Massimo is still working on this?. Carlos
Re: [web2py] Problem with .smartgrid on tables with links
Thanks Carlos - not just me then... On 1/26/2012 12:31 PM, Carlos wrote: Hi, I am not using smartgrid, and I am using regular tables (with the 'id' field), and I still get the same error (as described in my post): https://groups.google.com/d/topic/web2py/zH9rLsbxI_I/discussion I guess Massimo is still working on this?. Carlos
[web2py] Re: Error with ignore_common_filters when using a select string (instead of a DAL query)
Please check trunk and let me know if the issue is resolved. On Jan 26, 10:19 am, pbreit pbreitenb...@gmail.com wrote: bump
[web2py] Re: Problem with legacy tables
Yes. This will be resolved. We are working on it. In fact it may be solved already. Please help us test trunk. On Jan 26, 11:00 am, brushek brus...@gmail.com wrote: Yes indeed. But the quistion is, if this will be solved some day ? I can stick with old version for a while, but some day I will have to/ need to upgrade. The best of web2py was for me that it is backward compatible. On 26 Sty, 11:51, Alan Etkin spame...@gmail.com wrote: In this issue:http://code.google.com/p/web2py/issues/detail?id=634 I am trying to solve a (supposedly) similar problem, when using SQLFORM with tables wich have custom id field names. Maybe there could be used a common workaround to solve both problems. Anyway, the custom id problem reproduces only in the new non-stable version. On 25 ene, 18:25, Omi Chiba ochib...@gmail.com wrote: Sound like it's related to the issue I posted before.http://code.google.com/p/web2py/issues/detail?id=547 The bottom line is you cannot use SQLFORM.grid/SQLTABLE if you don't have id field.I have also legacy table which doesn't have field called id. I gave using SQLFORM.grid and create the list with table/table. If you're looking for paging, you can use the following plugin which I use. http://dev.s-cubism.com/plugin_paginator On Jan 25, 8:51 am, brushek brus...@gmail.com wrote: I'm using vim, editing files directly on server. On 25 Sty, 15:47, Marin Pranjić marin.pran...@gmail.com wrote: What do you use for development? If you use an IDE with debugging step-by-step featues, you can find out where does id come from On Wed, Jan 25, 2012 at 3:35 PM, brushek brus...@gmail.com wrote: On 25 Sty, 15:17, Anthony abasta...@gmail.com wrote: I left the following comment with the issue: shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id ,db.gk_shop.nazwa_modulu],user_signature=False,deletable=False) Note, your refer to db.gk_shop.id, but there is no id field in that table. The name of the id field is actually db.gk_shop.id_modulo (the field _type_ is id, but the field _name_ is id_modulo). In your code, you have to refer to the field name. Anthony OK, I changed the controller: shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id_modulu,db.gk_shop.nazwa_ modulu],user_signature=False,deletable=False) and it isn't the case, the error still remain: Traceback (most recent call last): File /home/users/brushek/web2py-dev/gluon/restricted.py, line 204, in restricted exec ccode in environment File /home/users/brushek/web2py-dev/applications/sdadmin/ controllers/default.py, line 138, in module File /home/users/brushek/web2py-dev/gluon/globals.py, line 172, in lambda self._caller = lambda f: f() File /home/users/brushek/web2py-dev/gluon/tools.py, line 2551, in f return action(*a, **b) File /home/users/brushek/web2py-dev/applications/sdadmin/ controllers/default.py, line 16, in shop shop=SQLFORM.grid(db.gk_shop,fields=[db.gk_shop.id_modulu,db.gk_shop.nazwa_ modulu],user_signature=False,deletable=False) File /home/users/brushek/web2py-dev/gluon/sqlhtml.py, line 1587, in grid _class='web2py_form', File /home/users/brushek/web2py-dev/gluon/html.py, line 1960, in process self.validate(**kwargs) File /home/users/brushek/web2py-dev/gluon/html.py, line 1907, in validate if self.accepts(**kwargs): File /home/users/brushek/web2py-dev/gluon/sqlhtml.py, line 1042, in accepts formname_id = '.'.join(str(self.record[k]) File /home/users/brushek/web2py-dev/gluon/dal.py, line 5317, in __getattr__ 'firebird': FireBirdAdapter, File /home/users/brushek/web2py-dev/gluon/dal.py, line 5308, in __getitem__ 'postgres': PostgreSQLAdapter, KeyError: 'id'
[web2py] Re: Problem with .smartgrid on tables with links
please check trunk again. On Jan 26, 12:34 pm, Jim Steil j...@qlf.com wrote: Thanks Carlos - not just me then... On 1/26/2012 12:31 PM, Carlos wrote: Hi, I am not using smartgrid, and I am using regular tables (with the 'id' field), and I still get the same error (as described in my post): https://groups.google.com/d/topic/web2py/zH9rLsbxI_I/discussion I guess Massimo is still working on this?. Carlos
[web2py] Re: language translation in web2py
How can i change the language of my website ... The requested language is determined by the 'Accept-Language' field in the HTTP header, but this selection can be overwritten programmatically by requesting a specific file, for example: 1 T.force('it-it') ... If you want to let the user choose its language by clicking in a link or button. Your controller could use the force() method with the option retrieved clien-side. (i.e. with a SQLFORM.factory() object or simply a list of urls with arguments)
Re: [web2py] getting started with dotcloud
That did it, thanks! Is there a newer version of the tutorial somewhere? I have some basic questions like how do I get the app to start with an admin password? Thanks, Brad -- Brad Miller On Thursday, January 26, 2012 at 12:13 PM, José Luis Redrejo Rodríguez wrote: 2012/1/26 Brad Miller bonel...@gmail.com (mailto:bonel...@gmail.com): Hi, I'm trying to follow the web2py tutorial that was posted here a while back. Unfortunately that was written using the older version of the command line tools, so some things just don't exist anymore. But I'm going back and forth between the new documentation and the old. I've done the following: dotcloud created myapp I've create the dotcloud.yml file I've symlinked wsgihandler.py to wsgi.py as instructed I've got a requirements.txt file listing my dependencies When I do dotcloud deploy myapp . It uploads, starts the build, then I get: 17:15:44 [www] running build_scripts 17:15:44 [www] creating build/scripts-2.6 17:15:44 [www] error: file '/home/dotcloud/rsync-1327598128997/web2py/ w2p_apps' does not exist 17:15:45 [www] -- Build failed: python ./setup.py install failed with return code 1 17:15:45 --- Aborting due to build failure you must delete the file setup.py included in web2py directory. Dotcloud interprets it as an installer and it's not. José L.
Re: [web2py] Re: Problem with .smartgrid on tables with links
That fixed it. Thanks Massimo! -Jim On 1/26/2012 12:55 PM, Massimo Di Pierro wrote: please check trunk again. On Jan 26, 12:34 pm, Jim Steilj...@qlf.com wrote: Thanks Carlos - not just me then... On 1/26/2012 12:31 PM, Carlos wrote: Hi, I am not using smartgrid, and I am using regular tables (with the 'id' field), and I still get the same error (as described in my post): https://groups.google.com/d/topic/web2py/zH9rLsbxI_I/discussion I guess Massimo is still working on this?. Carlos
[web2py] Re: Error with ignore_common_filters when using a select string (instead of a DAL query)
Fixed, thank you. So do you think that functionality will remain? It definitely comes in handy where DAL doesn't support a query type or even if someone just wants to use some SQL but get the rest of the DAL functionality. Certainly there are security ramifications if you are accepting user generated queries. And now that I think about it, there are security issues with my implementation since I am taking a search parameter.
[web2py] Re: Error with ignore_common_filters when using a select string (instead of a DAL query)
I agree. On Jan 26, 3:34 pm, pbreit pbreitenb...@gmail.com wrote: Fixed, thank you. So do you think that functionality will remain? It definitely comes in handy where DAL doesn't support a query type or even if someone just wants to use some SQL but get the rest of the DAL functionality. Certainly there are security ramifications if you are accepting user generated queries. And now that I think about it, there are security issues with my implementation since I am taking a search parameter.
[web2py] Re: Error with ignore_common_filters when using a select string (instead of a DAL query)
Perhaps the adapters that take raw string queries can be sanitized with class internal methods On 26 ene, 18:34, pbreit pbreitenb...@gmail.com wrote: Fixed, thank you. So do you think that functionality will remain? It definitely comes in handy where DAL doesn't support a query type or even if someone just wants to use some SQL but get the rest of the DAL functionality. Certainly there are security ramifications if you are accepting user generated queries. And now that I think about it, there are security issues with my implementation since I am taking a search parameter.
[web2py] Any example of Multiple login forms working?
Folks, I'm trying to implement multiple login forms (web2py basic + facebook) something like this: from gluon.contrib.login_methods.extended_login_form import ExtendedLoginForm other_form = FaceBookAccount(globals()) auth.settings.login_form = ExtendedLoginForm(request, auth, other_form, signals=['token']) But I get this error accessing index (no login required): /models/db.py https://admin.titogarrido.webfactional.com/admin/default/edit/festbook/models/db.py, line 211, in module auth.settings.login_form = ExtendedLoginForm(request, auth, other_form, signals=['token']) TypeError: __init__() got multiple values for keyword argument 'signals' What am I doing wrong? Regards, Tito -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___
[web2py] Empty session after login. How can this happen?
My application was working yesterday. I was able to log in and test. Today, Web2py is not writing a session file. Looking in the sessions directory, I have a session file dated the 17th and one dated yesterday. No session file dated today, though I am able to log in to the app. The app gives me a ticket when it tries to execute my models, because I set certain field defaults based on session values. Here is the traceback: Traceback (most recent call last): File /home/cjk/svpy/gluon/restricted.py, line 204, in restricted exec ccode in environment File /home/cjk/svpy/applications/sv/models/e.py, line 147, in module (db.property.org_link==session.auth.user.org_link)) AttributeError: 'NoneType' object has no attribute 'user' Anybody got a clue what's going on?
Re: [web2py] How do I aggregate accounts using OAuth web2py?
Hey Matthew, Were you able to implement facebook + web2py login? Thanks, Tito On Fri, Dec 23, 2011 at 11:10 AM, Matthew matthew.g.nor...@gmail.comwrote: Thank you, Mic! -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___
Re: [web2py] How do I aggregate accounts using OAuth web2py?
On Fri, Jan 27, 2012 at 12:06 AM, Tito Garrido titogarr...@gmail.comwrote: Hey Matthew, Were you able to implement facebook + web2py login? I have facebook + google + web2py login in http://movu.ca/demo (source in github) -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Empty session after login. How can this happen?
web2py version was updated? permission to /sessions have changed? try to clean your browser cache, cookies etc and test again On Thu, Jan 26, 2012 at 11:55 PM, Cliff cjk...@gmail.com wrote: My application was working yesterday. I was able to log in and test. Today, Web2py is not writing a session file. Looking in the sessions directory, I have a session file dated the 17th and one dated yesterday. No session file dated today, though I am able to log in to the app. The app gives me a ticket when it tries to execute my models, because I set certain field defaults based on session values. Here is the traceback: Traceback (most recent call last): File /home/cjk/svpy/gluon/restricted.py, line 204, in restricted exec ccode in environment File /home/cjk/svpy/applications/sv/models/e.py, line 147, in module (db.property.org_link==session.auth.user.org_link)) AttributeError: 'NoneType' object has no attribute 'user' Anybody got a clue what's going on? -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Standalone DAL Usiage - Insert from a Dictionary (vs bulk_insert)
I'm testing standalone DAL usage - basically using the DAL to help move/convert some tables from an external db. Basically I'm trying to populate a dictionary with a subset of data from an external database and then insert a series of data records into a new table. I expected to be able to populate a dictionary with a subset of the selected fields but it appears that the db.insert method will not accept a dictionary ( I get the error 'insert() takes exactly 1 argument (2 given'). I was able to get this to work using the bulk_insert method instead, but this is not very intuitive. (See the code below for a specific example) Is there a reason why the DAL insert method should/could not provide dictionary support (I checked the docs and this is not really covered in any detail). Code Sample Something like this: # Source db = sdb() sdb = DAL(postgres://postgres:@localhost:5432/testdb) sdb.define_table('mytbl', Field('id', type='integer'), Field('fname', type='string', length=10), Field('lname', type='string', length=10), # Target db = ddb() ddb = DAL(sqlite://test.db) ddb.define_table('mytbl', Field('id', type='integer'), Field('fname', type='string', length=10), Field('lname', type='string', length=10), def populate_table(): for row in sdb().select(sdb.mytbl.ALL): # build a dict for tbl insert for fldname in sdb().mytbl.fields: ddict[fldname] = row[fldname] # commit changes try: #ddb.mytbl.insert(ddict) # --- error - insert() takes exactly 1 argument (2 given) ddb.mytbl.bulk_insert([ddict])# --- works ddb.commit() except: ddb.rollback()
Re: [web2py] Standalone DAL Usiage - Insert from a Dictionary (vs bulk_insert)
You have to unpack the dictionary with ** ddb.mytbl.insert*(***ddict) In Python dictionaries can be unpacked using ** and lists are unpacked with *, it is knows as *args and **kwargs optionally you can use the db.mytbl.filter_fields to remove the unknown fields from the dict. -- Bruno Rocha [http://rochacbruno.com.br]