Re: [web2py] Re: Online Book Typo
On Wednesday, November 9, 2011 1:58:56 AM UTC-5, viniciusban wrote: I think only texts are sufficient. We can send patches to Massimo (or somebody else) merge them in. Without the book app, it's very difficult to see how your edits will look. Not a big deal for minor edits, but difficult for more substantial editing like adding new sections or re-organizing content. Anthony
Re: [web2py] Re: new web site
cool
[web2py] SQLFORM grid Authentication.
can we put some sort of authentication on sqlform grid on the basis of membership so that the user can perform specified operation for which the user is allowed. thanks
[web2py] I can not pass an instance of DAL through other instances and use reference type?
Hello, I'm trying to reach a new development model with web2py, and my goal is an application without models. (or almost no models) why? Well, not always want to have db, auth, all tables defined in the db, for example, where an ajax request is my intention to pass an ID and perform a static function that does not need any of that, I would still have to load db , auth, etc.. I so not want to use conditional models (subfolders) because I find more easily to manage imports on top of my controllers or even inside my actions only when it is needed. Now with the use of current object it seems easier to avoid models, I'm almost there! but still encounter problems, follows: Imagine that the app has no file on models and all is contained in modules. - modules/custom.py *from gluon import DAL class DataBase(DAL): def __init__(self): DAL.__init__(self, uri=, migrate_enabled=True,...,...,...,..) * In the above module define an extension of DAL that creates an object of the type DAL with all params setted I know it is not very recommended to extend DAL in this way, but I want a ready and done db just to import without the need to pass params everytime, and I already tested defining the db = DAL() in models/0.py which does not works too, raises the same error. modules/datamodel/article.py *class Article(object): ** def __init__(self, db): ** self.db = db ** self.define_table()* *self*.*set_validators()* * ** def define_table(self):* *from gluon.dal import Field* *** self.entity = self.db.define_table(article, ** Field(title), ** Field(category, reference category) # if I change it to integer everything works fine ** )* * def set_validators(self): * *from gluon.validators import IS_IN_DB* * self.entity.category.requires = IS_IN_DB(self.db, category.id)* In the above module defines the object instance that will receive the article DAL - Modules / datamodel / category.py *class Category(object): **def __init__(self, db): **self.db = db **self.define_table()* * **def define_table(self): **self.entity = self.db.define_table(category, Field(name))* My intention is to import everything I need in the top of controllers so in controller/appadmin.py I have in the first lines. *from custom import DataBase **from datamodel.article import Article **from datamodel.category import Category** **db = DataBase() **category = Category(db) **article = Article(db)* * **def test_function(): ** return SQLFORM(article.entity).process()* Why not work? I always get the message *Can not operate in a closed database(SQLITE)* or *Cursor already been closed(POSTGRES)* if I remove reference type from my Fields, it works very well, and I am planning to work only with integers as references if it cannot be solved. The real code is in: https://github.com/rochacbruno/Movuca and it is a bit more complex than the example code I wrote here. (just clone it in to web2py trunk version app folder) Any hint about it? Thank you. -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] contains() subtleties on GAE
So on GAE this seems to be fine: db(db.my_table.my_set.contains([1], all=False)).select() while this: db(db.my_table.my_set.contains([1,2], all=False)).select() seems to always boil down to an OR somewhere deep bellow: File /base/data/home/apps/s~my_app/1.354557643063785927/gluon/ dal.py, line 3050, in OR def OR(self,first,second): raise SyntaxError, Not supported SyntaxError: Not supported my_set is a 'list:reference' Is the best way to treat it this: db(db.my_table.my_set.contains([1], all=False)).select() | db(db.my_table.my_set.contains([2], all=False)).select() or something else? Appreciate your help!
[web2py] SQLFORM grid Authentication.
Hii All, I am using sqlform grid and i just want to put some authentication on each some functions of grid i.e(Delete , Write) for certain groups' users I can do this by using crud.xxx() but i m unable to use authentication with sqlform grid(). regards, Naleen
Re: [web2py] SQLFORM grid Authentication.
try some like this: *def myfunction(): ** if request.args(0) in ['edit', 'new'] and not auth.has_membership('admin'): ** redirect(URL(NOT AUTHORIZED URL))** ** return dict(grid=SQLFORM.grid(.))* On Wed, Nov 9, 2011 at 8:16 AM, Naleen Yadav naleenya...@gmail.com wrote: Hii All, I am using sqlform grid and i just want to put some authentication on each some functions of grid i.e(Delete , Write) for certain groups' users I can do this by using crud.xxx() but i m unable to use authentication with sqlform grid(). regards, Naleen -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: CAS auto login for all apps
I have my CAS working properly. First, what do you mean by that? CAS works out of the box. Here is how to test the scenario *I think* you are describing: 1. From the web interface create three applications app1, app2, app3 (app1 and app2 will be consumers, app3 the CAS provider). 2. In app1 and app2 in db.py replace: auth = Auth(db, hmac_key=Auth.get_or_create_key()) with this: auth = Auth(db,cas_provider = 'http://127.0.0.1:8000/app3/default/user/ cas') 3. Go to http://localhost:8000/app3/appadmin/insert/db/auth_user and create a new user (do first, last, email, password). 4. Go to http://localhost:8000/app1/default/index and hit 'login', (it should send you to http://127.0.0.1:8000/app3/default/user/cas/login?service=http://localhost:8000/app1/default/user/login) and login with the credentials from step 3. 5. Go to http://localhost:8000/app2/default/index and hit 'login' - it should AUTOMATICALLY log you in without asking for email/password Works for me. If your consumers are not running from the same server you may have to do extra stuff but first see if the above works.
Re: [web2py] SQLFORM grid Authentication.
On Wed, Nov 9, 2011 at 3:52 PM, Bruno Rocha rochacbr...@gmail.com wrote: try some like this: *def myfunction(): ** if request.args(0) in ['edit', 'new'] and not auth.has_membership('admin'): ** redirect(URL(NOT AUTHORIZED URL))** ** return dict(grid=SQLFORM.grid(.))* On Wed, Nov 9, 2011 at 8:16 AM, Naleen Yadav naleenya...@gmail.comwrote: Hii All, I am using sqlform grid and i just want to put some authentication on each some functions of grid i.e(Delete , Write) for certain groups' users I can do this by using crud.xxx() but i m unable to use authentication with sqlform grid(). regards, Naleen Thanks Bruno Rocha for the code i tried it but its not working , i think i am lacking some where so can u give some example to correct my mistak. regards
Re: [web2py] Re: auth.settings.login_next not working on ldap authentication
Using facebook auth it works on another application... :S On Tue, Nov 8, 2011 at 2:47 PM, Tito Garrido titogarr...@gmail.com wrote: Not sure Why but it just doesn't happen anything: from gluon.contrib.login_methods.ldap_auth import ldap_auth auth.settings.login_methods=[ldap_auth(mode='company',server=' mycompany.com',base_dn='ou=myou,o=mycompany.com')] auth.settings.actions_disabled=['register','change_password','request_reset_password','profile'] auth.settings.remember_me_form = False auth.settings.login_next = URL('default','get_mygroups') Can't see nothing wrong... On Tue, Nov 8, 2011 at 1:46 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: How? On Nov 8, 7:04 am, Tito Garrido titogarr...@gmail.com wrote: Hi folks! I'm trying to redirect to a different page after login using ldap authentication but it just sends me to index... is it a bug? Regards, Tito -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___
Re: [web2py] Re: sqlform.grid
You can't pass vars, you have to use args instead. I think we need to find a solution to this. 2011/11/8 JmiXIII sylvn.p...@gmail.com Sorry I open a new discussion -- http://martin.tecnodoc.com.ar
[web2py] Re: Mixing/supporting CMS with Web2py
On Tue, 8 Nov 2011 11:43:40 -0300 Ovidio Marinho ovidio...@gmail.com wrote: Here is what you are looking for https://github.com/lucasdavila/web2py-cms I'm not sure it's good or robust enough for the users needs expressed here. Otoh, we hope that Massimo will provide his $.02 when he finishes with the current tasks... Sincerely, Gour -- But a person free from all attachment and aversion and able to control his senses through regulative principles of freedom can obtain the complete mercy of the Lord. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 signature.asc Description: PGP signature
[web2py] Issue Tracker and web interface for Mercurial
Hello Web2py. Recently we had a lot of talk about web2py based Trac-like app for Mercurial. Anyone implemented it? What is mercurial inside web2py ? admin/views/mercurial Thanks. Phyo.
[web2py] Re: SQLFORM grid Authentication.
Have you tried something like: SQLFORM.grid(..., editable=auth.has_membership('editor_group'), deletable=auth.has_membership('delete_group'), user_signature=True) Anthony On Wednesday, November 9, 2011 5:16:10 AM UTC-5, Naleen Yadav wrote: Hii All, I am using sqlform grid and i just want to put some authentication on each some functions of grid i.e(Delete , Write) for certain groups' users I can do this by using crud.xxx() but i m unable to use authentication with sqlform grid(). regards, Naleen
[web2py] Re: CAS auto login for all apps
Thank you :) 'CAS is working properly' by my little understanding is I'm able to login to each app with one single id, though I have to manually provide credentials data once again to each app. I've followed your sample and it works. Then I change the adapter to MySQL. Setting up all DAL to refer to one single database. I go to http://127.0.0.1:8000/app1/default/index and I get InternalError: (1050, uTable 'auth_user' already exists). So I set auth.define_tables(migrate=False) of the consumers and am able to enter app1/default/index. I click login then I get InternalError: (1054, uUnknown column 'auth_user.username' in 'field list'). What do I miss here? Thank you again.
[web2py] Mongodb - inserts working-but some comments on the code are welcome
Hi, MongoDB users I currently working on the mongoDB adapter, but I need some feed back. http://code.google.com/p/web2py/issues/list Issue 497,499 and 500 will make the inserts in mongodb possible. But I'm from origin a C# programmer and not used to programming in python. So maybe that some of the solutions I propose need to be written a bit different. I have seen a few testers here, so comments are welcome. Mark Breedveld, Student at University of Rotterdam,
[web2py] Re: CAS auto login for all apps
On Wednesday, November 9, 2011 8:44:39 AM UTC-5, Cahya Dewanta wrote: I've followed your sample and it works. Then I change the adapter to MySQL. Setting up all DAL to refer to one single database. With CAS each app should have its own db with its own Auth tables. The auth_user data from the provider app will be copied to the consumer app. See the documentation: http://web2py.com/book/default/chapter/08#Central-Authentication-Service. Anthony
Re: [web2py] new web site
Looks great! It should be clear what the Awarded the best... is. Perhaps using http://www.infoworld.com/sites/infoworld.com/files/imagecache/slideshow_slide/media/image/36SS-bossies-2011-web2py.jpg or linking to InfoWorld. Miguel
Re: [web2py] new web site
On Wednesday, November 9, 2011 10:01:31 AM UTC-5, miguel wrote: Looks great! It should be clear what the Awarded the best... is. Perhaps using http://www.infoworld.com/sites/infoworld.com/files/imagecache/slideshow_slide/media/image/36SS-bossies-2011-web2py.jpg Already done. We'll have a new cleaned up version up soon. Anthony
[web2py] Re: CAS auto login for all apps
Yes, the fact that your applications are sharing a DB connection already means that you don't need CAS. Can you describe what you are trying to do?
Re: [web2py] Re: SQLFORM grid Authentication.
Anthony This is fantastic. I too was looking for a way to do this but this didn't occur to me. Works great. -Jim On 11/9/2011 7:27 AM, Anthony wrote: Have you tried something like: SQLFORM.grid(..., editable=auth.has_membership('editor_group'), deletable=auth.has_membership('delete_group'), user_signature=True) Anthony On Wednesday, November 9, 2011 5:16:10 AM UTC-5, Naleen Yadav wrote: Hii All, I am using sqlform grid and i just want to put some authentication on each some functions of grid i.e(Delete , Write) for certain groups' users I can do this by using crud.xxx() but i m unable to use authentication with sqlform grid(). regards, Naleen
[web2py] Suggestion for online book usability
I've said it before, but it bears repeating: the documentation for web2py is fantastic. One thing that might improve the usability of the online documentation is to make the table of contents a fixed pane that moves with the reader as they scroll. This would save many trips back up to the top of the page to navigate the book. This would be as simple as changing the css to position:fixed (OK, I know, there would be more css tweaking involved, but it's pretty simple). The nice thing about this approach is that if a browser lacks fixed positioning the TOC would just stay where it is -- i.e., easy fallback to the current layout. A slightly more involved improvement would be to make that left-hand TOC dynamically expandable. Of course this will involve some js, but it is again a pretty basic operation and in combination with the fixed TOC pane it would make that documentation infinitely more convenient to use. I should say, by the way, that I also own a pdf copy of the web2py book. But I generally use the web version because it's so much more up-to-date. When another pdf version comes out I'll buy it in order to support the platform and Massimo. So I hope there's no fear that better online nav will cut into pdf sales. Cheers.
Re: [web2py] new web site
+1 very good Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/11/6 Massimo Di Pierro massimo.dipie...@gmail.com We have a new web site http://web2py.com/new_examples Please check it out before we replace the old one.
[web2py] Re: login form errors
Perhaps someone who knows more about the core will chime in. Failing that, maybe this will put you on the scent ... In db.py there should be a line something like auth=Auth(db), which comes after 'from gluon.tools import ... auth .. So the Auth class is in gluon/tools.py. Auth contains the login methods. Looking at one named 'basic' I see it returns False on login failure. Where the call to 'basic' originates I do not know, but I suspect the caller handles the redirection and flash messaging. You might be able to find the caller by grepping for the text of the failed login message. You have investigated response.flash, right? On Nov 8, 9:09 pm, Matt Broadstone mbroa...@gmail.com wrote: When I looked at how the generated sample app handled showing that there was an error with logging in, it showed the message in a flash area in the view. To be clear here: the controller is a two-liner: def user(): return dict(form=auth()) so there is no setup in the controller, as it relates to flash at least. This lead me to believe that whatever is going on in the creation of the auth form, it places errors into the session.flash variable, and I figured I could just add that to my view and the error would show up. This was not the case. What I'm really asking here is how to access that error information. It doesn't appear in session.flash, it doesn't appear in form.errors. Matt On Tue, Nov 8, 2011 at 5:08 PM, Cliff cjk...@gmail.com wrote: Is there a div with the id of 'flash' in your view? On Nov 8, 11:14 am, Matt mbroa...@gmail.com wrote: Greetings, We are currently experiencing an issue with invalid logins not showing errors. For auth we are using a combination of basic auth and PAM, and the actual controller/view combo for the login form is basically the same as the generated scaffolding. When an invalid username/password is entered the page simply reloads without any indication of what the error was. I tried to display the flash (we are not currently using the session flash, so this had to be added to this page) and that has no info in it, I have also tried to display auth.login_form()'s errors, which do not exist either. Is there some way to get this information? Thank you, Matt
[web2py] Re: new web site
I like it, too. On Nov 9, 12:21 pm, Ovidio Marinho ovidio...@gmail.com wrote: +1 very good Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/11/6 Massimo Di Pierro massimo.dipie...@gmail.com We have a new web site http://web2py.com/new_examples Please check it out before we replace the old one.
[web2py] typo book chapter 2
a = 1 # reset a def g(b): a = 2 # creates a new local a return b + 2 # change this to:return b + a
[web2py] Re: CAS auto login for all apps
Hello Anthony. I begin to think that I do the wrong approach for my system. In my understanding, 3 different databases would make 3 different user registrations. Is it?
Re: [web2py] new web site
I`m Start new web2py and view this http://awesomescreenshot.com/0cco09he0 Why? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/11/6 Massimo Di Pierro massimo.dipie...@gmail.com We have a new web site http://web2py.com/new_examples Please check it out before we replace the old one.
[web2py] Re: CAS auto login for all apps
pepper_bg, my project is exactly the same with your samples above except I'm using MySQL. I have 3 apps and one registration should be enough to access those all apps. I try to avoid different registrations and different logins. One login, one username for all. What approach should I do then?
[web2py] Re: new web site
Massimo, I like the new site's look and feel. I kind of agree with JMIXIII about the 'what' page. If you like I will take a shot at editing the page. It will not be today, though. This will probably be the coming weekend's work. Let me know if you want me to do this. On Nov 6, 3:02 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: We have a new web site http://web2py.com/new_examples Please check it out before we replace the old one.
[web2py] Re: web2py with twitter bootstrap - very clean interface ...
On Sep 26, 5:43 pm, Bruno Rocha rochacbr...@gmail.com wrote: We are planning to include it in the next web2py version. I will share the actual w2p after a clean up. Hi, does anybody know if the twitter-bootstrap integration code is available for web2py yet? The one shown here: http://labs.blouweb.com/bootstrap/ I was about to embark on some web2py work that requires twitter- bootstrap, but I wasn't sure if this was available yet. Thanks, David
[web2py] Re: CAS auto login for all apps
One login, one username for all. What approach should I do then? You seem to be already on the right track: 1. Make your applications share a DB. You are already doing this auth.define_tables(migrate=False). Debug that error you are getting or post here the complete trace. 2. Make them share sessions via the DB, read around this line session.connect(request, response, db, masterapp=None) here http://web2py.com/book/default/chapter/04#session Read just to have an idea what you are doing - http://web2py.com/book/default/chapter/08#Customizing-Auth
[web2py] Re: web2py with twitter bootstrap - very clean interface ...
Sorry, I found it: http://groups.google.com/group/web2py-developers/browse_thread/thread/d9c3698044c4902f/8eb26098b55388d3?lnk=gstq=bootstrap#8eb26098b55388d3 On Nov 9, 12:47 pm, David Watson davidthewat...@gmail.com wrote: On Sep 26, 5:43 pm, Bruno Rocha rochacbr...@gmail.com wrote: We are planning to include it in the next web2py version. I will share the actual w2p after a clean up. Hi, does anybody know if the twitter-bootstrap integration code is available for web2py yet? The one shown here: http://labs.blouweb.com/bootstrap/ I was about to embark on some web2py work that requires twitter- bootstrap, but I wasn't sure if this was available yet. Thanks, David
[web2py] Detecting if a session has ended
Is there someway that I could call a function when the user ends their session?
[web2py] Re: CAS auto login for all apps
Thank you. I'll get your directions and will post the result to inform.
Re: [web2py] Re: web2py with twitter bootstrap - very clean interface ...
It totally rocks! 2011/11/9 David Watson davidthewat...@gmail.com: Sorry, I found it: http://groups.google.com/group/web2py-developers/browse_thread/thread/d9c3698044c4902f/8eb26098b55388d3?lnk=gstq=bootstrap#8eb26098b55388d3 On Nov 9, 12:47 pm, David Watson davidthewat...@gmail.com wrote: On Sep 26, 5:43 pm, Bruno Rocha rochacbr...@gmail.com wrote: We are planning to include it in the next web2py version. I will share the actual w2p after a clean up. Hi, does anybody know if the twitter-bootstrap integration code is available for web2py yet? The one shown here: http://labs.blouweb.com/bootstrap/ I was about to embark on some web2py work that requires twitter- bootstrap, but I wasn't sure if this was available yet. Thanks, David -- Profile: http://www.gild.com/compagnucciangelo Register on Gild: http://www.gild.com/referral/compagnucciangelo
[web2py] Download file and redirect (or redirect and auto-download file)
I'm afraid I'm missing something very basic here. When a user clicks a link to download a file, how to start the download after directing to the thank-you page? I can do either, but have not figured out how to do both. Obviously, this won't work, but the desired behavior is something like this. controller def thank_you(): file = request.args[0] downloader_function(file) # response in downloader_function terminates thank_you function message = 'file downloaded' return dict(message = message) session.flash should work for a short message, but I would like a page. My attempts at LOAD() have resulted in the download file appearing in the created div, not downloading. Thanks
[web2py] Re: I can not pass an instance of DAL through other instances and use reference type?
Do you have a complete traceback? On Nov 9, 4:04 am, Bruno Rocha rochacbr...@gmail.com wrote: Hello, I'm trying to reach a new development model with web2py, and my goal is an application without models. (or almost no models) why? Well, not always want to have db, auth, all tables defined in the db, for example, where an ajax request is my intention to pass an ID and perform a static function that does not need any of that, I would still have to load db , auth, etc.. I so not want to use conditional models (subfolders) because I find more easily to manage imports on top of my controllers or even inside my actions only when it is needed. Now with the use of current object it seems easier to avoid models, I'm almost there! but still encounter problems, follows: Imagine that the app has no file on models and all is contained in modules. - modules/custom.py *from gluon import DAL class DataBase(DAL): def __init__(self): DAL.__init__(self, uri=, migrate_enabled=True,...,...,...,..) * In the above module define an extension of DAL that creates an object of the type DAL with all params setted I know it is not very recommended to extend DAL in this way, but I want a ready and done db just to import without the need to pass params everytime, and I already tested defining the db = DAL() in models/0.py which does not works too, raises the same error. modules/datamodel/article.py *class Article(object): ** def __init__(self, db): ** self.db = db ** self.define_table()* *self*.*set_validators()* * ** def define_table(self):* *from gluon.dal import Field* *** self.entity = self.db.define_table(article, ** Field(title), ** Field(category, reference category) # if I change it to integer everything works fine ** )* * def set_validators(self): * *from gluon.validators import IS_IN_DB* * self.entity.category.requires = IS_IN_DB(self.db, category.id)* In the above module defines the object instance that will receive the article DAL - Modules / datamodel / category.py *class Category(object): ** def __init__(self, db): ** self.db = db ** self.define_table()* * ** def define_table(self): ** self.entity = self.db.define_table(category, Field(name))* My intention is to import everything I need in the top of controllers so in controller/appadmin.py I have in the first lines. *from custom import DataBase **from datamodel.article import Article **from datamodel.category import Category** **db = DataBase() **category = Category(db) **article = Article(db)* * **def test_function(): ** return SQLFORM(article.entity).process()* Why not work? I always get the message *Can not operate in a closed database(SQLITE)* or *Cursor already been closed(POSTGRES)* if I remove reference type from my Fields, it works very well, and I am planning to work only with integers as references if it cannot be solved. The real code is in:https://github.com/rochacbruno/Movucaand it is a bit more complex than the example code I wrote here. (just clone it in to web2py trunk version app folder) Any hint about it? Thank you. -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: Mixing/supporting CMS with Web2py
Any screenshots? On Nov 9, 5:58 am, Gour g...@atmarama.net wrote: On Tue, 8 Nov 2011 11:43:40 -0300 Ovidio Marinho ovidio...@gmail.com wrote: Here is what you are looking for https://github.com/lucasdavila/web2py-cms I'm not sure it's good or robust enough for the users needs expressed here. Otoh, we hope that Massimo will provide his $.02 when he finishes with the current tasks... Sincerely, Gour -- But a person free from all attachment and aversion and able to control his senses through regulative principles of freedom can obtain the complete mercy of the Lord. http://atmarama.net| Hlapicina (Croatia) | GPG: 52B5C810 signature.asc 1KViewDownload
[web2py] Re: SQLFORM grid Authentication.
+1 On Nov 9, 7:27 am, Anthony abasta...@gmail.com wrote: Have you tried something like: SQLFORM.grid(..., editable=auth.has_membership('editor_group'), deletable=auth.has_membership('delete_group'), user_signature=True) Anthony On Wednesday, November 9, 2011 5:16:10 AM UTC-5, Naleen Yadav wrote: Hii All, I am using sqlform grid and i just want to put some authentication on each some functions of grid i.e(Delete , Write) for certain groups' users I can do this by using crud.xxx() but i m unable to use authentication with sqlform grid(). regards, Naleen
[web2py] Re: typo book chapter 2
thanks. On Nov 9, 11:29 am, Herman herman...@gmail.com wrote: a = 1 # reset a def g(b): a = 2 # creates a new local a return b + 2 # change this to: return b + a
[web2py] Re: Detecting if a session has ended
Sessions never end. Do you want to detect logout? auth.settings.logout_onlogout = lambda user: do_something_with(user) On Nov 9, 11:58 am, Sathvik Ponangi psath...@gmail.com wrote: Is there someway that I could call a function when the user ends their session?
[web2py] Active Directory Authentication and Apache
First of all, I'm really sorry to be posting this question to web2py- users. I know it's really an Apache configuration question, but I'm hoping someone here might be able to help. I have LDAP authentication against our Active Directory server working in my web2py apps. The configuration was very easy and it worked almost right out of the box: from gluon.contrib.login_methods.ldap_auth import ldap_auth auth.settings.login_methods.append(ldap_auth(mode='ad', server='acfmsdc02.gpo.gov', base_dn='dc=gpo,dc=gov')) However, I can't get Apache to authenticate against the AD server. Here are the relevant configuration directives: AuthBasicProvider ldap AuthType Basic AuthzLDAPAuthoritative on AuthName PED LDAP Test AuthLDAPURL ldap://acfmsdc02.gpo.gov:3268/DC=gpo,DC=gov? sAMAccountName?sub?(objectClass=*) NONE I get an internal server error when I try to reach any pages covered by the LDAP authentication directives. After setting LogLevel info I can see auth_ldap authenticate: user USERNAME authentication failed; URI / [ldap_search_ext_s() for user failed][Operations error] in my error log. Are there any Apache gurus out there who might be able to provide the Apache equivalent of the working web2py configuration settings? It seems like it should be simple, but I have been googling and restarting httpd for hours with no luck. Again, many apologies for posting an Apache question in the web2py group. It's just that it's working under web2py, and I've had no luck finding more information elsewhere. Thanks, Nick
Re: [web2py] Re: Detecting if a session has ended
Nice approach so I could update a custom field in auth_user and put it true or false at login and logout? How I may set my flag to true? Is there a auth.settings.login_onlogin ?? Thanks Richard On Wed, Nov 9, 2011 at 2:14 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Sessions never end. Do you want to detect logout? auth.settings.logout_onlogout = lambda user: do_something_with(user) On Nov 9, 11:58 am, Sathvik Ponangi psath...@gmail.com wrote: Is there someway that I could call a function when the user ends their session?
[web2py] Re: CAS auto login for all apps
On Wednesday, November 9, 2011 12:30:24 PM UTC-5, Cahya Dewanta wrote: Hello Anthony. I begin to think that I do the wrong approach for my system. In my understanding, 3 different databases would make 3 different user registrations. Is it? If you're using CAS, the registrations (and logins) would all happen in the provider app, but the consumer apps would also have auth_user tables -- any common fields would simply get copied over from provider to consumer.
[web2py] Re: lexical scanner
Sorry lucas, but I don't understand what you're trying to do. Can you explain further? On Nov 9, 4:53 pm, lucas sjluk...@gmail.com wrote: ok, i have done so much using this really really cool technique. anyway, how do i pass a function reference to a global storage context so that the standard views that are stored under views are rendered properly, like in the above examples? lucas
[web2py] Re: Mixing/supporting CMS with Web2py
Live site is an example http://blog.lucasdavi.la/ screenshot? try http://browsershots.org/http://blog.lucasdavi.la/ On 9 nov, 20:09, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Any screenshots? On Nov 9, 5:58 am, Gour g...@atmarama.net wrote: On Tue, 8 Nov 2011 11:43:40 -0300 Ovidio Marinho ovidio...@gmail.com wrote: Here is what you are looking for https://github.com/lucasdavila/web2py-cms I'm not sure it's good or robust enough for the users needs expressed here. Otoh, we hope that Massimo will provide his $.02 when he finishes with the current tasks... Sincerely, Gour -- But a person free from all attachment and aversion and able to control his senses through regulative principles of freedom can obtain the complete mercy of the Lord. http://atmarama.net|Hlapicina (Croatia) | GPG: 52B5C810 signature.asc 1KViewDownload
[web2py] SQLFORM.grid : formstyle, readable and writable control
Hello, I would like to know I can control generated form with SQLFORM.grid... I use to do extensively : If user and group and permission and row field value: crud.table.field.readable =\ crud.table.field.writable =False form = crud.create, read or update(db.table) And I customize my form a bit with CSS (crud.settings.formstyle = 'divs') so I would like to know if I can recycle my CSS with SQLFORM.grid?? Thanks. Richard
Re: [web2py] SQLFORM.grid : formstyle, readable and writable control
Here is a sample of one of my controllers. @auth.requires_permission('select', db.priceTemplate) def priceTemplates(): response.view='list.html' table = db.priceTemplate response.title = '%s - %s' % (response.section, table['_plural']) columns = ['priceTemplate.name', 'priceTemplate.plantId', 'priceTemplate.iwhsPosition', 'contactPriceTemplate.contactId'] # Setup Permissions editable = auth.has_permission('update', table) create = auth.has_permission('create', table) deletable = auth.has_permission('delete', table) details = auth.has_permission('read', table) orderby = dict(priceTemplate=[db.priceTemplate.name]) db.contactPriceTemplate._plural = 'Contacts' db.contactPriceTemplate.priceTemplateId.writable = False db.contactPriceTemplate.priceTemplateId.readable = False grid = SQLFORM.smartgrid(db.priceTemplate, columns=columns, orderby=orderby, create=create, details=details, editable=editable, deletable=deletable, csv=False, search_widget=None, paginate=15, maxtextlength=45) return dict(grid=grid) In it I'm setting read/write capabilities for one of the fields (notice that it isn't a field in the primary table, but a related table. I'm also using standard auth to test for permissions (thanks Anthony). I can control sorting for primary table and related tables. In looking at the method signature for SQLFORM.grid it appears that formstyle will work just like it did for CRUD. From what little I know, it would appear to me that the CSS styling is the same as CRUD so your CSS should work. SQLFORM.smartgrid is amazing. If you have your models setup properly you can get highly sophisticated CRUD forms, with relationships with very little boilerplate code. Thanks Massimo! -Jim On 11/9/2011 2:55 PM, Richard wrote: Hello, I would like to know I can control generated form with SQLFORM.grid... I use to do extensively : If user and group and permission and row field value: crud.table.field.readable =\ crud.table.field.writable =False form = crud.create, read or update(db.table) And I customize my form a bit with CSS (crud.settings.formstyle = 'divs') so I would like to know if I can recycle my CSS with SQLFORM.grid?? Thanks. Richard
Re: [web2py] SQLFORM.grid : formstyle, readable and writable control
Thank a lot Jim I will play a bit with your example... Pretty helpful... I would like to know more about the difference between grid and smartgrid... I just start to read the sqlhtml.py to understand better new grid and smartgrid... Thanks again. Richard On Wed, Nov 9, 2011 at 4:07 PM, Jim Steil j...@qlf.com wrote: Here is a sample of one of my controllers. @auth.requires_permission('**select', db.priceTemplate) def priceTemplates(): response.view='list.html' table = db.priceTemplate response.title = '%s - %s' % (response.section, table['_plural']) columns = ['priceTemplate.name', 'priceTemplate.plantId', 'priceTemplate.iwhsPosition', 'contactPriceTemplate.**contactId'] # Setup Permissions editable = auth.has_permission('update', table) create = auth.has_permission('create', table) deletable = auth.has_permission('delete', table) details = auth.has_permission('read', table) orderby = dict(priceTemplate=[db.**priceTemplate.namehttp://db.priceTemplate.name ]) db.contactPriceTemplate._**plural = 'Contacts' db.contactPriceTemplate.**priceTemplateId.writable = False db.contactPriceTemplate.**priceTemplateId.readable = False grid = SQLFORM.smartgrid(db.**priceTemplate, columns=columns, orderby=orderby, create=create, details=details, editable=editable, deletable=deletable, csv=False, search_widget=None, paginate=15, maxtextlength=45) return dict(grid=grid) In it I'm setting read/write capabilities for one of the fields (notice that it isn't a field in the primary table, but a related table. I'm also using standard auth to test for permissions (thanks Anthony). I can control sorting for primary table and related tables. In looking at the method signature for SQLFORM.grid it appears that formstyle will work just like it did for CRUD. From what little I know, it would appear to me that the CSS styling is the same as CRUD so your CSS should work. SQLFORM.smartgrid is amazing. If you have your models setup properly you can get highly sophisticated CRUD forms, with relationships with very little boilerplate code. Thanks Massimo! -Jim On 11/9/2011 2:55 PM, Richard wrote: Hello, I would like to know I can control generated form with SQLFORM.grid... I use to do extensively : If user and group and permission and row field value: crud.table.field.readable =\ crud.table.field.writable =False form = crud.create, read or update(db.table) And I customize my form a bit with CSS (crud.settings.formstyle = 'divs') so I would like to know if I can recycle my CSS with SQLFORM.grid?? Thanks. Richard
Re: [web2py] SQLFORM.grid : formstyle, readable and writable control
From what I can gather, smartgrid is the same as grid except that it will also display/work with related tables. Grid works with one table only (please correct me if I'm wrong). -Jim On 11/9/2011 3:14 PM, Richard Vézina wrote: Thank a lot Jim I will play a bit with your example... Pretty helpful... I would like to know more about the difference between grid and smartgrid... I just start to read the sqlhtml.py to understand better new grid and smartgrid... Thanks again. Richard On Wed, Nov 9, 2011 at 4:07 PM, Jim Steil j...@qlf.com mailto:j...@qlf.com wrote: Here is a sample of one of my controllers. @auth.requires_permission('select', db.priceTemplate) def priceTemplates(): response.view='list.html' table = db.priceTemplate response.title = '%s - %s' % (response.section, table['_plural']) columns = ['priceTemplate.name', 'priceTemplate.plantId', 'priceTemplate.iwhsPosition', 'contactPriceTemplate.contactId'] # Setup Permissions editable = auth.has_permission('update', table) create = auth.has_permission('create', table) deletable = auth.has_permission('delete', table) details = auth.has_permission('read', table) orderby = dict(priceTemplate=[db.priceTemplate.name http://db.priceTemplate.name]) db.contactPriceTemplate._plural = 'Contacts' db.contactPriceTemplate.priceTemplateId.writable = False db.contactPriceTemplate.priceTemplateId.readable = False grid = SQLFORM.smartgrid(db.priceTemplate, columns=columns, orderby=orderby, create=create, details=details, editable=editable, deletable=deletable, csv=False, search_widget=None, paginate=15, maxtextlength=45) return dict(grid=grid) In it I'm setting read/write capabilities for one of the fields (notice that it isn't a field in the primary table, but a related table. I'm also using standard auth to test for permissions (thanks Anthony). I can control sorting for primary table and related tables. In looking at the method signature for SQLFORM.grid it appears that formstyle will work just like it did for CRUD. From what little I know, it would appear to me that the CSS styling is the same as CRUD so your CSS should work. SQLFORM.smartgrid is amazing. If you have your models setup properly you can get highly sophisticated CRUD forms, with relationships with very little boilerplate code. Thanks Massimo! -Jim On 11/9/2011 2:55 PM, Richard wrote: Hello, I would like to know I can control generated form with SQLFORM.grid... I use to do extensively : If user and group and permission and row field value: crud.table.field.readable =\ crud.table.field.writable =False form = crud.create, read or update(db.table) And I customize my form a bit with CSS (crud.settings.formstyle = 'divs') so I would like to know if I can recycle my CSS with SQLFORM.grid?? Thanks. Richard
[web2py] Re: Detecting if a session has ended
They are usually called auth.settings.login_onaccept = lambda form: .. auth.settings.profile_onaccept = lambda form: .. auth.settings.method_onaccept = lambda form: .. and they all take the form. the name exception is auth.settings.logout_onlogout - lambda user: ... because there is no form to fill on logout but there is a user. On Nov 9, 1:37 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Nice approach so I could update a custom field in auth_user and put it true or false at login and logout? How I may set my flag to true? Is there a auth.settings.login_onlogin ?? Thanks Richard On Wed, Nov 9, 2011 at 2:14 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Sessions never end. Do you want to detect logout? auth.settings.logout_onlogout = lambda user: do_something_with(user) On Nov 9, 11:58 am, Sathvik Ponangi psath...@gmail.com wrote: Is there someway that I could call a function when the user ends their session?
[web2py] Re: SQLFORM.grid : formstyle, readable and writable control
grid takes any query (even a join) smartgrid takes a table but (can) follow linked tables (no joins). On Nov 9, 3:19 pm, Jim Steil j...@qlf.com wrote: From what I can gather, smartgrid is the same as grid except that it will also display/work with related tables. Grid works with one table only (please correct me if I'm wrong). -Jim On 11/9/2011 3:14 PM, Richard V�zina wrote: Thank a lot Jim I will play a bit with your example... Pretty helpful... I would like to know more about the difference between grid and smartgrid... I just start to read the sqlhtml.py to understand better new grid and smartgrid... Thanks again. Richard On Wed, Nov 9, 2011 at 4:07 PM, Jim Steil j...@qlf.com mailto:j...@qlf.com wrote: Here is a sample of one of my controllers. @auth.requires_permission('select', db.priceTemplate) def priceTemplates(): response.view='list.html' table = db.priceTemplate response.title = '%s - %s' % (response.section, table['_plural']) columns = ['priceTemplate.name', 'priceTemplate.plantId', 'priceTemplate.iwhsPosition', 'contactPriceTemplate.contactId'] # Setup Permissions editable = auth.has_permission('update', table) create = auth.has_permission('create', table) deletable = auth.has_permission('delete', table) details = auth.has_permission('read', table) orderby = dict(priceTemplate=[db.priceTemplate.name http://db.priceTemplate.name]) db.contactPriceTemplate._plural = 'Contacts' db.contactPriceTemplate.priceTemplateId.writable = False db.contactPriceTemplate.priceTemplateId.readable = False grid = SQLFORM.smartgrid(db.priceTemplate, columns=columns, orderby=orderby, create=create, details=details, editable=editable, deletable=deletable, csv=False, search_widget=None, paginate=15, maxtextlength=45) return dict(grid=grid) In it I'm setting read/write capabilities for one of the fields (notice that it isn't a field in the primary table, but a related table. I'm also using standard auth to test for permissions (thanks Anthony). I can control sorting for primary table and related tables. In looking at the method signature for SQLFORM.grid it appears that formstyle will work just like it did for CRUD. From what little I know, it would appear to me that the CSS styling is the same as CRUD so your CSS should work. SQLFORM.smartgrid is amazing. If you have your models setup properly you can get highly sophisticated CRUD forms, with relationships with very little boilerplate code. Thanks Massimo! -Jim On 11/9/2011 2:55 PM, Richard wrote: Hello, I would like to know I can control generated form with SQLFORM.grid... I use to do extensively : If user and group and permission and row field value: crud.table.field.readable =\ crud.table.field.writable =False form = crud.create, read or update(db.table) And I customize my form a bit with CSS (crud.settings.formstyle = 'divs') so I would like to know if I can recycle my CSS with SQLFORM.grid?? Thanks. Richard
[web2py] Re: SQLFORM.grid : formstyle, readable and writable control
In grid you can also do ... if 'new' in request.args: db.sometable.is_active.readable =\ db.sometable.is_active.writable =\ False query=db.othertable.otherfield==avalue db.sometable.foreign_key.requires =\ IS_IN_DB(db(query), 'othertable.otherfield' ...) # even more # for those times when the grid default form isn't sufficient form = SQLFORM(db.sometable, .) if form.accepts(...) #old method, I know yada yada return dict(form=form) Haven't tried this in smartgrid yet. On Nov 9, 4:26 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: grid takes any query (even a join) smartgrid takes a table but (can) follow linked tables (no joins). On Nov 9, 3:19 pm, Jim Steil j...@qlf.com wrote: From what I can gather, smartgrid is the same as grid except that it will also display/work with related tables. Grid works with one table only (please correct me if I'm wrong). -Jim On 11/9/2011 3:14 PM, Richard V�zina wrote: Thank a lot Jim I will play a bit with your example... Pretty helpful... I would like to know more about the difference between grid and smartgrid... I just start to read the sqlhtml.py to understand better new grid and smartgrid... Thanks again. Richard On Wed, Nov 9, 2011 at 4:07 PM, Jim Steil j...@qlf.com mailto:j...@qlf.com wrote: Here is a sample of one of my controllers. @auth.requires_permission('select', db.priceTemplate) def priceTemplates(): response.view='list.html' table = db.priceTemplate response.title = '%s - %s' % (response.section, table['_plural']) columns = ['priceTemplate.name', 'priceTemplate.plantId', 'priceTemplate.iwhsPosition', 'contactPriceTemplate.contactId'] # Setup Permissions editable = auth.has_permission('update', table) create = auth.has_permission('create', table) deletable = auth.has_permission('delete', table) details = auth.has_permission('read', table) orderby = dict(priceTemplate=[db.priceTemplate.name http://db.priceTemplate.name]) db.contactPriceTemplate._plural = 'Contacts' db.contactPriceTemplate.priceTemplateId.writable = False db.contactPriceTemplate.priceTemplateId.readable = False grid = SQLFORM.smartgrid(db.priceTemplate, columns=columns, orderby=orderby, create=create, details=details, editable=editable, deletable=deletable, csv=False, search_widget=None, paginate=15, maxtextlength=45) return dict(grid=grid) In it I'm setting read/write capabilities for one of the fields (notice that it isn't a field in the primary table, but a related table. I'm also using standard auth to test for permissions (thanks Anthony). I can control sorting for primary table and related tables. In looking at the method signature for SQLFORM.grid it appears that formstyle will work just like it did for CRUD. From what little I know, it would appear to me that the CSS styling is the same as CRUD so your CSS should work. SQLFORM.smartgrid is amazing. If you have your models setup properly you can get highly sophisticated CRUD forms, with relationships with very little boilerplate code. Thanks Massimo! -Jim On 11/9/2011 2:55 PM, Richard wrote: Hello, I would like to know I can control generated form with SQLFORM.grid... I use to do extensively : If user and group and permission and row field value: crud.table.field.readable =\ crud.table.field.writable =False form = crud.create, read or update(db.table) And I customize my form a bit with CSS (crud.settings.formstyle = 'divs') so I would like to know if I can recycle my CSS with SQLFORM.grid?? Thanks. Richard
[web2py] hide register link on page
I'm using ldap and out of box login. I don't want to show register link on page so I did this. auth.settings.actions_disabled=['register'] This will hide the register link on page but when I create new user from database administration menu by clicking insert new auth_user, it will create the record but the user cannot login ! It says invalid login. If I remove the auth.settings.actions_disabled=['register'], I can do it from the admin menu very strange. Can we just hide the link without loosing the ability to create from admin menu ?
[web2py] mysql w/ web2py DAL issue
The DAL seems to be acting up when I changed my project to a mysql database. Specifically it was working perfectly fine on the sqlite side, but now it keeps issuing the command: ALTER TABLE auth_user DROP COLUMN registration_id Then it always issues tickets concerning there not being a registration_id in my auth_user table. I'm trying to wrap my head around what changed from sqlite to mysql to make it want to purge the registration_id column all the time, but I don't. Any help would be appreciated.
Re: [web2py] Re: SQLFORM.grid : formstyle, readable and writable control
Ok I just read trunk sqlhtml.py that already have the patch I was about to submit (Miss this easy one :) if create and len(request.args)1 and request.args[-2]=='new': check_authorization() table = db[request.args[-1]] create_form = SQLFORM( table, _class='web2py_form', *formstyle = formstyle* ).process(next=referrer, onvalidation=onvalidation, onsuccess=oncreate, formname=formname) Just adding formstyle functionnality that is not present in 1.99.2... Now I would like to know how I can intercept the html form before it get in the face of the user... I mean I use to do this hack to show user help bubble to the user : form = crud.create(db[request.args(0)]) for i in range(0,len(form[0])): if len(form[0][i][2][0]) 0: form[0][i][0].append(SPAN((helpicon(), SPAN(form[0][i][2][0])),_class='tooltip')) del(form[0][i][2]) So I would do the same with create, update form generated by SQLFORM.grid Thanks for any suggestion. Richard On Wed, Nov 9, 2011 at 4:54 PM, Cliff cjk...@gmail.com wrote: In grid you can also do ... if 'new' in request.args: db.sometable.is_active.readable =\ db.sometable.is_active.writable =\ False query=db.othertable.otherfield==avalue db.sometable.foreign_key.requires =\ IS_IN_DB(db(query), 'othertable.otherfield' ...) # even more # for those times when the grid default form isn't sufficient form = SQLFORM(db.sometable, .) if form.accepts(...) #old method, I know yada yada return dict(form=form) Haven't tried this in smartgrid yet. On Nov 9, 4:26 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: grid takes any query (even a join) smartgrid takes a table but (can) follow linked tables (no joins). On Nov 9, 3:19 pm, Jim Steil j...@qlf.com wrote: From what I can gather, smartgrid is the same as grid except that it will also display/work with related tables. Grid works with one table only (please correct me if I'm wrong). -Jim On 11/9/2011 3:14 PM, Richard V�zina wrote: Thank a lot Jim I will play a bit with your example... Pretty helpful... I would like to know more about the difference between grid and smartgrid... I just start to read the sqlhtml.py to understand better new grid and smartgrid... Thanks again. Richard On Wed, Nov 9, 2011 at 4:07 PM, Jim Steil j...@qlf.com mailto:j...@qlf.com wrote: Here is a sample of one of my controllers. @auth.requires_permission('select', db.priceTemplate) def priceTemplates(): response.view='list.html' table = db.priceTemplate response.title = '%s - %s' % (response.section, table['_plural']) columns = ['priceTemplate.name', 'priceTemplate.plantId', 'priceTemplate.iwhsPosition', 'contactPriceTemplate.contactId'] # Setup Permissions editable = auth.has_permission('update', table) create = auth.has_permission('create', table) deletable = auth.has_permission('delete', table) details = auth.has_permission('read', table) orderby = dict(priceTemplate=[db.priceTemplate.name http://db.priceTemplate.name]) db.contactPriceTemplate._plural = 'Contacts' db.contactPriceTemplate.priceTemplateId.writable = False db.contactPriceTemplate.priceTemplateId.readable = False grid = SQLFORM.smartgrid(db.priceTemplate, columns=columns, orderby=orderby, create=create, details=details, editable=editable, deletable=deletable, csv=False, search_widget=None, paginate=15, maxtextlength=45) return dict(grid=grid) In it I'm setting read/write capabilities for one of the fields (notice that it isn't a field in the primary table, but a related table. I'm also using standard auth to test for permissions (thanks Anthony). I can control sorting for primary table and related tables. In looking at the method signature for SQLFORM.grid it appears that formstyle will work just like it did for CRUD. From what little I know, it would appear to me that the CSS styling is the same as CRUD so your CSS should work. SQLFORM.smartgrid is amazing. If you have your models setup properly you can get highly sophisticated CRUD forms, with relationships with very little boilerplate code. Thanks Massimo! -Jim On 11/9/2011 2:55 PM, Richard wrote: Hello,
[web2py] hide register link on page
Maybe precede the actions_disabled with: if request.controller != 'appadmin': Anthony
Re: [web2py] Re: Detecting if a session has ended
Thank you! Richard On Wed, Nov 9, 2011 at 4:23 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: They are usually called auth.settings.login_onaccept = lambda form: .. auth.settings.profile_onaccept = lambda form: .. auth.settings.method_onaccept = lambda form: .. and they all take the form. the name exception is auth.settings.logout_onlogout - lambda user: ... because there is no form to fill on logout but there is a user. On Nov 9, 1:37 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Nice approach so I could update a custom field in auth_user and put it true or false at login and logout? How I may set my flag to true? Is there a auth.settings.login_onlogin ?? Thanks Richard On Wed, Nov 9, 2011 at 2:14 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Sessions never end. Do you want to detect logout? auth.settings.logout_onlogout = lambda user: do_something_with(user) On Nov 9, 11:58 am, Sathvik Ponangi psath...@gmail.com wrote: Is there someway that I could call a function when the user ends their session?
[web2py] OpenJS - Grid for Dummies ??
check this seems simple to make a grid http://www.youtube.com/watch?v=NHwWesxrqiUfeature=relmfu
Re: [web2py] Download file and redirect (or redirect and auto-download file)
You can use response.flash that will appear in your next page or redirection page so you get best of both world you get your message deliver and you bring your user faster to the next task to do... If you don't like this approach I think your problem is more about usage of LOAD() and redirect... The result of you thank_you function an other page so depend of you need you will ajax trap or not your page in the same component so the initial function that redirect on thank_you will display in the component no page reload... But I pretty sure that you are try to do your thank_you function in the first place because you are not aware of response.flash() possibility. Hope it helps Richard On Wed, Nov 9, 2011 at 1:17 PM, Wes Hall wesh...@gmail.com wrote: I'm afraid I'm missing something very basic here. When a user clicks a link to download a file, how to start the download after directing to the thank-you page? I can do either, but have not figured out how to do both. Obviously, this won't work, but the desired behavior is something like this. controller def thank_you(): file = request.args[0] downloader_function(file) # response in downloader_function terminates thank_you function message = 'file downloaded' return dict(message = message) session.flash should work for a short message, but I would like a page. My attempts at LOAD() have resulted in the download file appearing in the created div, not downloading. Thanks
[web2py] Re: hide register link on page
It worked !! I never come up with the idea without your help ! On Nov 9, 4:12 pm, Anthony abasta...@gmail.com wrote: Maybe precede the actions_disabled with: if request.controller != 'appadmin': Anthony
[web2py] Offline Access to web2py manual?
I don't mind buying the updated docs once they are available. (I'm thinking of some sort of local website copy).Meanwhile if there anyway to capture a local version of the manual for browsing that I can access when I don't have online access? I know there is a pdf doc available, but afaik it's pretty out of date. TIA, BrendanC
[web2py] Re: new welcome app - need help with css
Please try this for problem #2 (tested on windows7 IE9, Chrome 15.0.874.106, FF8.0, Opera 11.52, web2py 1.99.3 2011-11-08 22:28:53 dev) .web2py_console {position: relative;} .columns table{width:100%;} .columns table td:last-child{width:100%;} .columns table input#web2py_keywords{display:inline;margin:0 5px;width:350px;} .columns table #w2p_query_panel {left:0;height:26px;bottom:-4px;min-width:539px;} .columns table #w2p_query_panel input, .columns table #w2p_query_panel select{margin:2px 10px 2px 5px;} .columns table #w2p_query_panel input[type=text]{margin:-2px 5px 0 0;} Paolo
[web2py] Re: web(2/3)-based CMS (was Re: Mixing/supporting CMS with Web2py)
I have been a Plone/Zope developer for awhile, but don't get to do it often enough to completely retain what I have done. I have given much thought recently to developing a CMS in web2py, since I think it would simplify my development tremendously. I would love to be part of a community effort on that behalf. As far as a CMS vs a Blog goes, I have always viewed a Blog and viewing content in a particular manner. To me a Blog is a subset of a CMS. If we have a basic CMS, adding a Blog simply means organizing that particular set of data a certain way. At the same time, development of a Blog for itself may be easier than as a subset of a CMS. But most of the projects I have worked on have been adding some kind of content and being able to view that content through a browser. So having a core CMS that is easily extensible into other kinds of systems sounds useful to me. The bottom line is a list of desired features is a good starting place, and I am willing to be part of the development. Ideas: - core objects that can be extended - tags (I like the GMail label idea, so a piece of content can live in multiple locations, not just in one) - additional views that allow mixing multiple content objects, for example, on http://web2py.com/new_examples - maybe the three columns a the bottom (batteries included, web based ide, extensive docs) are different content objects that are used independently somewhere else - content blocks? you have have multiple blocks in a view - easily reorganize block with drag and drop Let me know what I can do to help.
[web2py] Re: new welcome app - need help with css
On Wednesday, November 9, 2011 6:41:40 PM UTC-5, Paolo Caruccio wrote: Please try this for problem #2 (tested on windows7 IE9, Chrome 15.0.874.106, FF8.0, Opera 11.52, web2py 1.99.3 2011-11-08 22:28:53 dev) .web2py_console {position: relative;} .columns table{width:100%;} .columns table td:last-child{width:100%;} .columns table input#web2py_keywords{display:inline;margin:0 5px;width:350px;} .columns table #w2p_query_panel {left:0;height:26px;bottom:-4px;min-width:539px;} .columns table #w2p_query_panel input, .columns table #w2p_query_panel select{margin:2px 10px 2px 5px;} .columns table #w2p_query_panel input[type=text]{margin:-2px 5px 0 0;} Is the .columns part necessary? Ideally, the web2py-specific CSS shouldn't be dependent on the Skeleton CSS. Also, I think Skeleton also has a .column class, so presumably would need to repeat for that case. Anthony
[web2py] Apostrophe error in the database
I am new to web2py and I have a problem understanding why all my apostrophes are replaced by #x27. here is my table: db.define_table('rooms', Field('Name'), Field('created_on','datetime',default=request.now,writable=False,readable=False)) below is my function: @service.xml def rooms(): ROOMS = db(db.rooms).select() return ROOMS this is what I what the result is. NameLady#x27;sRoom/Name Any of you know what is going on here?
Re: [web2py] Offline Access to web2py manual?
On *UNix terminal wget --recursive -l 1 --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains web2py.com --no-parent http://www.web2py.com/book On Wed, Nov 9, 2011 at 9:21 PM, BrendanC bren...@gmail.com wrote: I don't mind buying the updated docs once they are available. (I'm thinking of some sort of local website copy).Meanwhile if there anyway to capture a local version of the manual for browsing that I can access when I don't have online access? I know there is a pdf doc available, but afaik it's pretty out of date. TIA, BrendanC -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Download file and redirect (or redirect and auto-download file)
Unless I'm missing something, session.flash() and response.flash() will not load a new page, only flash a message. Am I wrong? If I try to load the thank_you view and then redirect to the download, it doesn't load the page, but goes straight to the download. (a response exits the function, right?) If I try to use LOAD() the download string gets inserted into a DIV on the current page. Using response.meta['refresh'] = 3;url=http:///downloader; doesn't work Apparently I'm doing something wrong with LOAD(). Is it possible to do a true redirect via LOAD()?
Re: [web2py] Re: Mixing/supporting CMS with Web2py
Browser shots is very nice tool. http://browsershots.org/http://web2py.com/new_examples The CMS (bloog) from Lucas is nice, but it is incomplete, can be used as base for a new project.
Re: [web2py] Re: I can not pass an instance of DAL through other instances and use reference type?
On Wed, Nov 9, 2011 at 5:07 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Do you have a complete traceback? Tracebacks here: https://gist.github.com/1353930 Full code for testing here: https://github.com/rochacbruno/Movuca Note that if I remove reference type from models and user integer it works normally, looks like Field() constructor is trying to access db or something like that when reference type is used. Thanks -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Re: I can not pass an instance of DAL through other instances and use reference type?
Also, it happens only on second request (form submission) the form loads ok, when submitted the error occurs. -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Re: I can not pass an instance of DAL through other instances and use reference type?
OK, I guess I just solved the problem :) *it was:* class Article(BaseModel): tablename = article properties = [ # main Field(author, reference auth_user), Field(author_nickname, string), Field(title, string), *Now it is:* class Article(BaseModel): def set_model(self): self.tablename = article self.properties = [ # main Field(author, reference auth_user), Field(author_nickname, string), Field(title, string), I figured out that I cant use Field as class attribute and I need to use it as instance atribute. *I wanted to do it (which is more idiomatic):* class Article(BaseModel): def set_model(self): self.tablename = article self.name = Field(author, reference auth_user) self.author = Field(author_nickname, string) self.author_nickname = Field(title, string) So I could use inspect or dir(article) to get all properties, iterate and isolate the FIeld's to build the table, But I can't ensure the order as dir() and inspect.get_members() returns unordered dict of attributes. I think it is solved by now, In modules qe can't define dynamic attributes in top level of module or class, all needs to be inside instances! (even the imports) Thanks. -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: lexical scanner
yes, i wrote a function in main.py which is an added controller in my application. under main.py, i have a function called file_lookup. i am trying to use file_lookup in a view between the standard delimitors {{ and }}. except that web2py is erroring out saying that file_lookup is not defined. so i am thinking that i have to pass the function reference off to a global storage so that when web2py renders the view, it has a reference is file_lookup. better? lucas
Re: [web2py] Re: Online Book Typo
+1 for this. I wasn't thinking about major edits, but we could see whether the typos etc. had already been reported and not crowd the group with repeats.
[web2py] Re: lexical scanner
Okay, in that caseyou pass the function to the view as you would any other variable. For example: return dict(form=form, rows=rows, file_lookup=file_lookup) On Nov 10, 4:57 pm, lucas sjluk...@gmail.com wrote: yes, i wrote a function in main.py which is an added controller in my application. under main.py, i have a function called file_lookup. i am trying to use file_lookup in a view between the standard delimitors {{ and }}. except that web2py is erroring out saying that file_lookup is not defined. so i am thinking that i have to pass the function reference off to a global storage so that when web2py renders the view, it has a reference is file_lookup. better? lucas
[web2py] Re: lexical scanner
yes, i wrote a function in main.py which is an added controller in my application. under main.py, i have a function called file_lookup. i am trying to use file_lookup in a view between the standard delimitors {{ and }}. except that web2py is erroring out saying that file_lookup is not defined. so i am thinking that i have to pass the function reference off to a global storage so that when web2py renders the view, it has a reference is file_lookup. better? lucas
[web2py] Re: CAS auto login for all apps
pepper_bg. I just realize like you mentioned before that I don't need CAS since I'm sharing the database. Once I set session.connect(request, response, db, masterapp='app3') it works! It even autologin to all apps once I login. No clicking login button. Once logout will logout all apps too. Something that I was looking for. Thank you for your assistant, really appreciate it :)
[web2py] Re: CAS auto login for all apps
Anthony. Just tried and indeed it works. Can I combine it with pepper_bg's tips so I get the same behaviour? Once login will autologin all apps if we visit them. I still need to click login button right now.
[web2py] Re: web2py with twitter bootstrap - very clean interface ...
I would like to make it work for me. What all you included? Where? what is in the view? I tried to include this (below) previously - but less.js is nowhere to be found in the bootstrap package - I dont wont it to grab the js online .. so that its available for offline use aswell.. link rel=stylesheet/less href=/path/to/bootstrap.less script src=/path/to/less.js/script Any suggestions? Rahul D. On Nov 9, 11:13 pm, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: It totally rocks! 2011/11/9 David Watson davidthewat...@gmail.com: Sorry, I found it: http://groups.google.com/group/web2py-developers/browse_thread/thread... On Nov 9, 12:47 pm, David Watson davidthewat...@gmail.com wrote: On Sep 26, 5:43 pm, Bruno Rocha rochacbr...@gmail.com wrote: We are planning to include it in the next web2py version. I will share the actual w2p after a clean up. Hi, does anybody know if the twitter-bootstrap integration code is available for web2py yet? The one shown here: http://labs.blouweb.com/bootstrap/ I was about to embark on some web2py work that requires twitter- bootstrap, but I wasn't sure if this was available yet. Thanks, David -- Profile:http://www.gild.com/compagnucciangelo Register on Gild:http://www.gild.com/referral/compagnucciangelo
[web2py] Re: Python 2.7 on GAE (experimental)
My company is considering deploying the production version of our web2py application to GAE. This allows us to use WSGI concurrent requests/multithreading. Are there any concerns with enabling multithreading - i.e. is a web2py application thread safe if we don't do any multithreading in our own code (besides whatever web2py does internally, in the DAL, etc.) On Oct 13, 9:52 am, Jonathan Lundell jlund...@pobox.com wrote: On Oct 13, 2011, at 7:47 AM, howesc wrote: on GAE using python2.7 is supposed to give us concurrent requests, which as GAE changes their pricing model is going to make a big difference in cost for us. I just hope they move python2.7 support out of experimental before they raise the rates on us. Yeah, they're supporting WSGI, too. That should make for a big performance improvement. I hope.
Re: [web2py] Re: Python 2.7 on GAE (experimental)
On Nov 9, 2011, at 9:35 PM, pallav wrote: My company is considering deploying the production version of our web2py application to GAE. This allows us to use WSGI concurrent requests/multithreading. Are there any concerns with enabling multithreading - i.e. is a web2py application thread safe if we don't do any multithreading in our own code (besides whatever web2py does internally, in the DAL, etc.) web2py is normally multithreaded when running as a WSGI app (as with its internal Rocket server, or Apache mod_wsgi). GAE is just catching up. One GAE consideration, though, is that while normally requests within the same web2py session are serialized, that is not the case on GAE. On Oct 13, 9:52 am, Jonathan Lundell jlund...@pobox.com wrote: On Oct 13, 2011, at 7:47 AM, howesc wrote: on GAE using python2.7 is supposed to give us concurrent requests, which as GAE changes their pricing model is going to make a big difference in cost for us. I just hope they move python2.7 support out of experimental before they raise the rates on us. Yeah, they're supporting WSGI, too. That should make for a big performance improvement. I hope.
Re: [web2py] Re: SQLFORM grid Authentication.
Thanks to all its working. I have one more problem that i dont want the add button to appear in the form layout for that i tried few things such as writable=False but it is wrong to use writable, so can u tell the possible solution. Once again thanks to u all. On Thu, Nov 10, 2011 at 12:39 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: +1 On Nov 9, 7:27 am, Anthony abasta...@gmail.com wrote: Have you tried something like: SQLFORM.grid(..., editable=auth.has_membership('editor_group'), deletable=auth.has_membership('delete_group'), user_signature=True) Anthony On Wednesday, November 9, 2011 5:16:10 AM UTC-5, Naleen Yadav wrote: Hii All, I am using sqlform grid and i just want to put some authentication on each some functions of grid i.e(Delete , Write) for certain groups' users I can do this by using crud.xxx() but i m unable to use authentication with sqlform grid(). regards, Naleen
Re: [web2py] Re: SQLFORM grid Authentication.
sorry for this post i got the solution to remove the add button from the form. its using the create=auth.has_membership('group_name') now all things are working. thanks a lot . I am pretty excitted about web2py. Regards, Naleen Yadav GENPRO Technologies Pvt Ltd. On Thu, Nov 10, 2011 at 11:31 AM, Naleen Yadav naleenya...@gmail.comwrote: Thanks to all its working. I have one more problem that i dont want the add button to appear in the form layout for that i tried few things such as writable=False but it is wrong to use writable, so can u tell the possible solution. Once again thanks to u all. On Thu, Nov 10, 2011 at 12:39 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: +1 On Nov 9, 7:27 am, Anthony abasta...@gmail.com wrote: Have you tried something like: SQLFORM.grid(..., editable=auth.has_membership('editor_group'), deletable=auth.has_membership('delete_group'), user_signature=True) Anthony On Wednesday, November 9, 2011 5:16:10 AM UTC-5, Naleen Yadav wrote: Hii All, I am using sqlform grid and i just want to put some authentication on each some functions of grid i.e(Delete , Write) for certain groups' users I can do this by using crud.xxx() but i m unable to use authentication with sqlform grid(). regards, Naleen
[web2py] Re: Offline Access to web2py manual?
use the Firefox scrapbook extension (https://addons.mozilla.org/en-US/ firefox/addon/scrapbook/).. that way you could annotate, highlight etc. On Nov 10, 4:21 am, BrendanC bren...@gmail.com wrote: I don't mind buying the updated docs once they are available. (I'm thinking of some sort of local website copy).Meanwhile if there anyway to capture a local version of the manual for browsing that I can access when I don't have online access? I know there is a pdf doc available, but afaik it's pretty out of date. TIA, BrendanC
[web2py] Video tutorial for web2py noobs (in portuguese)
Hi, I published a video of one of my classes in (cursodepython.com.br), in this class I talked about the basic web2py workflow and how to create an app from the scratch (without using welcome as base scaffold) The video is in: http://vimeo.com/rochacbruno/web2pyworkflow Sorry, this is in *portuguese*, but I guess some latin people here will understand the basics (I am planning to extend my course and give some online classes in english, but I am in need to improve my english first :) ) Hope it helps some web2py begginer. -- Bruno Rocha [http://rochacbruno.com.br]