[web2py] Re: changing class of a custom form not working
On Saturday, June 8, 2013 8:06:55 PM UTC-4, Massimo Di Pierro wrote: This the code currently in web2py.css. input[type=text],input[type=password],select{width:300px; margin-right:5px} How do you propose we change it? Discussed details here: https://groups.google.com/d/msg/web2py-developers/WaHw-83DT1w/zbs2fh-tWRoJ. I think this might work: [type=text], [type=password], select { margin-right: 5px; width: 300px; } Anthony -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] a question about _before_delete.append
What does append hint at in the naming of the hooks for data base events? I want to do something when a record is deleted from a grid. Is there any harm if I call _before_delete.append in the controller function, or should the callback be set in the model? I guess it doesn't matter since both the model and the controller function are executed after the form action, but I would like to be sure. Does append mean that multiple callbacks can be set up? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] a question about _before_delete.append
You can set it in model or controller, doesn't matter (as long as you don't make database queries inside models, which you probably don't do). Yes, you can append multiple callbacks. Web2py can use these lists for internal stuff, so you should only append to it. Marin On Sun, Jun 9, 2013 at 2:14 PM, Tim Richardson t...@tim-richardson.netwrote: What does append hint at in the naming of the hooks for data base events? I want to do something when a record is deleted from a grid. Is there any harm if I call _before_delete.append in the controller function, or should the callback be set in the model? I guess it doesn't matter since both the model and the controller function are executed after the form action, but I would like to be sure. Does append mean that multiple callbacks can be set up? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: list:reference requires is not empty
I tried the IS_LIST_OF validator and I can't get ist to work. when I have no validator I got all names in my refrenced table. And I can select as much as I like, but when I use any validators the list disappears and I get an input for a string. I tried IS_LENGTH(minsize=1) as well as IS_LIST_OF(IS_IN_DB(db,reference.id,reference.name),1,10), any suggestions? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: a question about _before_delete.append
Does append mean that multiple callbacks can be set up? Yes, ._before_delete and related attributes are lists of callbacks (each called in succession). Anthony -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: list:reference requires is not empty
Use IS_IN_DB(..., multiple=(1, 1000)). The multiple argument to IS_IN_DB can be a tuple specifying the minimum and maximum number of items to be selected (note, you should set the maximum to a value you know will be above the maximum number of items in the list, unless you want to restrict it to something lower). Anthony On Sunday, June 2, 2013 8:14:19 AM UTC-4, BlueShadow wrote: when one has a database field with a list:reference type it can be empty. For quite a few scenarios this is undesirable. but if you use requires is_not_empty() it first of all doesn't show the reference table entries. And it still allows you to leave the field empty. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: changing class of a custom form not working
Thanks! In trunk. On Sunday, 9 June 2013 07:06:25 UTC-5, Anthony wrote: On Saturday, June 8, 2013 8:06:55 PM UTC-4, Massimo Di Pierro wrote: This the code currently in web2py.css. input[type=text],input[type=password],select{width:300px; margin-right:5px} How do you propose we change it? Discussed details here: https://groups.google.com/d/msg/web2py-developers/WaHw-83DT1w/zbs2fh-tWRoJ. I think this might work: [type=text], [type=password], select { margin-right: 5px; width: 300px; } Anthony -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Error on start: 'Auth' object has no attribute 'wikimenu'
I built an application and uploaded the same to pythonanywhere.com using its admin interface for web2py. I am also having the same problem. Can someone help me. I am a newbie. Incidentally the application works fine on my own computer. Alok On Sunday, May 26, 2013 3:26:23 PM UTC-7, jfinke wrote: I just downloaded the mac version of web2py. When I start the server with a password, I immediately get an error ticket. Error ticket for welcomeTicket ID 127.0.0.1.2013-05-26.17-23-02.b3d13a3c-4b2c-445a-a4cf-2722911fae41 type 'exceptions.AttributeError' 'Auth' object has no attribute 'wikimenu'Versionweb2py™Version (2, 4, 7, 'stable', datetime.datetime(2013, 5, 24, 17, 48, 47))PythonPython 2.5.1: /Users/jeremy/Downloads/web2py/web2py.app/Contents/MacOS/pythonTraceback 1. 2. 3. 4. 5. Traceback (most recent call last): File /home/mdipierro/web2py/gluon/restricted.py, line 212, in restricted File /Users/jeremy/Downloads/web2py/web2py.app/Contents/Resources/applications/welcome/models/menu.py http://localhost:8002/admin/default/edit/welcome/models/menu.py, line 140, in module AttributeError: 'Auth' object has no attribute 'wikimenu' Error snapshot [image: help]http://localhost:8002/admin/default/ticket/welcome/127.0.0.1.2013-05-26.17-23-02.b3d13a3c-4b2c-445a-a4cf-2722911fae41# type 'exceptions.AttributeError'('Auth' object has no attribute 'wikimenu') When I go to line 140 in models/menu.py, I see: if auth in locals(): auth.wikimenu() Any ideas? Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Error on start: 'Auth' object has no attribute 'wikimenu'
I built an application and uploaded the same to pythonanywhere.com using its admin interface for web2py. I am also having the same problem. It should be enough to upgrade your web2py version to solve this. However, if you don't want to upgrade, open app/models/menu.py with a text editor (or edit the file from the admin app) and comment the last line: # if auth in locals(): auth.wikimenu() -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: MENU helper and bootstrap
... I used data-toggle which means a click to expand the menu and a click to close it again, which is ok, but different to the built-in menus which hide when no more mouse-over. Nice! I would also like to know if there's a simple way for swithching MENU objects to that behavior -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: changing class of a custom form not working
This works fine for defining another class like: input id=test class=input-small type=text value= name=test But not for defining size manually like: input id=test size=30 type=text value= name=test Anyway we can change fields using classes now! Thanks!!! Em domingo, 9 de junho de 2013 12h26min04s UTC-3, Massimo Di Pierro escreveu: Thanks! In trunk. On Sunday, 9 June 2013 07:06:25 UTC-5, Anthony wrote: On Saturday, June 8, 2013 8:06:55 PM UTC-4, Massimo Di Pierro wrote: This the code currently in web2py.css. input[type=text],input[type=password],select{width:300px; margin-right:5px} How do you propose we change it? Discussed details here: https://groups.google.com/d/msg/web2py-developers/WaHw-83DT1w/zbs2fh-tWRoJ. I think this might work: [type=text], [type=password], select { margin-right: 5px; width: 300px; } Anthony -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] No module named plural_rules errro after upgrade
Hi guys new user here I just upgraded my folder at /usr/share/web2py to new version: Version 2.5.1-stable+timestamp.2013.06.06.15.39.19 and I'm getting this startup error Terminal output /usr/share/web2py $ python web2py.py WARNING:root:Unable to import plural rules: No module named plural_rules Traceback (most recent call last): File web2py.py, line 18, in module import gluon.widget File /usr/local/lib/python2.7/dist-packages/gluon/widget.py, line 26, in module import main File /usr/local/lib/python2.7/dist-packages/gluon/main.py, line 110, in module raise RuntimeError, Cannot determine web2py version RuntimeError: Cannot determine web2py version Can anyone advise whats missing? I'm running Linux Mint 14 thanks Mike -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: No module named plural_rules errro after upgrade
what did you use to upgrade your installation ? On Sunday, June 9, 2013 9:40:43 PM UTC+2, mike dawson wrote: Hi guys new user here I just upgraded my folder at /usr/share/web2py to new version: Version 2.5.1-stable+timestamp.2013.06.06.15.39.19 and I'm getting this startup error Terminal output /usr/share/web2py $ python web2py.py WARNING:root:Unable to import plural rules: No module named plural_rules Traceback (most recent call last): File web2py.py, line 18, in module import gluon.widget File /usr/local/lib/python2.7/dist-packages/gluon/widget.py, line 26, in module import main File /usr/local/lib/python2.7/dist-packages/gluon/main.py, line 110, in module raise RuntimeError, Cannot determine web2py version RuntimeError: Cannot determine web2py version Can anyone advise whats missing? I'm running Linux Mint 14 thanks Mike -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: No module named plural_rules errro after upgrade
I downloaded the latest zip file from the web site and unzipped it to /usr/share/web2py folder (after deleting the old copy that had been there) On Sunday, 9 June 2013 20:53:57 UTC+1, Niphlod wrote: what did you use to upgrade your installation ? On Sunday, June 9, 2013 9:40:43 PM UTC+2, mike dawson wrote: Hi guys new user here I just upgraded my folder at /usr/share/web2py to new version: Version 2.5.1-stable+timestamp.2013.06.06.15.39.19 and I'm getting this startup error Terminal output /usr/share/web2py $ python web2py.py WARNING:root:Unable to import plural rules: No module named plural_rules Traceback (most recent call last): File web2py.py, line 18, in module import gluon.widget File /usr/local/lib/python2.7/dist-packages/gluon/widget.py, line 26, in module import main File /usr/local/lib/python2.7/dist-packages/gluon/main.py, line 110, in module raise RuntimeError, Cannot determine web2py version RuntimeError: Cannot determine web2py version Can anyone advise whats missing? I'm running Linux Mint 14 thanks Mike -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: mod_rewrite problems on Apache
I had a similar problem when I recently did a setup with Web2py and Apache which I did not want to dedicate to the directory root of the web server. The part I had to modify to get it to work was: WSGIScriptAlias / /var/www/web2py/wsgihandler.py with: WSGIScriptAliasMatch ^/myapp.* /var/www/web2py/wsgihandler.py WSGIScriptAliasMatch ^/admin.* /var/www/web2py/wsgihandler.py I'm not sure if this is the best solution, but it worked for me :) //Jon On Saturday, June 8, 2013 8:06:27 PM UTC+2, thinkwell wrote: Hello everyone, I'm trying to rewrite URLs because I can't install web2py on Apache root. I'm using web2py 2.0.9 apps on CentOS 5 6 servers. I've fighting this thing for hours... I'm open to using routes.py or getting correct apache syntax. Anything to get a solution. Below is my apache file. It works fine on my CentOS 6 servers Apache Server version: Apache/2.2.15, but on CentOS 5, Server version: Apache/2.2.3 the rewrite rules never fire. I'm totally vexed. I tried using routes.py, routes_out = ((r'/(?Pany.*)', r'/w2p/\gany'),) but on one page, I'm using the FORM helper and the submit button SID links to /reporter/controller and so then Apache fires a 404. NameVirtualHost *:80 VirtualHost 10.5.7.1:80 ServerName web2py RewriteEngine on RewriteLog /var/log/httpd/rewrite_log RewriteLogLevel 9 RewriteRule ^/reporter(.*)$ /w2p/reporter$1 [PT,L] RewriteRule ^/welcome(.*)$ /w2p/welcome$1 [PT,L] WSGIScriptAlias /w2p /opt/sap/www/web2py/wsgihandler.py Directory /opt/sap/www/web2py/ AllowOverride None Order Allow,Deny Deny from all Files wsgihandler.py Allow from all /Files /Directory AliasMatch ^/([^/]+)/static/(.*) \ /opt/sap/www/web2py/applications/$1/static/$2 Directory /opt/sap/www/web2py/applications/*/static/ Order Allow,Deny Allow from all /Directory Location /admin Deny from all /Location LocationMatch ^/([^/]+)/appadmin Deny from all /LocationMatch /VirtualHost Any suggestions or help for me? TIA! Dave -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Error on start: 'Auth' object has no attribute 'wikimenu'
Thanks Alan, That worked. One question. When I upload my application(*.wp) file to pythonanywhere is it my web2py version which gets used? I was under the impression that the site runs its own web2py. Any way, thanks for your answer again. On Sun, Jun 9, 2013 at 9:14 AM, Alan Etkin spame...@gmail.com wrote: I built an application and uploaded the same to pythonanywhere.com using its admin interface for web2py. I am also having the same problem. It should be enough to upgrade your web2py version to solve this. However, if you don't want to upgrade, open app/models/menu.py with a text editor (or edit the file from the admin app) and comment the last line: # if auth in locals(): auth.wikimenu() -- --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/WMtCsS5zfww/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] does redirect acts like return?
just a question if I have this code: def test(var): if var: redirect('x') other code... return if I do test(true) will other code run or the function just exits? thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: does redirect acts like return?
well, just to understand better lets say I have this: def test(var): if var: redirect('x') other code... return def test2(): Em domingo, 9 de junho de 2013 18h53min41s UTC-3, André Kablu escreveu: just a question if I have this code: def test(var): if var: redirect('x') other code... return if I do test(true) will other code run or the function just exits? thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Error on start: 'Auth' object has no attribute 'wikimenu'
is it my web2py version which gets used? My bad, I meant the web2py instance in pythonanywhere -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] PostgreSQL: duplicate key value...
I'm aware this might be rather a postgresql question but maybe someone knows how to deal with it. I defined 'city' table db.define_table('city', Field('id', length=8), Field('country', length=2, unique=True), Field('region', length=3), Field('url', length=50), Field('name', length=50), Field('latitude', 'double'), Field('longitude', 'double'), format=lambda r: r.name ) The table is empty and I'm trying to import data from CSV file using web2py's appadmin (the CSV provides IDs also, so the field had to be declared direclty in the table definition). Every time I import the file I get the following error: *duplicate key value violates unique constraint city_country_key'* * * I found many similar problems on the net and one of the reasons causing this error was lack of sync between (in my case) 'city' and 'city_id_seq'. However the sync seems to be OK, because: A. select max(id) from city; -- returns nothing (the table 'city' is empty as I wrote) B. select nextval('city_id_seq'); -- returns an integer value So the result of B. the result of A. which would suggest it's not a sync problem. I've been fighting with this all day. If someone knows what's going on, please let me know. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Combining rows
Hi, How an I do intersection? The manual says: Row objects can be combined at the Python level. Here we assume: print rows1 person.name Max Tim print rows2 person.name John Tim You can do a union of the records in two set of rows: rows3 = rows1 rows2 print rows3 name Max Tim John Tim You can do a union of the records removing duplicates: rows3 = rows1 | rows2 print rows3 name Max Tim John Regards, Ashraf -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: does redirect acts like return?
As explained in the docshttp://web2py.com/books/default/chapter/29/04#HTTP-and-redirect, redirect() is just a shortcut for raise HTTP(303, ...), which is an exception, so control immediately moves from your app code back to the framework (which catches exceptions and acts accordingly). Anthony On Sunday, June 9, 2013 5:55:53 PM UTC-4, André Kablu wrote: well, just to understand better lets say I have this: def test(var): if var: redirect('x') other code... return def test2(): test(True) other code 2 will test2 run other code or other code2? Em domingo, 9 de junho de 2013 18h53min41s UTC-3, André Kablu escreveu: just a question if I have this code: def test(var): if var: redirect('x') other code... return if I do test(true) will other code run or the function just exits? thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: changing class of a custom form not working
This works fine for defining another class like: input id=test class=input-small type=text value= name=test But not for defining size manually like: input id=test size=30 type=text value= name=test I think any CSS rule will take precedence over the size attribute, so that's not going to work unless we decide not to use any base CSS at all. Anyway, you should probably be using CSS rather than the size attribute -- that's what CSS is for. Anthony -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: web2canvas looks nice
Hello guys, I'm the one responsible for this project, I intend to make it multi language, is currently only in Portuguese. 2013/6/8 samuel bonilla pythonn...@gmail.com Alan solo me gusta la aplicación, me parece interesante. El 09/06/2013 08:32, Alan Etkin spame...@gmail.com escribió: wowww. nice LOL Do you like it or it makes you laugh? (or both?) Both is fine, although rare. -- --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/rfyhvXxtGcY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- ** * * *Gustavo de Souza Lima* gust...@agenciax4.com.br DESENVOLVEDOR *(21) 2423-4351* (escritório) *(21) 8163-0309* (celular) Twitter: @dodilei https://twitter.com/dodilei Google+: gplus.to/dodilei tech4noobs.agenciax4.com.br/ -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] http://web2py.com/plugins is broken
subj. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] authenticate against a secondary users table
Hello. In a situation with two (or more) groups of users, for instance in an application where companies post jobs, and job seekers search for jobs, if I have two separate tables for companies and job seekers, how can I use the authentication that is shipped with with web2py? Users sign up to the website as either a job seeker, or a company, but I'd like to have one input form for their login (The application needs to check against both tables). Any help would be appreciated. Thanks. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Combining rows
You can do this: rows = [row for row in row1 if not row.id in row2.as_dict()] On Sunday, 9 June 2013 18:15:03 UTC-5, webpypy wrote: Hi, How an I do intersection? The manual says: Row objects can be combined at the Python level. Here we assume: print rows1person.name Max Tim print rows2person.name John Tim You can do a union of the records in two set of rows: rows3 = rows1 rows2 print rows3 name Max Tim John Tim You can do a union of the records removing duplicates: rows3 = rows1 | rows2 print rows3 name Max Tim John Regards, Ashraf -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] requires_login() not working for second instance of auth
I build a application that have 2 AUTH objects... I use 1 Auth object for the main site functionality that contains many levels of users (using default tablename settings for auth) and I made 1 more Auth table to use as SITE ADMIN, just to control main site admin functions on a separated controller... so I did: auth_admin = Auth(db) auth_admin.settings.table_user_name = 'auth_admin_user' auth_admin.settings.table_group_name = 'auth_admin_group' auth_admin.settings.table_membership_name = 'auth_admin_membership' auth_admin.settings.table_permission_name = 'auth_admin_permission' auth_admin.settings.table_event_name = 'auth_admin_event' auth_admin.define_tables(username=False, signature=False) auth_admin.settings.actions_disabled.append('register') auth = Auth(db) auth.define_tables(username=False, signature=False) this is working fine with main auth but when I created the ADMIN controller with main site admin functions (using auth_admin), the requires_login decorator is not working: this is the index code of the ADMIN controller: @auth_admin.requires_login() def index(): return dict(message='Admin Panel') however the @auth_admin.requires_login is enabling auth users to login... and not just auth_admin users someone can help to know what am I doing wrong? Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: authenticate against a secondary users table
The Auth system is really designed to have one instance (and one auth_user table) per application. You best bet is probably to use a single user table and just add a user_type field indicating the type of user. If you need different profile fields for each type, you can include all the fields in the table and selectively set the readable/writable attributes of the fields depending on the type of user (you can also have separate linked tables for each user type). You'll need to do some customizing of the registration and profile actions to deal with the different groups. Another option is to create a separate app to handle the registration and authentication of one of the groups and use CAShttp://web2py.com/books/default/chapter/29/09#Central-Authentication-Service . Anthony On Sunday, June 9, 2013 10:48:54 PM UTC-4, shartha wrote: Hello. In a situation with two (or more) groups of users, for instance in an application where companies post jobs, and job seekers search for jobs, if I have two separate tables for companies and job seekers, how can I use the authentication that is shipped with with web2py? Users sign up to the website as either a job seeker, or a company, but I'd like to have one input form for their login (The application needs to check against both tables). Any help would be appreciated. Thanks. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: requires_login() not working for second instance of auth
You can't create two instances of Auth in the same db without renaming all the Auth tables (otherwise, both instances will simply be accessing the same set of tables). Another problem is that upon login, Auth stores the user record and login information in session.auth -- so if you login with one Auth, you'll get a session.auth, which will make the other Auth think you are logged in to that one as well. Basically, you'll have to stick with one Auth per app. For alternative approaches, see https://groups.google.com/d/msg/web2py/4LfJ9TotypE/GcmKXw0NgX4J. Anthony On Sunday, June 9, 2013 11:10:41 PM UTC-4, André Kablu wrote: I build a application that have 2 AUTH objects... I use 1 Auth object for the main site functionality that contains many levels of users (using default tablename settings for auth) and I made 1 more Auth table to use as SITE ADMIN, just to control main site admin functions on a separated controller... so I did: auth_admin = Auth(db) auth_admin.settings.table_user_name = 'auth_admin_user' auth_admin.settings.table_group_name = 'auth_admin_group' auth_admin.settings.table_membership_name = 'auth_admin_membership' auth_admin.settings.table_permission_name = 'auth_admin_permission' auth_admin.settings.table_event_name = 'auth_admin_event' auth_admin.define_tables(username=False, signature=False) auth_admin.settings.actions_disabled.append('register') auth = Auth(db) auth.define_tables(username=False, signature=False) this is working fine with main auth but when I created the ADMIN controller with main site admin functions (using auth_admin), the requires_login decorator is not working: this is the index code of the ADMIN controller: @auth_admin.requires_login() def index(): return dict(message='Admin Panel') however the @auth_admin.requires_login is enabling auth users to login... and not just auth_admin users someone can help to know what am I doing wrong? Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] how to do a google search
Hi all, I am new to Python and have a simple question. I have created a very simple web form. I'd like to add a search button that takes whatever the user inputs in the form and performs a google search query, and perhaps returns the top 5 links into a text file to the user. How difficult is this? Do I need a Google API plugin? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: requires_login() not working for second instance of auth
Thanks again Anthony! It is a good alternative. .. However It would be very good if we could use 2 auth... As you can see I'd changed table names... I'll study auth class in deep to see if i can extend it and change some function to make it accept some parameter so it would be possible to set what session to use... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Combining rows
Hi Massimo, I think there is no 'not'. am I right? Regards, Ashraf -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Combining rows
locs=[row for row in dept_locs if row.id in todept_locs as_dict()] is invalid syntax. what is the problem? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.