Re: [web2py] Re: running web2py on Android?
LOL - root the android has a meaning in my part of the world that is apparently not universal. Let's just say that many lonely geeks may be pining for this to become a viable option at some point in their lives... Dave M. On 15 October 2010 14:58, Thadeus Burgess thade...@thadeusb.com wrote: You will need to root the android, install a real shell like bash, install dev tools, install python, create an app that will launch a web2py app. -- Thadeus On Thu, Oct 14, 2010 at 8:53 PM, Bruno Rocha rochacbr...@gmail.comwrote: N810 - http://www.youtube.com/watch?v=s0fsjGVIGPU 2010/10/14 mdipierro mdipie...@cs.depaul.edu Some people here have need running on windows CE, iPhone, N800 and Android. I am not sure what has been tried but if it starts it should work fine since all required modules are imported at the beginning. On Oct 14, 7:58 pm, Darcy Clark da...@qualitysystems.com wrote: I found a June 2009 post to this group on running web2py on Android ? Just wondering if anyone else has tried this since with any success ?. Cherrypy seems to run on Android [http://www.defuze.org/archives/228- running-cherrypy-on-android-with-sl4a.html]. I don't have an Android phone to try it myself, but I do find the idea of running web2py on a phone somewhat interesting. -- http://rochacbruno.com.br
Re: [web2py] Re: Vote for a new logo
Comments are working now, lets test and comment on some logos! http://www.blouweb.com/logovote 2010/10/15 mdipierro mdipie...@cs.depaul.edu I agree. The one Martin made is good but ... 1) should made to run on GAE 2) should use RPX for login 3) should provide multiple lists of logos for multiple companies 4) should sort logos and vote with rating [*] (plugin rating?) 5) allow visitor to comment on logos {{=plugin_wiki.widget('comment','logo',id)}}
[web2py] Re: Vote for a new logo
I will add some comments here. 1) It is important to avoid brand confusion with web.py (the two has to be visible) 2) It is not a good idea to have a logo that looks like it is falling apart 3) As much as I may like snakes, I am not convinced reptiles convey a professional image. Even if a logo may not be appropriate for the official site... many of these logos are really good and should be put to use. We have web2py- utils, web2pyslices, etc. and we will have more sites to come. We can keep a common page layout and use different logos. Massimo On Oct 15, 1:03 am, Bruno Rocha rochacbr...@gmail.com wrote: Comments are working now, lets test and comment on some logos! http://www.blouweb.com/logovote 2010/10/15 mdipierro mdipie...@cs.depaul.edu I agree. The one Martin made is good but ... 1) should made to run on GAE 2) should use RPX for login 3) should provide multiple lists of logos for multiple companies 4) should sort logos and vote with rating [*] (plugin rating?) 5) allow visitor to comment on logos {{=plugin_wiki.widget('comment','logo',id)}}
Re: [web2py] Re: Vote for a new logo
I added your comment and some more important info to http://www.blouweb.com/logovote/default/upload 2010/10/15 mdipierro mdipie...@cs.depaul.edu I will add some comments here. 1) It is important to avoid brand confusion with web.py (the two has to be visible) 2) It is not a good idea to have a logo that looks like it is falling apart 3) As much as I may like snakes, I am not convinced reptiles convey a professional image. Even if a logo may not be appropriate for the official site... many of these logos are really good and should be put to use. We have web2py- utils, web2pyslices, etc. and we will have more sites to come. We can keep a common page layout and use different logos. Massimo On Oct 15, 1:03 am, Bruno Rocha rochacbr...@gmail.com wrote: Comments are working now, lets test and comment on some logos! http://www.blouweb.com/logovote 2010/10/15 mdipierro mdipie...@cs.depaul.edu I agree. The one Martin made is good but ... 1) should made to run on GAE 2) should use RPX for login 3) should provide multiple lists of logos for multiple companies 4) should sort logos and vote with rating [*] (plugin rating?) 5) allow visitor to comment on logos {{=plugin_wiki.widget('comment','logo',id)}} -- http://rochacbruno.com.br
[web2py] Re: web2py 1.87.3 is OUT
Hi Chris, In April we worked out the following procedure to upload and install packed web2py applications at webfaction: 1) Log on to webfaction via terminal/ssh 2) Go to your remote web2py/applications/ directory 3) As the user who is the owner of the Welcome application, manually create a directory 4) Upload your web2py application via the web interface and rename it to match the name of the directory you created manually This procedure worked at webfaction until I upgraded to web2py version 1.87.x. I also installed web2py 1.87.3 running webfaction's custom install script for web2py, but that doesn't make any difference to unzipping version 1.87.3 over the older version, I get the same error. I tried ls -al, I am signed on as fitwise and the owner of the Welcome application is fitwise as well, nothing has changed in this case. Kind regards, Annet.
[web2py] Re: Vote for a new logo
On Oct 15, 3:17 am, mdipierro mdipie...@cs.depaul.edu wrote: I would have sworn this was in the book. Shame on me. It is now.
[web2py] Re: web2py 1.87.3 is OUT
Massimo and Ron, When I run python web2py.py I get the following ImportError: Traceback (most recent call last): File web2py.py, line 20, in ? import gluon.widget File /home/fitwise/webapps/web2py/web2py/gluon/widget.py, line 25, in ? import main File /home/fitwise/webapps/web2py/web2py/gluon/main.py, line 62, in ? from restricted import RestrictedError File /home/fitwise/webapps/web2py/web2py/gluon/restricted.py, line 18, in ? from utils import web2py_uuid File /home/fitwise/webapps/web2py/web2py/gluon/utils.py, line 10, in ? import hashlib ImportError: No module named hashlib Does this have anything to do with the problem? Annet.
[web2py] Re: cron @reboot not working on 1.87.3
Suggested patch: *** newcron.old.py Fri Oct 15 11:27:34 2010 --- newcron.py Fri Oct 15 11:29:08 2010 *** *** 175,181 task[id] = [] vals = s.split(',') for val in vals: ! if '-' in val and '/' not in val: val = '%s/1' % val if '/' in val: task[id] += rangetolist(val, id) --- 175,181 task[id] = [] vals = s.split(',') for val in vals: ! if val != '-1' and '-' in val and '/' not in val: val = '%s/1' % val if '/' in val: task[id] += rangetolist(val, id) Please confirm if you're going to apply it. Greets. On 14 oct, 22:43, Álvaro J. Iradier airad...@gmail.com wrote: Ok I found the problem, in rev 770b1f1298: http://code.google.com/p/web2py/source/diff?spec=svn770b1f129819eb108... in newcron.py: if val.find('/') -1: was changed to: if '-' in val and '/' not in val: val = '%s/1' % val if '/' in val: and it looks like there's something wrong with val = '-1/1', coming from the previous: 153 if line.startswith('@reboot'): 154 line=line.replace('@reboot', '-1 * * * *') However, I can't guess what the fix is... Greets. On 14 oct, 22:34, Álvaro J. Iradier airad...@gmail.com wrote: Thanks very much. Ok, so after trying: Works in 1.83.2. Doesn't work in 1.84.1 or newer. I don't see anything on the changelog for 1.84.1-4 related to cron, but clearly something was changed that stopped it from working. Greets. On 14 oct, 22:00, Bruno Rocha rochacbr...@gmail.com wrote: http://www.web2py.com/examples/static/version/web2py_src.zip http://www.web2py.com/examples/static/1.81.4/web2py_src.zip 2010/10/14 Álvaro J. Iradier airad...@gmail.com After upgrading web2py from 1.81.4 to latest 1.87.3, cron jobs at @reboot stopped working. This is my crontab file: #crontab * * * * * root *cron/pollsensors * * * * * root *cron/checkschedule 0 0 * * * root *cron/cleandata @reboot root *cron/cleandata @reboot root *cron/pollingloop The two last jobs simply won't start. Reverting to 1.81.4 works. Any idea? How can I download previous versions to track where it stopped working? Thanks very much. -- http://rochacbruno.com.br
[web2py] Re: Packaging web2py for Debian
Maybe You could use https://help.launchpad.net/Packaging/SourceBuilds/ if you'd create stable branch on bazar and add packaging recipy like https://code.edge.launchpad.net/~mdipierro/web2py/devel/+new-recipe from https://code.edge.launchpad.net/~mdipierro/web2py/devel (notice code.EDGE.launch...) On 13 okt., 20:29, mdipierro mdipie...@cs.depaul.edu wrote: I feel this will be a maintenance nightmare unless it somehow upgrades itself. The release process of debian is very slow compared to ours. On Oct 13, 3:12 pm, Michele Comitini michele.comit...@gmail.com wrote: Hi José, The .deb is badly needed to spread web2py even more! Would that be useful for ubuntu also which is probaly the most common linux distro? The packaging must also take into account that a machine could have different instances of web2py. It would be a good idea to have some tools in the .deb to support the creation of different instances, maybe throughhttp://pypi.python.org/pypi/virtualenvsothat upgrade of system python doesn't break everything as it usually happens on debian with other python frameworks. mic 2010/10/13 José L. jredr...@gmail.com: Hi, as it seems that time goes by, and no available packages for Debian are ready, I'm going to begin to work on it seriously to upload web2py to Debian. I know (http://groups.google.com/group/web2py/browse_thread/thread/45ea4327d7... ) Mark told he was going to work on it, but I think that I have been patient enough waiting since April. It's not only Debian is one of the most important Linux distribution, also many other distributions as Ubuntu are derivatives from Debian, so uploading web2py to Debian will bring it to many users in the Linux world. I'd like to have a package similar to the django one. There is a python-django package, and I'd like to make a python-web2py package to work in a similar way, so people don't need to relearn a new method of work. I'd like it to work as similar as possible to http://codeghar.wordpress.com/2007/12/01/django-in-ubuntu/. So, the main question for me is: once gluon is installed in the PYTHONPATH and web2py.py installed in / usr/bin, I would like to be able to tell the user: execute python web2py.py in any directory and point your browser to http://localhost:8000tobegin to work. But, as web2py structure is today, I don't know if such thing is possible (after adding every needed file to every needed path). If not, what other approaches might be used to make any user in the system able to use a system with a installed web2py structure? On the other hand, if more people want to collaborate in the packaging I'll be glad to open a project in alioth.debian.org, so we can work together. Regards. José L.
[web2py] Re: web2py 1.87.3 is OUT
This could be the problem, since you are probably on CentOS or Redhat a version of Python 2.5 will not have hashlib built in http://pypi.python.org/pypi/hashlib/20060408a is where you can get one tested on 2.3 and 2.4 I have not had to do something like this yet but I believe site- packages is probably where you would put it, not sure. http://groups.google.com/group/web2py-developers/browse_thread/thread/6d8d80437938a4b7 talks about this. Ron On Oct 15, 12:50 am, annet annet.verm...@gmail.com wrote: Massimo and Ron, When I run python web2py.py I get the following ImportError: Traceback (most recent call last): File web2py.py, line 20, in ? import gluon.widget File /home/fitwise/webapps/web2py/web2py/gluon/widget.py, line 25, in ? import main File /home/fitwise/webapps/web2py/web2py/gluon/main.py, line 62, in ? from restricted import RestrictedError File /home/fitwise/webapps/web2py/web2py/gluon/restricted.py, line 18, in ? from utils import web2py_uuid File /home/fitwise/webapps/web2py/web2py/gluon/utils.py, line 10, in ? import hashlib ImportError: No module named hashlib Does this have anything to do with the problem? Annet.
[web2py] Re: gae memcace clear?
I made a workaround to reset cache (per session for now). I have array, where I mark keys to be reset, and afer reset they can be removed or marked as done. def caching_time_get(key, caching_time=60*60*24): function to handle caching resets when the reset is on, it returns 0 once -- so the cache should expire and then it goes on standart expiries if key in session.cache_invalidate and session.cache_invalidate[key]: return 0 else: return caching_time then I do: @cache( the_key, time_expire=caching_time_get( the_key ), cache_model=cache.ram ) def some_controller(): return sth_time_greedy() and if I need to refresh cached stuff, I do: session.cache_invalidate[the_key]=True On 22 sept., 13:18, Jurgis Pralgauskis jurgis.pralgaus...@gmail.com wrote: but as I understand GAE supports only memcache, and no cache.ram or cache.diskhttp://www.web2py.com/book/default/chapter/11#Avoid-the-Filesystem Memcache on GAE cache.ram and cache.disk should not be used, so we make them point to cache.memcache. ps.: there are two Memcache anchors in this page (general Memcache and GAE Memcache) so I direct by other GAE subtopic ;) On 20 Rugs, 16:36, Scott blueseas...@gmail.com wrote: If you are interested in caching view or controller output, please check the examples section:http://web2py.com/examples/default/examples#cache_examples Notice the timers which indicate how long before the view or controller output is re-rendered. You can also check out appadmin.py included within your application; it shows you how to clear cached output, e.g.: if clear_ram: cache.ram.clear() session.flash += Ram Cleared if clear_disk: cache.disk.clear() session.flash += Disk Cleared On Sep 18, 6:45 pm,JurgisPralgauskis jurgis.pralgaus...@gmail.com wrote: would it be sound to use some cache_db instead of memcache in GAE then? For example if I render a CPU requiring view I want to cache, but I could clear it anytime I like. hm, or could there be a recipy to abandon current memcached object. this would need extra hash table: as if now probably is sth like stuff_key ---cached--- stuff_value would become stuff_key ---extra_hash--- stuff_key_timestamp ---cached--- stuff_value and on clear just delete the stuff_key from extra_hash On 2 Rugs, 00:25, mdipierro mdipie...@cs.depaul.edu wrote: no. sorry On Sep 1, 3:49 pm,JurgisPralgauskis jurgis.pralgaus...@gmail.com wrote: Hello, inhttp://www.web2py.com/book/default/chapter/04booksays The time_expire can be set to 0 to force a cache refresh and to None to prevent the content from ever expiring. You can clear one or more cache variables with cache.ram.clear(regex='...') does this apply to gaememcache? ifmemcachedecorates some controller, and I know its key, how can I force recache its new result?- Slëpti cituojamà tekstà - - Rodyti cituojamà tekstà -
[web2py] Re: running web2py on Android?
i tried to run w2p on android with ASE (android scripting env). It's been a while since I tried this but i can remember that there was a problem with threads or something like this. w2p seems to use python packages that are not avaible on android, didnt remember exactly which one.
[web2py] Re: Vote for a new logo
Great work bruno. The comments are working!. Yes I think we have to show comment counter and make the vote as a rating system. On 15 oct, 03:30, Bruno Rocha rochacbr...@gmail.com wrote: I added your comment and some more important info tohttp://www.blouweb.com/logovote/default/upload 2010/10/15 mdipierro mdipie...@cs.depaul.edu I will add some comments here. 1) It is important to avoid brand confusion with web.py (the two has to be visible) 2) It is not a good idea to have a logo that looks like it is falling apart 3) As much as I may like snakes, I am not convinced reptiles convey a professional image. Even if a logo may not be appropriate for the official site... many of these logos are really good and should be put to use. We have web2py- utils, web2pyslices, etc. and we will have more sites to come. We can keep a common page layout and use different logos. Massimo On Oct 15, 1:03 am, Bruno Rocha rochacbr...@gmail.com wrote: Comments are working now, lets test and comment on some logos! http://www.blouweb.com/logovote 2010/10/15 mdipierro mdipie...@cs.depaul.edu I agree. The one Martin made is good but ... 1) should made to run on GAE 2) should use RPX for login 3) should provide multiple lists of logos for multiple companies 4) should sort logos and vote with rating [*] (plugin rating?) 5) allow visitor to comment on logos {{=plugin_wiki.widget('comment','logo',id)}} -- http://rochacbruno.com.br
[web2py] Re: Packaging web2py for Debian
You have the idea. Thanks for clearing it towards the others. My guesses it we need to do both. Because Jose goal is general purpose and mine aswell, but comes with overkill in the most cases. In Jose case I would suggest a slight change. web2py-core web2py-gluon This has been discusses before, I recall you where in those discussions Jose. http://groups.google.com/group/web2py/browse_frm/thread/45ea4327d713bdd8/f4a9c8160432cfbb?hl=enlnk=gstq=debian#f4a9c8160432cfbb http://groups.google.com/group/web2py/browse_frm/thread/51b731d9abb5270d/550ed09fbf7af9f2?hl=enlnk=gstq=debian#550ed09fbf7af9f2 There are some other topics, search for turnkeylinux, where this is mentioned. I recall Dimo Barsky was busy with packaging Gluon, but I've been out for a while. I don't know him, but he might help with this. It was chaos post again, but I hope this one helps:p. Mark, On 14 okt, 23:51, Christopher Steel chris.st...@gmail.com wrote: If your break things down into one or more “debian” packages and at least one web2py application you could end up with a phenomenally powerful and easy to maintain setup that could have resounding repercussions, so to speak, for all parties. How does the following example sound? Package 1, web2py sudo apt-get install web2py unpacks a stable version of web2py to the users home directory if one does not exist. /home/mary/web2py/web2py Adds scripts for starting, stopping and restarting web2py using the web2py *built in* web server. An option to install to a directory other than the “default” can be made available as well. Advantages - Always works - Does not break anything, ever - Easy to customize - Highly portable - Can start developing right away - Easy to implement - easy to clean up via apt-get purge and so on. - easy to backup, delete, upgrade etc. Disadvantages - Might be hard to justify doing a dissertation on this, but using Package X the sky is the limit ;) Package X example, web2py universal installer sudo apt-get install universal-web2py If the web2py package is not installed it gets installed, if mercurial is not already installed it gets installed. If a clone of the web2py application called “universal installer” does not exist, it is created in ${HOME}/web2py/web2py/applications. if web2py is not running it starts it and opens default browser to the universal application. The universal application can do almost anything you like then and you would easily create additional packages and so forth in this way. People who want a “server installer” can create a “server installer” web2py application and /or debian package that could be made available via your universal installer. Sounds cool! Cheers, Christopher Steel Voice of Access On Oct 14, 3:36 pm, Mark Breedveld m.breedv...@solcon.nl wrote: Well that makes a hope clear. I learned a lot from your explanation. You did rule out almost the obstacles. And the last one should solve able. Changing some process within web2py. I need this for my project. So if you need anything, please let me know. Direct mail will grantee answer... and all try to follow this topic. Mark, On 14 okt, 20:03, José L. jredr...@gmail.com wrote: On 14 oct, 17:24, Mark Breedveld m.breedv...@solcon.nl wrote: I've not so much time. But we have done this discussion before. There where three problems with packaging web2py. - Really frequent release period (not impossible for someone with a lot time) I've already answer this before: Debian sid for frequent uploads, debian stable for stable servers (with security patches). The frequency the package is updated will depend on how much web2py changes between releases. With a good packaging it may take five minutes recompiling the package. Also, if the packaging is done via a group of people working together in alioth.debian.org it may be updated very often. - Difficult to implement according the packaging guidelines That's where I think I can help, with the help of others who know better the internals of web2py to solve the problems that may arise. - Difficult to implement with user separation It's related to the above problem, but I think it can be done. - (Too) many configuration possible From my point of view the package only should provide one possible configuration, the less intrusive (in terms of changing user configurations): use the rocket server and sqlite. It may also provide Readme or example files to configure apache, or other servers, but that's something not needed to begin to work with web2py. Configuring a server is done to put a server in production, and that's something that, in my opinion, should always be done manually, not automatically by installing a package. If we solve the above and find someone with enough time. Yes, that would be perfect and I would support that. The
[web2py] Re: Anyone used WHOOSH as search engine with web2py?
you wold have to concatinate all fields you want to be indexed for a record or define multiple fields in the woosh index setup but it should be possible On Oct 15, 3:21 am, mdipierro mdipie...@cs.depaul.edu wrote: I do not think it is possible because it is file based. On Oct 14, 8:19 pm, Richard richar...@gmail.com wrote: is it practical to use this on GAE? On Oct 13, 11:34 pm, selecta gr...@delarue-berlin.de wrote: it's fast, it's pure python (just dump in to web2py/site-packages) and simple to use http://tlc2.hg.sourceforge.net/hgweb/tlc2/tlc2/file/4387b942c7ab/cont.. :) On Oct 12, 8:38 pm, David Marko dma...@tiscali.cz wrote: Is there anyone who has used the whoosh (http://bitbucket.org/mchaput/ whoosh/wiki/Home) for full text search? If so, can you share your experience? David
[web2py] Re: Vote for a new logo
It came to my mind, with a little modification, we can have our uservoice and stackoverflow. And if you want to contribute to another project logo put in description: web2pyslice, etc. this is easy to implement. On Oct 15, 7:32 am, Martin.Mulone mulone.mar...@gmail.com wrote: Great work bruno. The comments are working!. Yes I think we have to show comment counter and make the vote as a rating system. On 15 oct, 03:30, Bruno Rocha rochacbr...@gmail.com wrote: I added your comment and some more important info tohttp://www.blouweb.com/logovote/default/upload 2010/10/15 mdipierro mdipie...@cs.depaul.edu I will add some comments here. 1) It is important to avoid brand confusion with web.py (the two has to be visible) 2) It is not a good idea to have a logo that looks like it is falling apart 3) As much as I may like snakes, I am not convinced reptiles convey a professional image. Even if a logo may not be appropriate for the official site... many of these logos are really good and should be put to use. We have web2py- utils, web2pyslices, etc. and we will have more sites to come. We can keep a common page layout and use different logos. Massimo On Oct 15, 1:03 am, Bruno Rocha rochacbr...@gmail.com wrote: Comments are working now, lets test and comment on some logos! http://www.blouweb.com/logovote 2010/10/15 mdipierro mdipie...@cs.depaul.edu I agree. The one Martin made is good but ... 1) should made to run on GAE 2) should use RPX for login 3) should provide multiple lists of logos for multiple companies 4) should sort logos and vote with rating [*] (plugin rating?) 5) allow visitor to comment on logos {{=plugin_wiki.widget('comment','logo',id)}} -- http://rochacbruno.com.br
[web2py] Re: cron @reboot not working on 1.87.3
In trunk now. On Oct 15, 4:31 am, Álvaro J. Iradier airad...@gmail.com wrote: Suggested patch: *** newcron.old.py Fri Oct 15 11:27:34 2010 --- newcron.py Fri Oct 15 11:29:08 2010 *** *** 175,181 task[id] = [] vals = s.split(',') for val in vals: ! if '-' in val and '/' not in val: val = '%s/1' % val if '/' in val: task[id] += rangetolist(val, id) --- 175,181 task[id] = [] vals = s.split(',') for val in vals: ! if val != '-1' and '-' in val and '/' not in val: val = '%s/1' % val if '/' in val: task[id] += rangetolist(val, id) Please confirm if you're going to apply it. Greets. On 14 oct, 22:43, Álvaro J. Iradier airad...@gmail.com wrote: Ok I found the problem, in rev 770b1f1298: http://code.google.com/p/web2py/source/diff?spec=svn770b1f129819eb108... in newcron.py: if val.find('/') -1: was changed to: if '-' in val and '/' not in val: val = '%s/1' % val if '/' in val: and it looks like there's something wrong with val = '-1/1', coming from the previous: 153 if line.startswith('@reboot'): 154 line=line.replace('@reboot', '-1 * * * *') However, I can't guess what the fix is... Greets. On 14 oct, 22:34, Álvaro J. Iradier airad...@gmail.com wrote: Thanks very much. Ok, so after trying: Works in 1.83.2. Doesn't work in 1.84.1 or newer. I don't see anything on the changelog for 1.84.1-4 related to cron, but clearly something was changed that stopped it from working. Greets. On 14 oct, 22:00, Bruno Rocha rochacbr...@gmail.com wrote: http://www.web2py.com/examples/static/version/web2py_src.zip http://www.web2py.com/examples/static/1.81.4/web2py_src.zip 2010/10/14 Álvaro J. Iradier airad...@gmail.com After upgrading web2py from 1.81.4 to latest 1.87.3, cron jobs at @reboot stopped working. This is my crontab file: #crontab * * * * * root *cron/pollsensors * * * * * root *cron/checkschedule 0 0 * * * root *cron/cleandata @reboot root *cron/cleandata @reboot root *cron/pollingloop The two last jobs simply won't start. Reverting to 1.81.4 works. Any idea? How can I download previous versions to track where it stopped working? Thanks very much. -- http://rochacbruno.com.br
[web2py] Re: Vote for a new logo
Hi Bruno - comments are nice. I don't like the randomizing effect. Very disorienting when you push into come out of comments as you end up in a different place.
[web2py] link in mail request_reset_password
While testing my cms application I found that the link in the mail send by the request_reset_password function isn't clickable, the user has to copy and paste the link into the browser. Am I the only one experiencing this? Is there a way to solve this problem? Regards, Annet
Re: [web2py] Re: labels in crud.select
Hello, It's not working... I am really confuse... I try with 1.83.2 and 1.87.3. I try with fields=['myfield1','myfield2'] and without it always with field_labels and also with and without headers='fieldname:capitalize'... Is it a issue? Richard On Thu, Oct 14, 2010 at 8:16 PM, Alex yue.a...@gmail.com wrote: Are you trying to display a more user friendly column name rather than the DB column name? If so, you can do this already. The crud.select() has a method called field_labels, which takes a dictionary of field names to their labels. http://www.web2py.com/book/default/chapter/07#Methods crud.select(db.person, field_labels={'dbColName':'MyLabel'}) On Oct 14, 3:00 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Does it plan to have the possibility to specify the labels of fields in a crud.select?? Richard
[web2py] Is user in [app]/[controller.py]/user hard-coded into Web2py?
Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] TypeError: 'function' object is unsubscriptable
In a view I have the following lines of code. {{if 'promobox' in globals():}} div class=sidebox {{if promobox[0].kop:}} h3{{=promobox[0].kop}}/h3 {{pass}} {{=XML(promobox[0].tekst)}} /div !-- sidebox -- {{pass}} when I expose a function that does not return a promobox I get the following error: Traceback (most recent call last): File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/ restricted.py, line 188, in restricted exec ccode in environment File /Library/Python/2.5/site-packages/web2py_1.87.3/applications/ cms/views/card/index.html, line 125, in module TypeError: 'function' object is unsubscriptable where line 125 reads like: if promobos[0].kop I don't understand why I get this error, the code between {{if 'promobox' in globals():}} and the last {{pass}} shouldn't be executed, should it? Regards, Annet
[web2py] Re: Vote for a new logo
If we're making an app for more general use, we might consider making the voting method configurable (e.g., single vote, multiple vote, rating, etc.). Note, using ratings (i.e., range voting) can be tricky. If the winner is to be the option with the highest average, then it's important to make sure everyone provides a rating for every option. Otherwise, an option that gets a single rating of 5 (and no other ratings) will beat an option that gets 99 5's and one 4. Alternatively, you could automatically assign the lowest rating value (e.g., 1) to any un-rated options, but voters would have to be made aware that that is the consequence of failing to rate an option. With range voting, you also have to consider the possibility of skewed or bi-modal distributions. For example, suppose Logo A gets 80 5's and 20 1's (mean = 4.2) and Logo B gets 10 5's and 90 4's (mean = 4.1). Logo A has the higher mean, but a substantial minority absolutely hate it, whereas almost everyone really likes Logo B so would probably be a better choice. These effects can be mitigated by using a trimmed mean or median as the selection criterion. Alternatively, the ratings can be treated as (tied) ranks, and a rank-based method (that allows for tied ranks) can be used. Actually, a good idea is once the ratings are collected, try several different scoring methods and see if they yield a consistent winner -- if not, you have to decide which criteria are most important (e.g., do you prefer having a logo that many people love but some people hate, or a logo that everyone likes but doesn't necessarily love). Anthony On Oct 15, 1:00 am, mdipierro mdipie...@cs.depaul.edu wrote: I agree. The one Martin made is good but ... 1) should made to run on GAE 2) should use RPX for login 3) should provide multiple lists of logos for multiple companies 4) should sort logos and vote with rating [*] (plugin rating?) 5) allow visitor to comment on logos {{=plugin_wiki.widget('comment','logo',id)}} It may actually make money! On Oct 14, 11:20 pm, weheh richard_gor...@verizon.net wrote: Adrian seems to fail to appreciate how many companies, at any given moment, are voting on logos. I'm a startup guy and have run into this many times in my career. Every new company goes through it. I googled logo voting system and turned up bupkis. There's a need and an opportunity. It would make a sweet web2py showcase app. And every new web2py startup will benefit from having it, no? On Oct 14, 10:56 pm, Jonathan Lundell jlund...@pobox.com wrote: On Oct 14, 2010, at 7:26 PM, Adrian Klaver wrote: For goodness sake, give it a rest. The bandwith devoted to this issue is way out of proportion to its importance. This calls for a Benevolent Dictator. Let Massimo choose a logo and then lets move on. Geekus in uno, geekus in omnibus. We can't help ourselves.- Hide quoted text - - Show quoted text -
[web2py] Re: Vote for a new logo
why is the deadline so early? i really want to post some logos, but it was not possible to really think about some designs and finally create some..
Re: [web2py] Re: Vote for a new logo
On Oct 14, 2010, at 11:03 PM, Bruno Rocha wrote: Comments are working now, lets test and comment on some logos! http://www.blouweb.com/logovote Thanks. A request: could we have a textarea for comment entry, please?
[web2py] Re: Vote for a new logo
Something's wrong in IE -- all the logos are vertically aligned at the top of the header instead of the middle. This only happened in the last couple hours I think. Looks OK in Chrome. On Oct 13, 5:17 pm, Bruno Rocha rochacbr...@gmail.com wrote: Martin Mulone made the logovote application. I am hosting at my server You can post logo ideas, and vote for you prefered logo. Better if you made an transparent canvas .gif or .png maximum 250x70 Maximum of 10 uploads per user, Just one vote per user. Take a look:http://blouweb.com/logovote/
[web2py] Re: Vote for a new logo
Have we considered using 99designs.com? Logo design is one of their specialities. No offence intended (to anyone, at all!)
Re: [web2py] Re: Offline apps
Thanks Darcy for the info, I'll check out couchdb, it seems very interesting :) 2010/10/15 Darcy Clark da...@qualitysystems.com I've been experimenting with Couchdb as a database back-end to web2py - having some success. Basically Couchdb is engineered to handle offline-online transitioning and synchronization (I haven't got to that part yet, but I have got basic REST operations (create, destroy, update etc...) of records happening). CRUD doesn't work obviously, but SQLFORM.factory works nicely. I'm using the Python library Couchdbkit as an interface to handle mapping between JSON and Python objects. On Oct 8, 11:35 pm, Fabio Alessandro Locati floc...@grimp.eu wrote: Hi, I have a web app (actually running on GAE) but I would need it even in a offline state. I was thinking about installing web2py on the pc and putting the web2py app on it. This creates the problem of the database sync. Anyonee found this problem? nyone solved it? Thanks, Fabio
[web2py] Re: Packaging web2py for Debian
On 14 oct, 23:51, Christopher Steel chris.st...@gmail.com wrote: If your break things down into one or more “debian” packages and at least one web2py application you could end up with a phenomenally powerful and easy to maintain setup that could have resounding repercussions, so to speak, for all parties. How does the following example sound? Package 1, web2py In Debian it should be python-web2py sudo apt-get install web2py unpacks a stable version of web2py to the users home directory if one does not exist. /home/mary/web2py/web2py I'm thinking of a script doing (similar to what python-django package does): cd /home/me/whatever/ web2py-admin startproject newprojectname would create /home/me/whatever/web2py .. .../applications/newprojectname .../applications/admin (linking to /usr/share/ web2py/applications/admin) ../any needed stuff at web2py that needs to be modified by the user and can not be in the PYTHONPATH or /usr/share/ web2py Adds scripts for starting, stopping and restarting web2py using the web2py *built in* web server. An option to install to a directory other than the “default” can be made available as well. it could be just: cd /home/me/web2py python web2py i.e. exactly as it is now. I'm not sure if this process might be simplified more. One evident simplification is adding a desktop menu entry calling web2py and doing: cd $HOME if not exists, creates web2py/applications directory, and links admin directory from /usr/share/web2py/applications/admin launch web2py script launc x-www-browser http://localhost:8900 So, the user can begin to work in the web browser without needing to open a terminal window, whenever he wants to use web2py in its own $HOME directory. A pending question is how to deal with the needed writing permisions in applications/admin/errors and application/admin/sessions directories. If the directory admin is linked from /usr/share/web2py/ applications/admin, the current user doesn't have permissions there, and should not have them if the computer is used by different users. A way to allow each user have its own sessions and errors directories for the admin application is needed. Advantages - Always works - Does not break anything, ever - Easy to customize - Highly portable - Can start developing right away - Easy to implement - easy to clean up via apt-get purge and so on. - easy to backup, delete, upgrade etc. Fully agree, just upgrading the package the user benefits from the new web2py code, including the admin or welcome applications, without touching a line of his own applications. Disadvantages - Might be hard to justify doing a dissertation on this, but using Package X the sky is the limit ;) Package X example, web2py universal installer sudo apt-get install universal-web2py If the web2py package is not installed it gets installed, if mercurial is not already installed it gets installed. easy to do adding dependencies on python-web2py and mercurial to the universal-web2py package If a clone of the web2py application called “universal installer” does not exist, it is created in ${HOME}/web2py/web2py/applications. if web2py is not running it starts it and opens default browser to the universal application. mmm, I don't think that should happens without the user intervention. Don't forget linux is multiuser (and in some schools is used with the LTSP project, so it's multiuser concurrently). I think that should be done after the user asks for it, clicking on a desktop or menu icon. The universal application can do almost anything you like then and you would easily create additional packages and so forth in this way. People who want a “server installer” can create a “server installer” web2py application and /or debian package that could be made available via your universal installer. my initial idea is providing in /usr/share/doc/python-web2py the scripts to run web2py at the computer booting and the configuration files for apache2, httpd-light, index.yaml, etc. with all the needed documentation to do it manually. Your idea may be useful to be done with apache, with a apache2-web2py package, but I don't see how to do it universally for any web server. Sounds cool! More than cool. It sounds as a need for many people! Regards. José L.
[web2py] Re: Packaging web2py for Debian
On 15 oct, 11:33, Jurgis Pralgauskis jurgis.pralgaus...@gmail.com wrote: Maybe You could usehttps://help.launchpad.net/Packaging/SourceBuilds/ if you'd create stable branch on bazar and add packaging recipy likehttps://code.edge.launchpad.net/~mdipierro/web2py/devel/+new-recipe fromhttps://code.edge.launchpad.net/~mdipierro/web2py/devel (notice code.EDGE.launch...) I prefer to work on the mother distribution, so I've already asked for a project in alioth.debian.org.
[web2py] Re: Packaging web2py for Debian
On 15 oct, 13:32, Mark Breedveld m.breedv...@solcon.nl wrote: You have the idea. Thanks for clearing it towards the others. My guesses it we need to do both. Because Jose goal is general purpose and mine aswell, but comes with overkill in the most cases. In Jose case I would suggest a slight change. web2py-core web2py-gluon This has been discusses before, I recall you where in those discussions Jose.http://groups.google.com/group/web2py/browse_frm/thread/45ea4327d713b... http://groups.google.com/group/web2py/browse_frm/thread/51b731d9abb52... There are some other topics, search for turnkeylinux, where this is mentioned. I recall Dimo Barsky was busy with packaging Gluon, but I've been out for a while. I don't know him, but he might help with this. It was chaos post again, but I hope this one helps:p. Mark, Thanks, but after looking for more info in the links you provided, I have not been able to find the rationale for a separate gluon and core packages. can anybody enlight me?
[web2py] Re: Vote for a new logo
Hmmm, looks OK in IE again -- not sure what happened. On Oct 15, 11:34 am, Anthony av201...@yahoo.com wrote: Something's wrong in IE -- all the logos are vertically aligned at the top of the header instead of the middle. This only happened in the last couple hours I think. Looks OK in Chrome. On Oct 13, 5:17 pm, Bruno Rocha rochacbr...@gmail.com wrote: Martin Mulone made the logovote application. I am hosting at my server You can post logo ideas, and vote for you prefered logo. Better if you made an transparent canvas .gif or .png maximum 250x70 Maximum of 10 uploads per user, Just one vote per user. Take a look:http://blouweb.com/logovote/- Hide quoted text - - Show quoted text -
[web2py] buckingham for dimensional analysis/unit conversion/error propagation
http://code.google.com/p/buckingham/
[web2py] dealing with extra clicks on a link
Hello, First, I would appreciate if anyone can help with this issue I'm facing. Second, I am new to web2py, and not a programmer by profession. I have written an application for conducting tournaments with the ultimatum game - a simple bargaining game. The problem: it seems to work fine running on my personal machine via localhost, but when hosted (WebFaction) the application locks up if a particular link is clicked more than once. The details... one player must wait for information from another player. I'm using a database poll as a means for the waiting player to know when information is available. While the polling takes place, the player's view is still presenting an active link. Clicking this link more than once causes a problem. As I mentioned above, the server-side pattern I've implemented works when running locally, but seems to fail in a hosted situation. Oh, since I'm less familiar with javascript than Python I was trying for a server-side solution. I have started reading about jQuery but have not yet been able to get .one() working to prevent extra clicks. Thank you in advance! The relevant code... The view and controller function from which the player clicks to begin the database poll... def responder_enter_game(): The point at which the responder enters the game. The view will hang on this page as the database polling is processed in the next page called from the view. Prior to calling this function, session.first_time must be set to True! return dict() Note: I using the default layout.html {{extend 'layout.html'}} h3You are playing as a responder in this game.../h3 ul li{{=A(B(T(Click to enter game)), _href=URL('responder_waits'))}} /li li{{=T('Please be patient...')}}/li li{{=T('You will leave this page after a proposal has been offered.')}}/li /ul {{extend 'layout.html'}} h3Waiting for a response... please be patient/h3 {{redirect(URL('game_results_proposer'))}} Here is the controller code for responder_waits... def check_proposal_confirmed(): The resopnder's view is hanging on respnder_enters_game() until proposal_confirmed is True. The function time.sleep(0.5) causes a 0.5 second delay between polls on the database. proposal_confirmed = False while not proposal_confirmed: proposal_confirmed = db.games[session.game_id].proposal_confirmed time.sleep(0.5) def responder_waits(): The responder is waiting for a proposal confirmation to be found in the database if session.first_time: ## The first time the player clicks the link processing continues session.first_time = False ## The first time has passed check_proposal_confirmed() ## This function holds until the proposer confirms a proposal else: ## Any additional time the player clicks the link no action is taken pass return dict()
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
Re: [web2py] Re: Vote for a new logo
2010/10/15 dustin.b dustin.bens...@googlemail.com why is the deadline so early? i really want to post some logos, but it was not possible to really think about some designs and finally create some.. I do not know, I just picked a date that was not too long. Massimo should decide a better date for this deadline, but we need a deadline. To be honest, I have chosen 19th because I wanted to put the new logo in my presentation for PyconBrazil that starts 20th -- http://rochacbruno.com.br
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Sending 204 response page
I want to know how I can send 204 response to user? With PHP it is simple as following: header(HTTP/1.0 204 No Content); Thanks
Re: [web2py] Sending 204 response page
http://www.web2py.com/book/default/chapter/04#HTTP-and-redirect 2010/10/15 Amit Ambardekar amit...@gmail.com: I want to know how I can send 204 response to user? With PHP it is simple as following: header(HTTP/1.0 204 No Content); Thanks
[web2py] Re: dealing with extra clicks on a link
Hello, I was going to do something similar with some 2 players games (which I have yet to implement), but was planning on doing the polling on the client-side with Javascript and AJAX. There is a function in Javascript: window.setTimeout(jsFunctionToRun, timeToRunInMilliseconds); That can be called to force the page to call the passed in JS function after timeToRunInMilliseconds. What I am planning on doing is having my JSFunctionToRun be a function that makes an AJAX call (which will call something to check the database) and gets the state of the game. Then based on the state I get back, I'll do what I need on the callback. The framework would look something like: setTimeout(CheckState(), 5000) //Call JS Function CheckState() @ 5 seconds function CheckState() { //Make AJAX call to function that will check and get the state value from the DB //Callback function: ProcessState() } function ProcessState() { //IF the db state says it's my turn, do code to make it my turn, call setTimeoutAgain after I take my turn to get back in the polling status //ELSE call setTimeout(CheckState, 5000) to check if it's my turn again in 5 seconds } I hope something like this helps :) On Oct 15, 12:01 pm, meland eland.m...@gmail.com wrote: Hello, First, I would appreciate if anyone can help with this issue I'm facing. Second, I am new to web2py, and not a programmer by profession. I have written an application for conducting tournaments with the ultimatum game - a simple bargaining game. The problem: it seems to work fine running on my personal machine via localhost, but when hosted (WebFaction) the application locks up if a particular link is clicked more than once. The details... one player must wait for information from another player. I'm using a database poll as a means for the waiting player to know when information is available. While the polling takes place, the player's view is still presenting an active link. Clicking this link more than once causes a problem. As I mentioned above, the server-side pattern I've implemented works when running locally, but seems to fail in a hosted situation. Oh, since I'm less familiar with javascript than Python I was trying for a server-side solution. I have started reading about jQuery but have not yet been able to get .one() working to prevent extra clicks. Thank you in advance! The relevant code... The view and controller function from which the player clicks to begin the database poll... def responder_enter_game(): The point at which the responder enters the game. The view will hang on this page as the database polling is processed in the next page called from the view. Prior to calling this function, session.first_time must be set to True! return dict() Note: I using the default layout.html {{extend 'layout.html'}} h3You are playing as a responder in this game.../h3 ul li{{=A(B(T(Click to enter game)), _href=URL('responder_waits'))}} /li li{{=T('Please be patient...')}}/li li{{=T('You will leave this page after a proposal has been offered.')}}/li /ul {{extend 'layout.html'}} h3Waiting for a response... please be patient/h3 {{redirect(URL('game_results_proposer'))}} Here is the controller code for responder_waits... def check_proposal_confirmed(): The resopnder's view is hanging on respnder_enters_game() until proposal_confirmed is True. The function time.sleep(0.5) causes a 0.5 second delay between polls on the database. proposal_confirmed = False while not proposal_confirmed: proposal_confirmed = db.games[session.game_id].proposal_confirmed time.sleep(0.5) def responder_waits(): The responder is waiting for a proposal confirmation to be found in the database if session.first_time: ## The first time the player clicks the link processing continues session.first_time = False ## The first time has passed check_proposal_confirmed() ## This function holds until the proposer confirms a proposal else: ## Any additional time the player clicks the link no action is taken pass return dict()
[web2py] Re: labels in crud.select
Maybe it's the syntax? headers={'person.name': 'Name', 'table.colName': 'MyNewName'} Not: headers='fieldName:capitalize' On Oct 15, 8:00 am, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, It's not working... I am really confuse... I try with 1.83.2 and 1.87.3. I try with fields=['myfield1','myfield2'] and without it always with field_labels and also with and without headers='fieldname:capitalize'... Is it a issue? Richard On Thu, Oct 14, 2010 at 8:16 PM, Alex yue.a...@gmail.com wrote: Are you trying to display a more user friendly column name rather than the DB column name? If so, you can do this already. The crud.select() has a method called field_labels, which takes a dictionary of field names to their labels. http://www.web2py.com/book/default/chapter/07#Methods crud.select(db.person, field_labels={'dbColName':'MyLabel'}) On Oct 14, 3:00 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Does it plan to have the possibility to specify the labels of fields in a crud.select?? Richard- Hide quoted text - - Show quoted text -
[web2py] Re: Vote for a new logo
Since Denis L I have the same core logo design, we need a time stamp to resolve order of submission. On Oct 15, 1:46 pm, Bruno Rocha rochacbr...@gmail.com wrote: 2010/10/15 dustin.b dustin.bens...@googlemail.com why is the deadline so early? i really want to post some logos, but it was not possible to really think about some designs and finally create some.. I do not know, I just picked a date that was not too long. Massimo should decide a better date for this deadline, but we need a deadline. To be honest, I have chosen 19th because I wanted to put the new logo in my presentation for PyconBrazil that starts 20th -- http://rochacbruno.com.br
[web2py] Re: Vote for a new logo
Bruno Rocha - could you modify display page to be more gallery style rather than inline? I don't think we need to see the banner buttons for every logo. Thx for the good work. On Oct 15, 1:46 pm, Bruno Rocha rochacbr...@gmail.com wrote: 2010/10/15 dustin.b dustin.bens...@googlemail.com why is the deadline so early? i really want to post some logos, but it was not possible to really think about some designs and finally create some.. I do not know, I just picked a date that was not too long. Massimo should decide a better date for this deadline, but we need a deadline. To be honest, I have chosen 19th because I wanted to put the new logo in my presentation for PyconBrazil that starts 20th -- http://rochacbruno.com.br
[web2py] Re: Web2py like clone in Java?
You can see the alternatives to agile frameworks in Java: Grails; Spring Roo; Scooter Framework; Play Framework; Next Framework. But none compares to Python Web Frameworks or Rails in respect to simplicity, amount of features and the maturity in the field of agile frameworks. And I think beyond any web2py makes it possible to develop fully by your browser. Not that this is fundamental, but shows the level of productivity that can have. On Oct 14, 8:38 pm, DJ sebastianjaya...@gmail.com wrote: Hello web2py people, I was in a discussion recently telling my friend how great Web2Py was for programmer productivity with all the inbuilt features (server, CRUD, auth). We were wondering if there was anything similar in Java? Quick google search brought me to Tapestry and Wicket. Can any of you comment on any frameworks in java you have worked with that resemble Web2py? Thank you for your comments. -Sebastian
Re: [web2py] Re: Web2py like clone in Java?
Lately I have been forced to use wicket (wicket.apache.org). Wicket is by no means agile compared to web2py. Wicket is not a full stack framework it needs a lot of other things to serve pages. As with any java coding wicket takes ages and pages to do things that python does in one line. Against there is the java language which is not functional and you need to carry around full objects (in wicket called models) to pass messages between components, which can be long to write. But the thing I would take from wicket is a strong component/event oriented approach with well defined interfaces, and a lot of predefined widgets. The same componet/event architecture can be implemented in web2py using pyjamas, and it is quite easy and much more flexible, but it would be nice to have it included by default or as a plugin! 2010/10/15 David Marko dma...@tiscali.cz: My favourite for clean java is http://www.playframework.org/ Better experience than with Grails. David On 15 říj, 02:21, Bruno Rocha rochacbr...@gmail.com wrote: Grails uses a template language g:each in=${books} You can't write Java or Groove in views as we can do with web2py writing pure Python direclty in views. It is one of the best/important feature in web2py, lot of people love web2py because of the template system. 2010/10/14 Jonathan Lundell jlund...@pobox.com On Oct 14, 2010, at 4:38 PM, DJ wrote: I was in a discussion recently telling my friend how great Web2Py was for programmer productivity with all the inbuilt features (server, CRUD, auth). We were wondering if there was anything similar in Java? Quick google search brought me to Tapestry and Wicket. Can any of you comment on any frameworks in java you have worked with that resemble Web2py? Thank you for your comments. One possibility is Groovy, essentially a dynamic version of Java, and the Grails framework. http://en.wikipedia.org/wiki/Groovy_(programming_language)http://en.wikipedia.org/wiki/Groovy_%28programming_language%29 http://en.wikipedia.org/wiki/Grails_(framework)http://en.wikipedia.org/wiki/Grails_%28framework%29 *Java is the new COBOL* -- http://rochacbruno.com.br
Re: [web2py] Re: Vote for a new logo
2010/10/15 weheh richard_gor...@verizon.net Bruno Rocha - could you modify display page to be more gallery style rather than inline? I don't think we need to see the banner buttons for every logo. Thx for the good work. DONE: http://www.blouweb.com/logovote/default/index
[web2py] Re: web2py 1.87.3 is OUT
I upgraded to version 1.87.3, the problem I am facing is that I cannot upload and install packed applications via the admin web interface. The flash message: unable to install application init. I had the same problem when setting up an Ubuntu 10.04 AMI with web2py 1.87.3 on EC2 yesterday using the setup-web2py-ubuntu.sh install script as described in the book. Fortunately the first solution that I tried solved it for me, which was from the WebFaction Forum at http://forum.webfaction.com/viewtopic.php?pid=18401 mkdir web2py/deposit touch web2py/applications/__init__.py Simon
Re: [web2py] Re: Vote for a new logo
@Bruno excellent work! 2010/10/15 Bruno Rocha rochacbr...@gmail.com: 2010/10/15 weheh richard_gor...@verizon.net Bruno Rocha - could you modify display page to be more gallery style rather than inline? I don't think we need to see the banner buttons for every logo. Thx for the good work. DONE: http://www.blouweb.com/logovote/default/index
[web2py] Can jqgrid be resized?
Hello, I am wondering if a jqgrid table can be resized? Currently I have the following code: displayrows=plugin_wiki.widget('jqgrid',db.entry,'','','','divtest','', 250,500) And no matter which numbers I enter for the last two parameters (width and height according to http://web2py.com/book/default/chapter/13?search=jqgrid), there seems to be no visual effect when I view my jqgrid in my app. Am I doing something wrong, or is there a way other than changing parameters to further edit a jqgrid's look and size? Thank you. -Percy
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
Re: [web2py] Can jqgrid be resized?
In a view you can do this : {{=plugin_wiki.widget('jqgrid',tablename,width=900,height=400)}} Richard On Fri, Oct 15, 2010 at 5:01 PM, Percy desp...@gmail.com wrote: Hello, I am wondering if a jqgrid table can be resized? Currently I have the following code: displayrows=plugin_wiki.widget('jqgrid',db.entry,'','','','divtest','', 250,500) And no matter which numbers I enter for the last two parameters (width and height according to http://web2py.com/book/default/chapter/13?search=jqgrid), there seems to be no visual effect when I view my jqgrid in my app. Am I doing something wrong, or is there a way other than changing parameters to further edit a jqgrid's look and size? Thank you. -Percy
Re: [web2py] Re: labels in crud.select
I try in many ways with no success... I read somewhere that headers='fieldName:capitalize' was the only parameter for headers accepted... What I did : selected=crud.select(table,field_labels={'field1':'abc'},headers='fieldname:capitalize') selected=crud.select(table,field_labels={'field1':'abc'}) selected=crud.select(table,fields=['field1'],field_labels={'field1':'abc'},headers='fieldname:capitalize') selected=crud.select(table,field_labels={'result':'Edit'},headers='fieldname:capitalize') selected=crud.select(table,fields=['field1'],field_labels={'field1':'abc'},headers='fieldname:capitalize') selected=crud.select(table,fields=['field1'],field_labels={'field1':'abc'}) selected=crud.select(table,fields=['field1'],labels={'field1':'abc'}) Nothing! Thanks anyway. Richard On Fri, Oct 15, 2010 at 3:23 PM, Alex yue.a...@gmail.com wrote: Maybe it's the syntax? headers={'person.name': 'Name', 'table.colName': 'MyNewName'} Not: headers='fieldName:capitalize' On Oct 15, 8:00 am, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, It's not working... I am really confuse... I try with 1.83.2 and 1.87.3. I try with fields=['myfield1','myfield2'] and without it always with field_labels and also with and without headers='fieldname:capitalize'... Is it a issue? Richard On Thu, Oct 14, 2010 at 8:16 PM, Alex yue.a...@gmail.com wrote: Are you trying to display a more user friendly column name rather than the DB column name? If so, you can do this already. The crud.select() has a method called field_labels, which takes a dictionary of field names to their labels. http://www.web2py.com/book/default/chapter/07#Methods crud.select(db.person, field_labels={'dbColName':'MyLabel'}) On Oct 14, 3:00 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Does it plan to have the possibility to specify the labels of fields in a crud.select?? Richard- Hide quoted text - - Show quoted text -
[web2py] list:string with empty list is not reversible
Using web2py 1.87.2 with sqlite I need to store and retrieve a list of strings from a multple select. I have a case where the list can be the empty list []. It will encode to the datebase as '||', but will decode to ['|'], not []. The current gluon.sql.py is: def bar_encode(items): return '|%s|' % '|'.join(bar_escape(item) for item in items if str(item).strip()) def bar_decode_string(value): return [x.replace('||','|') for x in string_unpack.split(value) if x.strip()] I believe the following would fix this: def bar_decode_string(value): return [x.replace('||','|') for x in string_unpack.split(value[1:-1]) if x.strip()]
[web2py] Re: Packaging web2py for Debian
IMHO I would not separate anything. A big part of Web2py's magic is that you do don't need to install it. Keeping everything together insures that upgrades will always work via the web2py web interface (with a pleasant side effect being that you do not have to repackage each time Web2py is updated so you get to spend more time doing what you love ;) Other matters in no particular order... If you want debian startup scripts you could do it the way you mentioned, the formal debian way or the web2py way or some combination. You might consider placing them in the web2py/scripts directory (if Massimo if OK with that). This would make them easy to update (ie. no (debian) repackaging required) and they would be available to all Web2py users and developers. I think web2py/scripts/web2py.ubuntu.sh has a startup example. I the way it is done in the Ubuntu script work on all other debian systems. Project X Project X could be a Debian package containing a companion web2py application. In this case, for Debian users / developers. The idea being again to free you from the drudgery of repackaging when you (and optionally others if you so choose) want to update the companion application. I mentioned the possibility of using a mercurial clone as this would give you the freedom to add additional features, customizations and updates to the companion application, again without needing to update any debian packages. It has a lot of other very interesting side effects as well including creating a mechanism (via mercurial) that allows allows other web2py users to contribute to the application, so if you chose to do so it could become a web2py community application. By not automating companion application updates you give package users full control. Advantages - Flexibility - Ability to update the package x companion application without repackaging. - Transfer of application maintaining is trivial. - Others can easily contribute to the package x companion application by installing package. - Keeps everyone focused on Web2py. - Did I mention it is really cool! Disadvantages - Requires maintainers for the two debian packages and one web2py application. - Too flexible? Universal Installers and so on. A setup similar to this opens the door to all the possible things that one can do with Web2py applications including providing instructions, links to additional debian packages, apt url installers, chats, twitter, scripts, server monitoring tools, video instructions, deployment tools and the list goes up to and including a Universal Installer if one where so inclined. The point being that a Debian package that including a companion application allows you (or others if you so choose) to add almost any additional feature at any time without the need to repackage and redistribute a Debian package, although this would also be possible if one chose to do so... Wow , that was really tough to describe in an email! Keep rockin, Cheers, Chris On Oct 15, 1:06 pm, José L. jredr...@gmail.com wrote: On 15 oct, 13:32, Mark Breedveld m.breedv...@solcon.nl wrote: You have the idea. Thanks for clearing it towards the others. My guesses it we need to do both. Because Jose goal is general purpose and mine aswell, but comes with overkill in the most cases. In Jose case I would suggest a slight change. web2py-core web2py-gluon This has been discusses before, I recall you where in those discussions Jose.http://groups.google.com/group/web2py/browse_frm/thread/45ea4327d713b... http://groups.google.com/group/web2py/browse_frm/thread/51b731d9abb52... There are some other topics, search for turnkeylinux, where this is mentioned. I recall Dimo Barsky was busy with packaging Gluon, but I've been out for a while. I don't know him, but he might help with this. It was chaos post again, but I hope this one helps:p. Mark, Thanks, but after looking for more info in the links you provided, I have not been able to find the rationale for a separate gluon and core packages. can anybody enlight me?
[web2py] Re: labels in crud.select
Here you go, I just tested this: selected=crud.select(table, headers={'table.field1': 'capitalize'}) You have to explicitly specify the table name of the field you want to label. On Oct 15, 4:54 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: I try in many ways with no success... I read somewhere that headers='fieldName:capitalize' was the only parameter for headers accepted... What I did : selected=crud.select(table,field_labels={'field1':'abc'},headers='fieldname:capitalize') selected=crud.select(table,field_labels={'field1':'abc'}) selected=crud.select(table,fields=['field1'],field_labels={'field1':'abc'},headers='fieldname:capitalize') selected=crud.select(table,field_labels={'result':'Edit'},headers='fieldname:capitalize') selected=crud.select(table,fields=['field1'],field_labels={'field1':'abc'},headers='fieldname:capitalize') selected=crud.select(table,fields=['field1'],field_labels={'field1':'abc'}) selected=crud.select(table,fields=['field1'],labels={'field1':'abc'}) Nothing! Thanks anyway. Richard On Fri, Oct 15, 2010 at 3:23 PM, Alex yue.a...@gmail.com wrote: Maybe it's the syntax? headers={'person.name': 'Name', 'table.colName': 'MyNewName'} Not: headers='fieldName:capitalize' On Oct 15, 8:00 am, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, It's not working... I am really confuse... I try with 1.83.2 and 1.87.3. I try with fields=['myfield1','myfield2'] and without it always with field_labels and also with and without headers='fieldname:capitalize'... Is it a issue? Richard On Thu, Oct 14, 2010 at 8:16 PM, Alex yue.a...@gmail.com wrote: Are you trying to display a more user friendly column name rather than the DB column name? If so, you can do this already. The crud.select() has a method called field_labels, which takes a dictionary of field names to their labels. http://www.web2py.com/book/default/chapter/07#Methods crud.select(db.person, field_labels={'dbColName':'MyLabel'}) On Oct 14, 3:00 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Does it plan to have the possibility to specify the labels of fields in a crud.select?? Richard- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[web2py] custom controllers
when it is said that we need 4 cutome contollers dose editing the ones that are already there count, such as def index, ect, or do we need to creat all new ones, and if so I need advice on what to make, as it is now all i have Is a start up page that asks the users name, then tells them that they need to login. Jon T.
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: list:string with empty list is not reversible
fixed in trunk On Oct 15, 5:42 pm, Bob_in_Comox rwstj...@gmail.com wrote: Using web2py 1.87.2 with sqlite I need to store and retrieve a list of strings from a multple select. I have a case where the list can be the empty list []. It will encode to the datebase as '||', but will decode to ['|'], not []. The current gluon.sql.py is: def bar_encode(items): return '|%s|' % '|'.join(bar_escape(item) for item in items if str(item).strip()) def bar_decode_string(value): return [x.replace('||','|') for x in string_unpack.split(value) if x.strip()] I believe the following would fix this: def bar_decode_string(value): return [x.replace('||','|') for x in string_unpack.split(value[1:-1]) if x.strip()]
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: Packaging web2py for Debian
I do not know what the best way and retaining the ability to to hot upgrades is important. Just to add a piece of information. Jonathan is working on a re factoring that will allow web2py to be installed in one folder, keep applications/configurations/logs in another, and run from a third folder. This should be done soon and will help in this case. Massimo On Oct 15, 6:04 pm, Christopher Steel chris.st...@gmail.com wrote: IMHO I would not separate anything. A big part of Web2py's magic is that you do don't need to install it. Keeping everything together insures that upgrades will always work via the web2py web interface (with a pleasant side effect being that you do not have to repackage each time Web2py is updated so you get to spend more time doing what you love ;) Other matters in no particular order... If you want debian startup scripts you could do it the way you mentioned, the formal debian way or the web2py way or some combination. You might consider placing them in the web2py/scripts directory (if Massimo if OK with that). This would make them easy to update (ie. no (debian) repackaging required) and they would be available to all Web2py users and developers. I think web2py/scripts/web2py.ubuntu.sh has a startup example. I the way it is done in the Ubuntu script work on all other debian systems. Project X Project X could be a Debian package containing a companion web2py application. In this case, for Debian users / developers. The idea being again to free you from the drudgery of repackaging when you (and optionally others if you so choose) want to update the companion application. I mentioned the possibility of using a mercurial clone as this would give you the freedom to add additional features, customizations and updates to the companion application, again without needing to update any debian packages. It has a lot of other very interesting side effects as well including creating a mechanism (via mercurial) that allows allows other web2py users to contribute to the application, so if you chose to do so it could become a web2py community application. By not automating companion application updates you give package users full control. Advantages - Flexibility - Ability to update the package x companion application without repackaging. - Transfer of application maintaining is trivial. - Others can easily contribute to the package x companion application by installing package. - Keeps everyone focused on Web2py. - Did I mention it is really cool! Disadvantages - Requires maintainers for the two debian packages and one web2py application. - Too flexible? Universal Installers and so on. A setup similar to this opens the door to all the possible things that one can do with Web2py applications including providing instructions, links to additional debian packages, apt url installers, chats, twitter, scripts, server monitoring tools, video instructions, deployment tools and the list goes up to and including a Universal Installer if one where so inclined. The point being that a Debian package that including a companion application allows you (or others if you so choose) to add almost any additional feature at any time without the need to repackage and redistribute a Debian package, although this would also be possible if one chose to do so... Wow , that was really tough to describe in an email! Keep rockin, Cheers, Chris On Oct 15, 1:06 pm, José L. jredr...@gmail.com wrote: On 15 oct, 13:32, Mark Breedveld m.breedv...@solcon.nl wrote: You have the idea. Thanks for clearing it towards the others. My guesses it we need to do both. Because Jose goal is general purpose and mine aswell, but comes with overkill in the most cases. In Jose case I would suggest a slight change. web2py-core web2py-gluon This has been discusses before, I recall you where in those discussions Jose.http://groups.google.com/group/web2py/browse_frm/thread/45ea4327d713b... http://groups.google.com/group/web2py/browse_frm/thread/51b731d9abb52... There are some other topics, search for turnkeylinux, where this is mentioned. I recall Dimo Barsky was busy with packaging Gluon, but I've been out for a while. I don't know him, but he might help with this. It was chaos post again, but I hope this one helps:p. Mark, Thanks, but after looking for more info in the links you provided, I have not been able to find the rationale for a separate gluon and core packages. can anybody enlight me?
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
This is what I normally do: 1) I use LinkedIN with RPX (but should be same with OAuth) 2) my auth_user table is populated automatically when users login via RPX 3) my auth_user table as a field registered' invisible and defaults to false 4) my model has this code if auth.user and request.function!='user' and not auth.user.registered: redirect(URL('default','user/profile')) 5) this forces users to complete a registration process. 6) my auth_user table also a boolean manager field that defaults to false. 7) I use appadmin to promote users to managers On Oct 15, 6:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: Web2py like clone in Java?
Do you mean client-side events or server-side events, or something in between? I think while we lack server-side events we actually have a system for handling client side events using jQuery and LOAD. I will post an example. I need to resume and fix this: http://groups.google.com/group/web2py/browse_thread/thread/9c7ac0bfa7f6fe7/2f972fa13ed0f1a0?lnk=gstq=jdiv#2f972fa13ed0f1a0 the jDiv class was the grandfather of the LOAD helper. On Oct 15, 3:10 pm, Michele Comitini michele.comit...@gmail.com wrote: Lately I have been forced to use wicket (wicket.apache.org). Wicket is by no means agile compared to web2py. Wicket is not a full stack framework it needs a lot of other things to serve pages. As with any java coding wicket takes ages and pages to do things that python does in one line. Against there is the java language which is not functional and you need to carry around full objects (in wicket called models) to pass messages between components, which can be long to write. But the thing I would take from wicket is a strong component/event oriented approach with well defined interfaces, and a lot of predefined widgets. The same componet/event architecture can be implemented in web2py using pyjamas, and it is quite easy and much more flexible, but it would be nice to have it included by default or as a plugin! 2010/10/15 David Marko dma...@tiscali.cz: My favourite for clean java ishttp://www.playframework.org/Better experience than with Grails. David On 15 říj, 02:21, Bruno Rocha rochacbr...@gmail.com wrote: Grails uses a template language g:each in=${books} You can't write Java or Groove in views as we can do with web2py writing pure Python direclty in views. It is one of the best/important feature in web2py, lot of people love web2py because of the template system. 2010/10/14 Jonathan Lundell jlund...@pobox.com On Oct 14, 2010, at 4:38 PM, DJ wrote: I was in a discussion recently telling my friend how great Web2Py was for programmer productivity with all the inbuilt features (server, CRUD, auth). We were wondering if there was anything similar in Java? Quick google search brought me to Tapestry and Wicket. Can any of you comment on any frameworks in java you have worked with that resemble Web2py? Thank you for your comments. One possibility is Groovy, essentially a dynamic version of Java, and the Grails framework. http://en.wikipedia.org/wiki/Groovy_(programming_language)http://en.wikipedia.org/wiki/Groovy_%28programming_language%29 http://en.wikipedia.org/wiki/Grails_(framework)http://en.wikipedia.org/wiki/Grails_%28framework%29 *Java is the new COBOL* -- http://rochacbruno.com.br
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
Thanks M I'll base my agent user type on your approach Thanks again for taking the time On 16 Oct 2010, at 00:48, mdipierro mdipie...@cs.depaul.edu wrote: This is what I normally do: 1) I use LinkedIN with RPX (but should be same with OAuth) 2) my auth_user table is populated automatically when users login via RPX 3) my auth_user table as a field registered' invisible and defaults to false 4) my model has this code if auth.user and request.function!='user' and not auth.user.registered: redirect(URL('default','user/profile')) 5) this forces users to complete a registration process. 6) my auth_user table also a boolean manager field that defaults to false. 7) I use appadmin to promote users to managers On Oct 15, 6:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: custom controllers
This is a question about my class not about web2py so we should continue this conversation privately. Please email me personally. Anyway, the answer is: you need to write code for at least 4 new controllers. The ones that come in default.py already (download, user, call) do not count and you should leave them as they are. Massimo On Oct 15, 6:16 pm, Jonathan Thielitz teel...@gmail.com wrote: when it is said that we need 4 cutome contollers dose editing the ones that are already there count, such as def index, ect, or do we need to creat all new ones, and if so I need advice on what to make, as it is now all i have Is a start up page that asks the users name, then tells them that they need to login. Jon T.
[web2py] Re: Can jqgrid be resized?
Thank you. That's working. Another question: how would I go about editing the CSS for the jqgrid plugin in plugin_wiki? I need to basically edit the height of the column headers such as div id=jqgh_name class=ui-jqgrid-sortable. After applying a new CSS theme, the jqgrid headers seem to have been messed up and the text is nearly unreadable. Thanks again for your help. -Percy On Oct 15, 4:27 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: In a view you can do this : {{=plugin_wiki.widget('jqgrid',tablename,width=900,height=400)}} Richard On Fri, Oct 15, 2010 at 5:01 PM, Percy desp...@gmail.com wrote: Hello, I am wondering if a jqgrid table can be resized? Currently I have the following code: displayrows=plugin_wiki.widget('jqgrid',db.entry,'','','','divtest','', 250,500) And no matter which numbers I enter for the last two parameters (width and height according to http://web2py.com/book/default/chapter/13?search=jqgrid), there seems to be no visual effect when I view my jqgrid in my app. Am I doing something wrong, or is there a way other than changing parameters to further edit a jqgrid's look and size? Thank you. -Percy
[web2py] Re: Vote for a new logo
Bruno, thanks for the gallery view. I think you can put 3 to a row by trimming the edges off of the background. Also, I suggest you condense the information below the logo, like uploaded by and uploaded on. Identification info can all be put on 1 line under the logo. Also, please put the Vote and Delete buttons on opposite sides of the logo, so you don't end up voting for a logo you're about to delete, something I've done multiple times, now. The system is getting pretty good. Thanks again! On Oct 15, 4:40 pm, Michele Comitini michele.comit...@gmail.com wrote: @Bruno excellent work! 2010/10/15 Bruno Rocha rochacbr...@gmail.com: 2010/10/15 weheh richard_gor...@verizon.net Bruno Rocha - could you modify display page to be more gallery style rather than inline? I don't think we need to see the banner buttons for every logo. Thx for the good work. DONE:http://www.blouweb.com/logovote/default/index
[web2py] twython - easy twitter access with python
http://pypi.python.org/pypi/twython/1.2.1
[web2py] Re: Vote for a new logo
logovote uploading capability is broken.
[web2py] Re: Can jqgrid be resized?
Also, I was wondering: is there a way for jqgrid columns to have an auto expand or auto width etc. property? I know you can set the col_width attribute with numerical values, but I was hoping for something more dynamic. Thanks again! -Percy On Oct 15, 4:27 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: In a view you can do this : {{=plugin_wiki.widget('jqgrid',tablename,width=900,height=400)}} Richard On Fri, Oct 15, 2010 at 5:01 PM, Percy desp...@gmail.com wrote: Hello, I am wondering if a jqgrid table can be resized? Currently I have the following code: displayrows=plugin_wiki.widget('jqgrid',db.entry,'','','','divtest','', 250,500) And no matter which numbers I enter for the last two parameters (width and height according to http://web2py.com/book/default/chapter/13?search=jqgrid), there seems to be no visual effect when I view my jqgrid in my app. Am I doing something wrong, or is there a way other than changing parameters to further edit a jqgrid's look and size? Thank you. -Percy
[web2py] new-app-engine-sdk
http://googleappengine.blogspot.com/2010/10/new-app-engine-sdk-138-includes-new.html
Re: [web2py] Re: Vote for a new logo
I just made a test http://blouweb.com/logovote/default/index?logoid=95 It works well, I am going to delete my test. 2010/10/15 weheh richard_gor...@verizon.net logovote uploading capability is broken. -- http://rochacbruno.com.br
[web2py] Re: Web2py like clone in Java?
Make a mode called button_event.py objects={} class BUTTON(DIV): def __init__(self,*a,**b): self.tag = 'button' DIV.__init__(self,*a,**b) self.id=self['_id'] objects[self.id]=self def addListener(self,name,f): service.run_procedures[name] = lambda id: f(objects[id]) self['_onclick']=ajax('%s',[],':eval');return false; \ % URL('default','call',args=('run',name,self['_id'])) button = BUTTON('click me',_id='abc') button.addListener('xyz',lambda button: jQuery('#%s').hide() % button.id) and a controller default.py with def index(): return dict(mybutton = button) def call(): return service() This works as you expect. Here is the problem: the button has to defined in the model, not the controller. It it were to be defined in the controller, than the service would only register the listener in the scope of the function. Functions cannot be serialized. They could be cached in ram but that is still not a solution because the process may restart. Any idea? On Oct 15, 8:29 pm, Michele Comitini michele.comit...@gmail.com wrote: 2010/10/16 mdipierro mdipie...@cs.depaul.edu: Do you mean client-side events or server-side events, or something in between? client side events calling listeners on the server. For instance we have a button. Having an interface to add listeners and managing ajax responses would allow writing similar code in a controller: def ajaxButton(): # may use it with a/c/ajaxButton.load b=BUTTON('PUSH ME!') b.addListener(lambda ajaxresponse: ajaxresponse.appendJS('jQuery(%s).hide();' % b.id) the above is just a stupid example, I hope it is not too confusing... I'd create a standard Json response encapsulating the payload of js, page headers, and a list of maps of the tipe {id: element id, {html: replacement, onreadyjs: javascript on element ready}}. A javascript function (on the client) would take care of reading the Json response and take appropriate actions. I think while we lack server-side events we actually have a system for handling client side events using jQuery and LOAD. I will post an example. I need to resume and fix this: http://groups.google.com/group/web2py/browse_thread/thread/9c7ac0bfa7... the jDiv class was the grandfather of the LOAD helper. On Oct 15, 3:10 pm, Michele Comitini michele.comit...@gmail.com wrote: Lately I have been forced to use wicket (wicket.apache.org). Wicket is by no means agile compared to web2py. Wicket is not a full stack framework it needs a lot of other things to serve pages. As with any java coding wicket takes ages and pages to do things that python does in one line. Against there is the java language which is not functional and you need to carry around full objects (in wicket called models) to pass messages between components, which can be long to write. But the thing I would take from wicket is a strong component/event oriented approach with well defined interfaces, and a lot of predefined widgets. The same componet/event architecture can be implemented in web2py using pyjamas, and it is quite easy and much more flexible, but it would be nice to have it included by default or as a plugin! 2010/10/15 David Marko dma...@tiscali.cz: My favourite for clean java ishttp://www.playframework.org/Better experience than with Grails. David On 15 říj, 02:21, Bruno Rocha rochacbr...@gmail.com wrote: Grails uses a template language g:each in=${books} You can't write Java or Groove in views as we can do with web2py writing pure Python direclty in views. It is one of the best/important feature in web2py, lot of people love web2py because of the template system. 2010/10/14 Jonathan Lundell jlund...@pobox.com On Oct 14, 2010, at 4:38 PM, DJ wrote: I was in a discussion recently telling my friend how great Web2Py was for programmer productivity with all the inbuilt features (server, CRUD, auth). We were wondering if there was anything similar in Java? Quick google search brought me to Tapestry and Wicket. Can any of you comment on any frameworks in java you have worked with that resemble Web2py? Thank you for your comments. One possibility is Groovy, essentially a dynamic version of Java, and the Grails framework. http://en.wikipedia.org/wiki/Groovy_(programming_language)http://en.wikipedia.org/wiki/Groovy_%28programming_language%29 http://en.wikipedia.org/wiki/Grails_(framework)http://en.wikipedia.org/wiki/Grails_%28framework%29 *Java is the new COBOL* -- http://rochacbruno.com.br
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
One small problem I'm coming across... I'm using OAuth to login via LinkedIn for a subset of my users. In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py 1.87.3) next = self.url('user',args='login',vars=dict(_next=next)) Is there something I should have done to avoid this route through the code? I'm currently using it to pass a return url to LinkedIn and I'd like a different url besides /user/ On 16 October 2010 01:01, Carl Roach carl.ro...@gmail.com wrote: Thanks M I'll base my agent user type on your approach Thanks again for taking the time On 16 Oct 2010, at 00:48, mdipierro mdipie...@cs.depaul.edu wrote: This is what I normally do: 1) I use LinkedIN with RPX (but should be same with OAuth) 2) my auth_user table is populated automatically when users login via RPX 3) my auth_user table as a field registered' invisible and defaults to false 4) my model has this code if auth.user and request.function!='user' and not auth.user.registered: redirect(URL('default','user/profile')) 5) this forces users to complete a registration process. 6) my auth_user table also a boolean manager field that defaults to false. 7) I use appadmin to promote users to managers On Oct 15, 6:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
Re: [web2py] Re: Web2py like clone in Java?
no idea at this time, I need some sleep ... tomorrow ;-) 2010/10/16 mdipierro mdipie...@cs.depaul.edu: Make a mode called button_event.py objects={} class BUTTON(DIV): def __init__(self,*a,**b): self.tag = 'button' DIV.__init__(self,*a,**b) self.id=self['_id'] objects[self.id]=self def addListener(self,name,f): service.run_procedures[name] = lambda id: f(objects[id]) self['_onclick']=ajax('%s',[],':eval');return false; \ % URL('default','call',args=('run',name,self['_id'])) button = BUTTON('click me',_id='abc') button.addListener('xyz',lambda button: jQuery('#%s').hide() % button.id) and a controller default.py with def index(): return dict(mybutton = button) def call(): return service() This works as you expect. Here is the problem: the button has to defined in the model, not the controller. It it were to be defined in the controller, than the service would only register the listener in the scope of the function. Functions cannot be serialized. They could be cached in ram but that is still not a solution because the process may restart. Any idea? On Oct 15, 8:29 pm, Michele Comitini michele.comit...@gmail.com wrote: 2010/10/16 mdipierro mdipie...@cs.depaul.edu: Do you mean client-side events or server-side events, or something in between? client side events calling listeners on the server. For instance we have a button. Having an interface to add listeners and managing ajax responses would allow writing similar code in a controller: def ajaxButton(): # may use it with a/c/ajaxButton.load b=BUTTON('PUSH ME!') b.addListener(lambda ajaxresponse: ajaxresponse.appendJS('jQuery(%s).hide();' % b.id) the above is just a stupid example, I hope it is not too confusing... I'd create a standard Json response encapsulating the payload of js, page headers, and a list of maps of the tipe {id: element id, {html: replacement, onreadyjs: javascript on element ready}}. A javascript function (on the client) would take care of reading the Json response and take appropriate actions. I think while we lack server-side events we actually have a system for handling client side events using jQuery and LOAD. I will post an example. I need to resume and fix this: http://groups.google.com/group/web2py/browse_thread/thread/9c7ac0bfa7... the jDiv class was the grandfather of the LOAD helper. On Oct 15, 3:10 pm, Michele Comitini michele.comit...@gmail.com wrote: Lately I have been forced to use wicket (wicket.apache.org). Wicket is by no means agile compared to web2py. Wicket is not a full stack framework it needs a lot of other things to serve pages. As with any java coding wicket takes ages and pages to do things that python does in one line. Against there is the java language which is not functional and you need to carry around full objects (in wicket called models) to pass messages between components, which can be long to write. But the thing I would take from wicket is a strong component/event oriented approach with well defined interfaces, and a lot of predefined widgets. The same componet/event architecture can be implemented in web2py using pyjamas, and it is quite easy and much more flexible, but it would be nice to have it included by default or as a plugin! 2010/10/15 David Marko dma...@tiscali.cz: My favourite for clean java ishttp://www.playframework.org/Better experience than with Grails. David On 15 říj, 02:21, Bruno Rocha rochacbr...@gmail.com wrote: Grails uses a template language g:each in=${books} You can't write Java or Groove in views as we can do with web2py writing pure Python direclty in views. It is one of the best/important feature in web2py, lot of people love web2py because of the template system. 2010/10/14 Jonathan Lundell jlund...@pobox.com On Oct 14, 2010, at 4:38 PM, DJ wrote: I was in a discussion recently telling my friend how great Web2Py was for programmer productivity with all the inbuilt features (server, CRUD, auth). We were wondering if there was anything similar in Java? Quick google search brought me to Tapestry and Wicket. Can any of you comment on any frameworks in java you have worked with that resemble Web2py? Thank you for your comments. One possibility is Groovy, essentially a dynamic version of Java, and the Grails framework. http://en.wikipedia.org/wiki/Groovy_(programming_language)http://en.wikipedia.org/wiki/Groovy_%28programming_language%29 http://en.wikipedia.org/wiki/Grails_(framework)http://en.wikipedia.org/wiki/Grails_%28framework%29 *Java is the new COBOL* -- http://rochacbruno.com.br
[web2py] Re: Web2py like clone in Java?
Notice that all the logic (from user prospective) is here: button = BUTTON('click me',_id='abc') button.addListener('xyz',lambda button:jQuery('# %s').hide()%button.id) def index(): return dict(mybutton = button) The logic in the class BUTTON could be injected in all helpers without problems (A already has part of it). The call action is already in the scaffold default.py. The LOAD helpers was designed to make this even easier by putting all the logic in the controller: def index(): return dict(mybutton=LOAD('default','button1')) def button1(): if request.env.request_method=='GET': return TAG.BUTTON('click me',_id='button1', _onclick=ajax('%s',[],':eval');return false; % URL('button1')) return jQuery('#button1').hide(); This logic works with web2py already out of the box and I like it better than registering callbacks. On Oct 15, 9:08 pm, mdipierro mdipie...@cs.depaul.edu wrote: Make a mode called button_event.py objects={} class BUTTON(DIV): def __init__(self,*a,**b): self.tag = 'button' DIV.__init__(self,*a,**b) self.id=self['_id'] objects[self.id]=self def addListener(self,name,f): service.run_procedures[name] = lambda id: f(objects[id]) self['_onclick']=ajax('%s',[],':eval');return false; \ % URL('default','call',args=('run',name,self['_id'])) button = BUTTON('click me',_id='abc') button.addListener('xyz',lambda button: jQuery('#%s').hide() % button.id) and a controller default.py with def index(): return dict(mybutton = button) def call(): return service() This works as you expect. Here is the problem: the button has to defined in the model, not the controller. It it were to be defined in the controller, than the service would only register the listener in the scope of the function. Functions cannot be serialized. They could be cached in ram but that is still not a solution because the process may restart. Any idea? On Oct 15, 8:29 pm, Michele Comitini michele.comit...@gmail.com wrote: 2010/10/16 mdipierro mdipie...@cs.depaul.edu: Do you mean client-side events or server-side events, or something in between? client side events calling listeners on the server. For instance we have a button. Having an interface to add listeners and managing ajax responses would allow writing similar code in a controller: def ajaxButton(): # may use it with a/c/ajaxButton.load b=BUTTON('PUSH ME!') b.addListener(lambda ajaxresponse: ajaxresponse.appendJS('jQuery(%s).hide();' % b.id) the above is just a stupid example, I hope it is not too confusing... I'd create a standard Json response encapsulating the payload of js, page headers, and a list of maps of the tipe {id: element id, {html: replacement, onreadyjs: javascript on element ready}}. A javascript function (on the client) would take care of reading the Json response and take appropriate actions. I think while we lack server-side events we actually have a system for handling client side events using jQuery and LOAD. I will post an example. I need to resume and fix this: http://groups.google.com/group/web2py/browse_thread/thread/9c7ac0bfa7... the jDiv class was the grandfather of the LOAD helper. On Oct 15, 3:10 pm, Michele Comitini michele.comit...@gmail.com wrote: Lately I have been forced to use wicket (wicket.apache.org). Wicket is by no means agile compared to web2py. Wicket is not a full stack framework it needs a lot of other things to serve pages. As with any java coding wicket takes ages and pages to do things that python does in one line. Against there is the java language which is not functional and you need to carry around full objects (in wicket called models) to pass messages between components, which can be long to write. But the thing I would take from wicket is a strong component/event oriented approach with well defined interfaces, and a lot of predefined widgets. The same componet/event architecture can be implemented in web2py using pyjamas, and it is quite easy and much more flexible, but it would be nice to have it included by default or as a plugin! 2010/10/15 David Marko dma...@tiscali.cz: My favourite for clean java ishttp://www.playframework.org/Better experience than with Grails. David On 15 říj, 02:21, Bruno Rocha rochacbr...@gmail.com wrote: Grails uses a template language g:each in=${books} You can't write Java or Groove in views as we can do with web2py writing pure Python direclty in views. It is one of the best/important feature in web2py, lot of people love web2py because of the template system. 2010/10/14 Jonathan Lundell jlund...@pobox.com On Oct 14, 2010, at 4:38 PM, DJ wrote: I was in a discussion recently telling my friend how great
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
I did not realize that... can change it but for now it is indeed a problem. One solution would be to extend Auth and override url() On Oct 15, 9:07 pm, Carl carl.ro...@gmail.com wrote: One small problem I'm coming across... I'm using OAuth to login via LinkedIn for a subset of my users. In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py 1.87.3) next = self.url('user',args='login',vars=dict(_next=next)) Is there something I should have done to avoid this route through the code? I'm currently using it to pass a return url to LinkedIn and I'd like a different url besides /user/ On 16 October 2010 01:01, Carl Roach carl.ro...@gmail.com wrote: Thanks M I'll base my agent user type on your approach Thanks again for taking the time On 16 Oct 2010, at 00:48, mdipierro mdipie...@cs.depaul.edu wrote: This is what I normally do: 1) I use LinkedIN with RPX (but should be same with OAuth) 2) my auth_user table is populated automatically when users login via RPX 3) my auth_user table as a field registered' invisible and defaults to false 4) my model has this code if auth.user and request.function!='user' and not auth.user.registered: redirect(URL('default','user/profile')) 5) this forces users to complete a registration process. 6) my auth_user table also a boolean manager field that defaults to false. 7) I use appadmin to promote users to managers On Oct 15, 6:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
temporarily I've renamed def agent() back to def user() the only problem I'm left with is how to get my one-off registration code to be called. for users registering by a registration form all is well. For them I've set: auth.settings.register_onaccept = lambda form: registerCandidate(form) But for users via LinkedIn... no registeration step is called; and auth.settings.login_onaccept = lambda form: registerAgent(form) is ignored too. One solution is to change: auth.settings.login_next = URL(r=request,f='account') to: auth.settings.login_next = URL(r=request,f='oneoffregistration') which can do the one of stuff and then redirect to 'account' But I feel there must be a way that leverages the framework more elegantly. Is there? :) On 16 October 2010 03:51, mdipierro mdipie...@cs.depaul.edu wrote: I did not realize that... can change it but for now it is indeed a problem. One solution would be to extend Auth and override url() On Oct 15, 9:07 pm, Carl carl.ro...@gmail.com wrote: One small problem I'm coming across... I'm using OAuth to login via LinkedIn for a subset of my users. In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py 1.87.3) next = self.url('user',args='login',vars=dict(_next=next)) Is there something I should have done to avoid this route through the code? I'm currently using it to pass a return url to LinkedIn and I'd like a different url besides /user/ On 16 October 2010 01:01, Carl Roach carl.ro...@gmail.com wrote: Thanks M I'll base my agent user type on your approach Thanks again for taking the time On 16 Oct 2010, at 00:48, mdipierro mdipie...@cs.depaul.edu wrote: This is what I normally do: 1) I use LinkedIN with RPX (but should be same with OAuth) 2) my auth_user table is populated automatically when users login via RPX 3) my auth_user table as a field registered' invisible and defaults to false 4) my model has this code if auth.user and request.function!='user' and not auth.user.registered: redirect(URL('default','user/profile')) 5) this forces users to complete a registration process. 6) my auth_user table also a boolean manager field that defaults to false. 7) I use appadmin to promote users to managers On Oct 15, 6:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
RPX (LinkedId) + web2py Auth module this could help: http://www.web2pyslices.com/main/slices/take_slice/28 Cheers, rad On Oct 16, 12:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
On a second look... 'user' only appears in auth.settings. therefore you can change them. On Oct 15, 9:51 pm, mdipierro mdipie...@cs.depaul.edu wrote: I did not realize that... can change it but for now it is indeed a problem. One solution would be to extend Auth and override url() On Oct 15, 9:07 pm, Carl carl.ro...@gmail.com wrote: One small problem I'm coming across... I'm using OAuth to login via LinkedIn for a subset of my users. In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py 1.87.3) next = self.url('user',args='login',vars=dict(_next=next)) Is there something I should have done to avoid this route through the code? I'm currently using it to pass a return url to LinkedIn and I'd like a different url besides /user/ On 16 October 2010 01:01, Carl Roach carl.ro...@gmail.com wrote: Thanks M I'll base my agent user type on your approach Thanks again for taking the time On 16 Oct 2010, at 00:48, mdipierro mdipie...@cs.depaul.edu wrote: This is what I normally do: 1) I use LinkedIN with RPX (but should be same with OAuth) 2) my auth_user table is populated automatically when users login via RPX 3) my auth_user table as a field registered' invisible and defaults to false 4) my model has this code if auth.user and request.function!='user' and not auth.user.registered: redirect(URL('default','user/profile')) 5) this forces users to complete a registration process. 6) my auth_user table also a boolean manager field that defaults to false. 7) I use appadmin to promote users to managers On Oct 15, 6:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
thanks M. I'm confused though as I can see 'user' here: In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py 1.87.3) next = self.url('user',args='login',vars=dict(_next=next)) Have I misunderstood this line of code? On Oct 16, 4:51 am, mdipierro mdipie...@cs.depaul.edu wrote: On a second look... 'user' only appears in auth.settings. therefore you can change them. On Oct 15, 9:51 pm, mdipierro mdipie...@cs.depaul.edu wrote: I did not realize that... can change it but for now it is indeed a problem. One solution would be to extend Auth and override url() On Oct 15, 9:07 pm, Carl carl.ro...@gmail.com wrote: One small problem I'm coming across... I'm using OAuth to login via LinkedIn for a subset of my users. In gluon/tools.py line 1471 the statement hard-codes 'user' (web2py 1.87.3) next = self.url('user',args='login',vars=dict(_next=next)) Is there something I should have done to avoid this route through the code? I'm currently using it to pass a return url to LinkedIn and I'd like a different url besides /user/ On 16 October 2010 01:01, Carl Roach carl.ro...@gmail.com wrote: Thanks M I'll base my agent user type on your approach Thanks again for taking the time On 16 Oct 2010, at 00:48, mdipierro mdipie...@cs.depaul.edu wrote: This is what I normally do: 1) I use LinkedIN with RPX (but should be same with OAuth) 2) my auth_user table is populated automatically when users login via RPX 3) my auth_user table as a field registered' invisible and defaults to false 4) my model has this code if auth.user and request.function!='user' and not auth.user.registered: redirect(URL('default','user/profile')) 5) this forces users to complete a registration process. 6) my auth_user table also a boolean manager field that defaults to false. 7) I use appadmin to promote users to managers On Oct 15, 6:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
thanks for the pointer Radomirs. the slice has the registering step disabled rpxAuth.rpx_disabled = ['register','retrieve_password', 'reset_password','change_password','profile'] but doesn't say how to skip registering by the user *and* still perform some register actions in the code. The above snippet prevents the user from registering. But how to have one's code, for example, set some permissions or set-up the account is some other way. On 16 October 2010 04:48, Radomirs Cirskis nad2...@gmail.com wrote: RPX (LinkedId) + web2py Auth module this could help: http://www.web2pyslices.com/main/slices/take_slice/28 Cheers, rad On Oct 16, 12:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
[web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
I guess what I do not understand is the following. You authenticate somebody using linked (or other method), yet how do you decide how to setup is account? You cannot decide from the url! No because it would not be safe since the user decides the url. massimo On Oct 15, 10:59 pm, Carl carl.ro...@gmail.com wrote: thanks for the pointer Radomirs. the slice has the registering step disabled rpxAuth.rpx_disabled = ['register','retrieve_password', 'reset_password','change_password','profile'] but doesn't say how to skip registering by the user *and* still perform some register actions in the code. The above snippet prevents the user from registering. But how to have one's code, for example, set some permissions or set-up the account is some other way. On 16 October 2010 04:48, Radomirs Cirskis nad2...@gmail.com wrote: RPX (LinkedId) + web2py Auth module this could help:http://www.web2pyslices.com/main/slices/take_slice/28 Cheers, rad On Oct 16, 12:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
Re: [web2py] Re: Web2py like clone in Java?
I used this http://www.gnu.org/software/pythonwebkit/ sometime with Pylons. But I think it is the base of Pyjamas. 2010/10/15 Michele Comitini michele.comit...@gmail.com Lately I have been forced to use wicket (wicket.apache.org). Wicket is by no means agile compared to web2py. Wicket is not a full stack framework it needs a lot of other things to serve pages. As with any java coding wicket takes ages and pages to do things that python does in one line. Against there is the java language which is not functional and you need to carry around full objects (in wicket called models) to pass messages between components, which can be long to write. But the thing I would take from wicket is a strong component/event oriented approach with well defined interfaces, and a lot of predefined widgets. The same componet/event architecture can be implemented in web2py using pyjamas, and it is quite easy and much more flexible, but it would be nice to have it included by default or as a plugin! 2010/10/15 David Marko dma...@tiscali.cz: My favourite for clean java is http://www.playframework.org/ Better experience than with Grails. David On 15 říj, 02:21, Bruno Rocha rochacbr...@gmail.com wrote: Grails uses a template language g:each in=${books} You can't write Java or Groove in views as we can do with web2py writing pure Python direclty in views. It is one of the best/important feature in web2py, lot of people love web2py because of the template system. 2010/10/14 Jonathan Lundell jlund...@pobox.com On Oct 14, 2010, at 4:38 PM, DJ wrote: I was in a discussion recently telling my friend how great Web2Py was for programmer productivity with all the inbuilt features (server, CRUD, auth). We were wondering if there was anything similar in Java? Quick google search brought me to Tapestry and Wicket. Can any of you comment on any frameworks in java you have worked with that resemble Web2py? Thank you for your comments. One possibility is Groovy, essentially a dynamic version of Java, and the Grails framework. http://en.wikipedia.org/wiki/Groovy_(programming_language) http://en.wikipedia.org/wiki/Groovy_%28programming_language%29 http://en.wikipedia.org/wiki/Grails_(framework) http://en.wikipedia.org/wiki/Grails_%28framework%29 *Java is the new COBOL* -- http://rochacbruno.com.br -- http://rochacbruno.com.br
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
good question! if the account is authenticated using linkedin then I want to set-up the account a specific way. if the account is registered/logged-in the 'usual way' then I want to set-up the account in a specific but different way. I take your point with respect to trust. I've missed a night's sleep so will think on that some more. But now I need to go out :) On 16 October 2010 05:50, mdipierro mdipie...@cs.depaul.edu wrote: I guess what I do not understand is the following. You authenticate somebody using linked (or other method), yet how do you decide how to setup is account? You cannot decide from the url! No because it would not be safe since the user decides the url. massimo On Oct 15, 10:59 pm, Carl carl.ro...@gmail.com wrote: thanks for the pointer Radomirs. the slice has the registering step disabled rpxAuth.rpx_disabled = ['register','retrieve_password', 'reset_password','change_password','profile'] but doesn't say how to skip registering by the user *and* still perform some register actions in the code. The above snippet prevents the user from registering. But how to have one's code, for example, set some permissions or set-up the account is some other way. On 16 October 2010 04:48, Radomirs Cirskis nad2...@gmail.com wrote: RPX (LinkedId) + web2py Auth module this could help:http://www.web2pyslices.com/main/slices/take_slice/28 Cheers, rad On Oct 16, 12:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)
Re: [web2py] Re: Is user in [app]/[controller.py]/user hard-coded into Web2py?
one thought: for one set of users I'll have been given an email address and password and for the other set I'll have a LinkedIn user key On 16 October 2010 06:06, Carl carl.ro...@gmail.com wrote: good question! if the account is authenticated using linkedin then I want to set-up the account a specific way. if the account is registered/logged-in the 'usual way' then I want to set-up the account in a specific but different way. I take your point with respect to trust. I've missed a night's sleep so will think on that some more. But now I need to go out :) On 16 October 2010 05:50, mdipierro mdipie...@cs.depaul.edu wrote: I guess what I do not understand is the following. You authenticate somebody using linked (or other method), yet how do you decide how to setup is account? You cannot decide from the url! No because it would not be safe since the user decides the url. massimo On Oct 15, 10:59 pm, Carl carl.ro...@gmail.com wrote: thanks for the pointer Radomirs. the slice has the registering step disabled rpxAuth.rpx_disabled = ['register','retrieve_password', 'reset_password','change_password','profile'] but doesn't say how to skip registering by the user *and* still perform some register actions in the code. The above snippet prevents the user from registering. But how to have one's code, for example, set some permissions or set-up the account is some other way. On 16 October 2010 04:48, Radomirs Cirskis nad2...@gmail.com wrote: RPX (LinkedId) + web2py Auth module this could help:http://www.web2pyslices.com/main/slices/take_slice/28 Cheers, rad On Oct 16, 12:40 pm, Carl Roach carl.ro...@gmail.com wrote: I've got authentication working with LinkedIn. But no registration step happens... I would like to add a set of permissions the first time a new user logins in via LinkedIn. For a second type of user I offer a registration page to get email/password and then add a different set of permissions. So the piece I'm missing is: how do I fire off a registration step for my LinkedIn users? On 16 Oct 2010, at 00:19, Radomirs Cirskis r...@nowitworks.eu wrote: Hi Carl! you can implement two registration similar to the technique Massimo advised the authentication. You could look into CAS. Not 100% sure, but it could be solution for your case. I could be mistaken. Can you elaborate further on what you are trying to achieve? rad On Oct 16, 10:00 am, Carl carl.ro...@gmail.com wrote: thanks M. adding to def candidate() auth.auth_user = 'candidate' has that side sorted. for my function agent() the process is a little more complicated. While Candidates have to formally register first and then login agents can be automatically registered (I need to add some permissions and do other one-off stuff) when they come back from LinkedIn. The problem is that registration doesn't take place at all and I can't figure out how to get this one-off registration phase called. can you point me in the right direction? On 15 October 2010 19:22, Carl carl.ro...@gmail.com wrote: I'm glad I don't need two user tables. I ideally would want to stick to a single table. On 15 October 2010 19:14, mdipierro mdipie...@cs.depaul.edu wrote: Not necessarily and I would not do it that way but you can. On Oct 15, 1:12 pm, Carl carl.ro...@gmail.com wrote: thanks M. Do I understand that your solution is to have two separate user tables in db.py? On 15 October 2010 18:42, mdipierro mdipie...@cs.depaul.edu wrote: look into default. You can replace def user(): return dict(form=auth()) with def agent(): return dict(form=auth()) def candidate(): return dict(form=auth()) and in the two functions you can set different default for auth_user fields. On Oct 15, 8:45 am, Carl carl.ro...@gmail.com wrote: Is there a way to use [app]/default/agent instead of app/default/user? I want to have two implementations of authentication (/agent and / candidate)