[web2py] Re: Why showing a log in option inside of the admin interface
OK, I did a complete re download and re-install of the system. Right from the first log in in the admin GUI, using the password given on first execution of the rocket server to create the parameters file, I get the double logo as soon as I enter the admin area. See what it looks like here: http://i.imgur.com/7LZGP.png Note: this is web2py out of the box. No change at all. I know the system recognizes the password because if I enter a wrong one it gives back a message to that effect, and if I give the right one it doesn't it just presents the login screen again although I appear logged in. Has anyone got any ideas?
[web2py] Re: Why showing a log in option inside of the admin interface
I thought the problem was related only to webfaction web2py or uwsgi, but now, it seems that there is another issue. I am not getting the same behavior in different browsers! Chromium, gives me a double logo and a right panel log in, but Firefox doesn't, it simply shows back the original login page, allowing you to log as many times as you wish but never allowing you get anywhere at all except at another, and another,and another ... log in screen(Kafkaesque, if you ask me) . What else may help resolve this, or, at least know whether the problem is with webfaction, web2py, uwsgi or whatever!? Frustration mounting! Thanks
[web2py] Re: Cascading Drop Down Lists with Ajax
hi! the demo site is down :(
Re: Re : Re: [web2py] Re: fluxflex
I've been testing the web2py-for-fluxflex github forking approach and it works very well. however there is one problem when I deploy to fluxflex all the views that goes through generic.html gets 404 error. I'm using the 1.99.2 web2py version. maybe this is related to routes, but I don't have access to the web2py installation on fluxflex... any idea?
Re: Re : Re: [web2py] Re: fluxflex
https://groups.google.com/forum/#!msg/web2py/26g9XA_0ZXE/4yiIHs5FivkJ http://groups.google.com/group/web2py/browse_thread/thread/485ee82885963d21?hl=en I guess it is related to security issue described above. Regards, Marin 2011/10/7 kralin andrea.pierle...@gmail.com I've been testing the web2py-for-fluxflex github forking approach and it works very well. however there is one problem when I deploy to fluxflex all the views that goes through generic.html gets 404 error. I'm using the 1.99.2 web2py version. maybe this is related to routes, but I don't have access to the web2py installation on fluxflex... any idea?
Re: Re : Re: [web2py] Re: fluxflex
https://groups.google.com/forum/#!msg/web2py/26g9XA_0ZXE/4yiIHs5FivkJ http://groups.google.com/group/web2py/browse_thread/thread/485ee82885... It is related to security issue described above. Regards, Marin On Oct 7, 11:26 am, kralin andrea.pierle...@gmail.com wrote: I've been testing the web2py-for-fluxflex github forking approach and it works very well. however there is one problem when I deploy to fluxflex all the views that goes through generic.html gets 404 error. I'm using the 1.99.2 web2py version. maybe this is related to routes, but I don't have access to the web2py installation on fluxflex... any idea?
[web2py] Re: mailing list and web2py apps
On Fri, 23 Sep 2011 05:22:43 -0300 Bruno Rocha rochacbr...@gmail.com wrote: 2. Try to find some contact, forum, blog, discussion, repository if the app For now I did: 2a. Create issue(s) on app's (Instant Press) tracker (bitbucket). ;) Sincerely, Gour p.s. Probably those issues are not so difficult to fix, but, atm, are preventing me from deploying my first site(s) on production server. -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 signature.asc Description: PGP signature
[web2py] Re: fluxflex
Thank you for web2py for fluxflex!
Re: [web2py] mailing list and web2py apps
I'm considering number eleven :P 2011/9/23 Bruno Rocha rochacbr...@gmail.com I Guess there is no list policy, but I recommend this order. 0. Perform a search on group trying to find people running same issue 1. Try to contact the Author of the app directly 2. Try to find some contact, forum, blog, discussion, repository if the app 3. Post your issue here in the group 4. Bump UP your own post if not answered for some time, (sometimes people just dont get it, too many posts) 5. Try to solve yourself and contribute with the author 7. Create a voodoo of the app author :P 8. sit down and cry 9. forget about the app, try to find other solution 10. develop your own version based on a fork 11. Forget about web development and try to find another job! LOL 12. It was serious until the option n. 5 On Fri, Sep 23, 2011 at 5:13 AM, Gour-Gadadhara Dasa g...@atmarama.netwrote: Hello! I'd not like to hijack this mailing list with the posts about issues with web2pyapps if it's not meant for that, so what is the lists' policy about it? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 -- -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] [ Aprenda a programar: http://CursoDePython.com.br ] [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ] [ Consultoria em desenvolvimento web: http://www.blouweb.com ] -- http://martin.tecnodoc.com.ar
[web2py] Re: Many to many query with two left joins - how to do in Web2py?
Grazie. This unlocks a door. I thought I had to repeat the call to left() same as the SQL. On Oct 6, 5:13 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Here is your SQL: SELECT purchase_orders.issue_date, purchase_orders.number, products.name FROM purchase_orders LEFT JOIN purchase_order_products ON purchase_order_products.purchase_order_id = purchase_orders.id LEFT JOIN products ON purchase_order_products.product_id = products.id web2py-ese: db().select(db.purchase_orders.issue_date, db.purchase_orders.number, db.products.name, left=[db.purchase_order_products.on(db.purchase_order_products.purchase_order_id == db.purchase_orders.id), db.products.on(db.purchase_order_products.product_id == db.products.id)]) On Oct 6, 1:46 pm, Cliff cjk...@gmail.com wrote: Actually 'name' comes from products. Maybe it would be clearer this way: SELECT purchase_orders.issue_date, purchase_orders.number, products.name FROM purchase_orders LEFT JOIN purchase_order_products ON purchase_order_products.purchase_order_id = purchase_orders.id LEFT JOIN products ON purchase_order_products.product_id = products.id On Oct 6, 12:13 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Why do you left join products if you do not select anything from it? On Oct 6, 7:40 am, Cliff cjk...@gmail.com wrote: Here is the model, simplified: db.define_table('purchase_orders', Field('issue_date', 'date', comment = SPAN(a_comment, _style='color:orange;')), Field('number', length=24, requires=IS_NOT_EMPTY(), required=True, notnull=True, comment=SPAN('Required', _style='color:orange;')), Field('closed', 'boolean', readable=False, writable=False, default=False), format = '%(number)s' ) db.define_table( 'products', Field('name', length=256, required=True, notnull=True), Field('internal_item_number', length=36), format = '%(name)s' ) db.define_table('purchase_order_products', Field('purchase_order_id', db.purchase_orders), Field('product_id', db.products), Field('quantity', 'decimal(12,3)'), ) in SQL I can make this query: SELECT issue_date, number, name FROM purchase_orders LEFT JOIN purchase_order_products ON purchase_order_products.purchase_order_id = purchase_orders.id LEFT JOIN products ON purchase_order_products.product_id = products.id How do I do this in Web2py?
[web2py] logged in user
Dear All , How Can I get the name of the user who is logged in my website ??
Re: [web2py] logged in user
Take a look at the table auth_events -- Massimiliano Il giorno 07/ott/2011, alle ore 14:34, Web2Py Freak halna...@gardeniatelco.com ha scritto: Dear All , How Can I get the name of the user who is logged in my website ??
[web2py] Re: GAE with database
Yes. Web2py supports this already. On Oct 7, 12:53 am, ramkrishan bhatt ramkrishan.bh...@gmail.com wrote: Hello Is'nt it good for web2py framwork also. can be use thishttp://googlecode.blogspot.com/2011/10/google-cloud-sql-your-database...
[web2py] Re: mailing list and web2py apps
On Fri, 7 Oct 2011 09:23:18 -0300 Martín Mulone mulone.mar...@gmail.com wrote: I'm considering number eleven :P /me hopes it's just a good joke... Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 signature.asc Description: PGP signature
[web2py] Re: logged in user
The db.auth_user record of the current logged in user is accessible via auth.user, and the ID of that user is accessible in auth.user_id (as well as auth.user.id). Both auth.user and auth.user_id return None if the user is not logged in. For the name, auth.user.first_name and auth.user.last_name. See the callout box at the end of this section: http://web2py.com/book/default/chapter/08#Authentication. Anthony On Friday, October 7, 2011 8:34:14 AM UTC-4, Web2Py Freak wrote: Dear All , How Can I get the name of the user who is logged in my website ??
[web2py] Re: logged in user
thnx guys its working now ..
[web2py] Re: Sending Email Under Linux
That theory don't fly. I have a Seaside app running on a Linux server at a remote datacenter, and it uses the same 'smtp.broadband.rogers.com:25'. Richard On Oct 6, 7:29 am, MidGe degreef.mic...@gmail.com wrote: If 'smtp.broadband.rogers.com:25' works under Windows, why the hell wouldn't it work under Linux?? Oh well. Maybe because windows runs a 'smtp.broadband.rogers.com:25' whereas Linux has not set such a server by default?!
Re: [web2py] Re: new feature - need help
Yeah I tried it... I said that need == because at least with the yesterday trunk single = didn't returns any result... By a la Access I mean the query builder that let you write SQL query by not writing SQL (you pick the table, then cross check the field, etc.)... I think the only difference is that it is multitable. I can have a look to improve the actual CSS you drop on for now. I was asking myself if it could be possible to implement a kind of REGEX search functionnality like Datatables... With Datatables grid search field you can put any character and the records are filtered base on the presence absence of each group of character or single character (not sure exactly). So for example, you can filter like this : 7.49 2010-09-09 That will return the rows that contain 7.49 value for the given date... It mays what you try to achieve with more power by allowing the possibility to the user to specify the exact columns he wants it value to be search. I try to improve the CSS. Ciao! Richard On Thu, Oct 6, 2011 at 5:19 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: My problem is the css. The rest we can discuss later. Anyway, field = value is correct. The search string is not DAL syntax, it is english. You can even write field equals value and otherfield starts with something without = and without quotes around values. We can add OR support later but AND is automatic. Did you try add two queries? I am not trying to copy Access. I am trying to create a pluggable and customizable way to built the search strings. Massimo On Oct 6, 2:28 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: I just think for 2 min about it... A popup grid seems to me the appropriate display for this query builder... Grid : Field to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button New row Maybe a 'AND' or 'OR' is needed for createria (between line) Maybe the table should just add a column at the begining when more then one creteria is entered user has to specify the AND or OR... So... AND/ORField to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button DropboxNew row Query completed (button) What about that?! jQuery UI dialog Richard On Thu, Oct 6, 2011 at 3:17 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: Ok, not exactly a la access... Pretty good I notice this : = create : name = 'something' should be name == 'something' I don't think about to much about the background complexity of what you try to achieve, but I don't understand why menu is an appropriate way to display this query building thing. Richard On Thu, Oct 6, 2011 at 2:30 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: A la Access?! Great... I will try to give a ride to the new smartgrid to see that... Do you have a test app or do the code you publish earlier to try the new smartgrid enable automatically the searhcable function?... I try anyway. Richard On Thu, Oct 6, 2011 at 12:01 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: There is a new feature in trunk. When you make a searchable grid, it will now show a button before the search input field. It says Query. Hover over it and it will create a popup menu so that you can build the query with the mouse. It works but the css is horrible and I could use some help fixing it. The code is generated by a single function in sqlhtml.py build_search() Massimo
[web2py] Re: Cascading Drop Down Lists with Ajax
Pepe, It's up now. Thank you for letting me know. My web2py version was back to 1.98.2 and all app was gone... I don't know why. I deployed the new version 1.99.2 and re-create the app from slice. It's actually pretty easy ! On Oct 7, 4:00 am, Pepe Araya pepea...@gmail.com wrote: hi! the demo site is down :(
[web2py] Re: Delete plugin will also delete default theme
Thank you, I found the problem. views/layout.html is REPLACED when the layout plugin installed and stay as is even you uninstall the plugin, which means the original one is not restored. I tried the following but others cause the same problem. http://web2py.com/layouts/static/plugin_layouts/plugins/web2py.plugin.layout_RedCity.w2p We can manually restore the original from other apps but it's nice to have feature to restore the original and backup when it's uninstalled. On Oct 6, 6:12 pm, Anthony abasta...@gmail.com wrote: Which layout plugin did you install? On Thursday, October 6, 2011 6:27:27 PM UTC-4, Omi Chiba wrote: Have you confirmed the default theme files have actually been deleted? Not sure where it's located... It would be /views/layout.html and /static/css/base.css. When using the layout plugin, had you modified your layout.html to extend the plugin layout.html No. It's a brand new app. I think you can also re-produce it very easily. By the way, web2py version is the latest (Version 1.99.2) one. On Oct 6, 3:51 pm, Anthony abas...@gmail.com wrote: Have you confirmed the default theme files have actually been deleted? When using the layout plugin, had you modified your layout.html to extend the plugin layout.html, and if so, did you change it back after deleting the plugin? Anthony On Thursday, October 6, 2011 4:34:17 PM UTC-4, Omi Chiba wrote: See attached screen shot. 1. Download layout plugin 2. Upload to your app 3. Click delete plugin 4. Now I'm naked like attached screen.
[web2py] Re: Delete plugin will also delete default theme
that is is precisely... The current recommended way of creating layout plugins works fine when installing plugins but does leave you naked if you decide to uninstall all layout plugins or uninstall the last layout plugin installed. To get a better understanding of why this is true you can see the web2py manual or examine the contents of a layout plugin (basically a tar archive) : http://www.web2py.com/book/default/chapter/13?search=layout+plugin#Layout-plugins In a nutshell, many layout plugins (all of them?) overwrite views/layout.html or recommend that views/layout.html be replaced with the following content: {{extend 'plugin_layout_name/layout.html'}} {{include}} So restoring your original views/layout.html will give you your original layout again. Alternatively you could create a layout plugin that installs your original views/layout.html (or even the entire default theme) for the version of Web2py you used to create the application or your own custom version. Chris
[web2py] Request same function on .change event.
I have a registration form with a drop down list showing services, depending on the service the user registers for a custom form should display. Normally the user follows a link and the service is set based on request.args(0): form=SQLFORM(db.register) form.vars.service=request.args(0) I customize the form setting some of the fields in the register table to readable=false and writable=false However, when the user changes his mind and chooses an other service from the drop down list the form should be adjusted. script jQuery(#register_service).change(function(){ ### request register again args set to the new value of register_service /script What is the correct syntax to achieve this? Kind regards, Annet.
[web2py] Re: spinejs with Web2py
the latest version of spine (1.0.0 at spinejs.com) fixed the bugs and json can be retrieved. time to crack on!
[web2py] Sharing a database between apps
I was wondering if its possible to share a database between apps. I have two apps. One is a background process that discovers devices on the network using bonjour and adds them to the database. The other app provides a web interface to view these discovered devices. How do I share the same database? Do I define the table twice?
[web2py] Re: Cannot serve any pages after fresh install of Python2.5
Multi-platform Development with Python and Web2py. Here are a list of suggestions that should help make your experience a more pleasant one. Stick with Ubuntu LTS First to reiterate pbreit comment on Ubuntu LTS version. If you are not developing Ubuntu itself or have no compelling reason to run the latest and greatest version of Ubuntu then stick with an LTS version. You will have far fewer problems with your host system and when you upgrade to the next LTS version things will go much more smoothly and most of your OS configuration and settings will continue to work as well. Never Downgrade Never ever downgrade Python (or anything else for that matter!). While a lot of things are designed to be upgradable ( like Web2py ) and maintain backward compatibility ( Web2py) nothing that I am aware of is designed to downgrade. OK, so now what do you do! To do cross platform development with Python and therefore Web2py you have three basic options from least to most desirable: A) Trust ( verify and hope ) that your applications only uses features of the target Python version. Traditional approach This can works surprisingly well, in fact it is what people used to do all the time. The trick would be doing regular deployments and testing on your target platform both of which are good practices. B) Use virtualenv to create a virtual python environment for running your application. Recommended but adds another learning curve virtualenv lets you create isolated Python environments. virtualenv works great but can significantly increase your short term learning curve as you will also need to learn about some other concepts and Python features such as pip. http://www.virtualenv.org/en/latest/index.html C) Universal Python Installer. Not recommended This would be the perfect solution only it does not yet exist. The closest I have gotten is this project here: http://code.google.com/p/uc-unified-python-installer/ but to my knowledge it does not work on GAE. It does give you a consistent automated installation of a sandboxed python versions on nix and nix like systems but must be manually modified to install anything but Python 2.6.7
[web2py] Re: Cannot serve any pages after fresh install of Python2.5
+1
[web2py] Re: GAE with database
Ohh great do we have any sample application with us. I guess here i can get the ERP solution with GAE. On Oct 7, 5:40 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Yes. Web2py supports this already. On Oct 7, 12:53 am, ramkrishan bhatt ramkrishan.bh...@gmail.com wrote: Hello Is'nt it good for web2py framwork also. can be use thishttp://googlecode.blogspot.com/2011/10/google-cloud-sql-your-database...
[web2py] Re: Sharing a database between apps
Yes. More information is available here: http://web2py.com/book/default/chapter/04#Cooperation On Oct 7, 11:11 am, Harshad hash0...@gmail.com wrote: I was wondering if its possible to share a database between apps. I have two apps. One is a background process that discovers devices on the network using bonjour and adds them to the database. The other app provides a web interface to view these discovered devices. How do I share the same database? Do I define the table twice?
Re: [web2py] Re: new feature - need help
Massimo, I need a class somewhere here, but can't find how to insert it : for option in options: menu[-1][-1].append((T(option),False,False, [(SPAN(INPUT(_type=field.type), INPUT(_type=button,_value=T('add'), _onclick=w2p_build_search('+field.name+ +option+ ',this,event);)), False,False)]), *_class='NEW CLASS'*) I try this : https://mail.google.com/mail/?shva=1#search/add+class+to+menu/12fc24f2a966a78c That works to rename menu class, but can't add a class to the li() that contain the a() that contain the value to be search field and the add button. Richard On Fri, Oct 7, 2011 at 9:44 AM, Richard Vézina ml.richard.vez...@gmail.comwrote: Yeah I tried it... I said that need == because at least with the yesterday trunk single = didn't returns any result... By a la Access I mean the query builder that let you write SQL query by not writing SQL (you pick the table, then cross check the field, etc.)... I think the only difference is that it is multitable. I can have a look to improve the actual CSS you drop on for now. I was asking myself if it could be possible to implement a kind of REGEX search functionnality like Datatables... With Datatables grid search field you can put any character and the records are filtered base on the presence absence of each group of character or single character (not sure exactly). So for example, you can filter like this : 7.49 2010-09-09 That will return the rows that contain 7.49 value for the given date... It mays what you try to achieve with more power by allowing the possibility to the user to specify the exact columns he wants it value to be search. I try to improve the CSS. Ciao! Richard On Thu, Oct 6, 2011 at 5:19 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: My problem is the css. The rest we can discuss later. Anyway, field = value is correct. The search string is not DAL syntax, it is english. You can even write field equals value and otherfield starts with something without = and without quotes around values. We can add OR support later but AND is automatic. Did you try add two queries? I am not trying to copy Access. I am trying to create a pluggable and customizable way to built the search strings. Massimo On Oct 6, 2:28 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: I just think for 2 min about it... A popup grid seems to me the appropriate display for this query builder... Grid : Field to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button New row Maybe a 'AND' or 'OR' is needed for createria (between line) Maybe the table should just add a column at the begining when more then one creteria is entered user has to specify the AND or OR... So... AND/ORField to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button DropboxNew row Query completed (button) What about that?! jQuery UI dialog Richard On Thu, Oct 6, 2011 at 3:17 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: Ok, not exactly a la access... Pretty good I notice this : = create : name = 'something' should be name == 'something' I don't think about to much about the background complexity of what you try to achieve, but I don't understand why menu is an appropriate way to display this query building thing. Richard On Thu, Oct 6, 2011 at 2:30 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: A la Access?! Great... I will try to give a ride to the new smartgrid to see that... Do you have a test app or do the code you publish earlier to try the new smartgrid enable automatically the searhcable function?... I try anyway. Richard On Thu, Oct 6, 2011 at 12:01 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: There is a new feature in trunk. When you make a searchable grid, it will now show a button before the search input field. It says Query. Hover over it and it will create a popup menu so that you can build the query with the mouse. It works but the css is horrible and I could use some help fixing it. The code is generated by a single function in sqlhtml.py build_search() Massimo
[web2py] Getting Json data from Spinejs request
I've a function in my default.py controller : @service.jsonrpc def get_agent(): import gluon.contrib.simplejson data = gluon.contrib.simplejson.loads(request.body.read()) to get a dict of data sent from the browser I find I have to call simplejson.loads(request.body.read()) rather than define parameters in def get_agent(): which is what I've been doing when calling from Pyjamas. Does anyone know why?
[web2py] Re: manual file upload using SQLFORM.factory
it turned out that I could not do it as shown above because of form.accepts. This already performs the upload so now I'm doing it more like you suggested which is even more straightforward. form = SQLFORM.factory( Field('invoice_logo', 'upload', label=T('as.invoice_logo'), uploadfolder=os.path.join(request.folder,'uploads/')), Field('invoice_logo_filename', label=T('as.invoice_logo_filename')), ... many other fields ... table_name='admin_setting') if form.accepts(request.vars, formname='admin_setting_form', dbio=False): if request.vars.invoice_logo != None: if type(request.vars.invoice_logo) != str: request.vars.invoice_logo_filename = request.vars.invoice_logo.filename invoice_logo_newfilename = form.vars['invoice_logo_newfilename'] else: del request.vars.invoice_logo # do not clear current logo filename for setting in request.vars: if not setting.startswith('_'): old_file = None if setting == 'invoice_logo': old_file = db(db.admin_setting.name == 'invoice_logo').select(db.admin_setting.value).first().value value = invoice_logo_newfilename else: value = request.vars[setting] if old_file: try: os.remove(os.path.join(request.folder, 'uploads/', old_file)) except OSError: pass db(db.admin_setting.name == setting).update(value=value) one question about the download: def download(): import os filename = request.args(0) original_filename = request.vars.filename filename = os.path.join(request.folder, 'uploads/', filename) ret = open(filename, 'rb') response.headers['Content-Type'] = 'application/octet-stream' response.headers['Content-Disposition'] = 'inline; filename=%s' % original_filename return ret.read() do I have to take care about directory traversals and other security risks? What's the easiest way to do this? On 7 Okt., 02:47, TheSweetlink yanosh...@gmail.com wrote: My pleasure Alex. I am glad that worked out for you. Now that I look at your code you got it to work in a way I didn't even think of. May we see a more complete example of your SQLFORM.factory? Massimo, I don't think I would know how to make it better other than Alex's suggestion of adding some more info to the Book. Especially when Alex came up with another way to do the manual upload I think it's cool that web2py is that flexible. I know it must be difficult to keep it all up to date with all the new features cropping up left and right. Nice work by the way to all that did the most recent updates. Viva web2py and its magnificent community, David On Oct 6, 4:12 pm, Alex mrauc...@gmail.com wrote: Hi David, works great, thanks! I'm now manually uploading with these few lines: field = Field('invoice_logo', 'upload', uploadfolder=os.path.join(request.folder,'uploads/')) field._tablename = 'admin_setting' uploaded_invoice_logo_filename = field.store(request.vars.invoice_logo.file, request.vars.invoice_logo.filename) @Massimo: now that I know, it's quite easy so I don't know much to make it better. It would be good if this would be mentioned in the documentation (there is already a short 'Manual Uploads' section), although this is probably not a common use case. And maybe it would be a good idea to have default values for uploadfolder and tablename? On 6 Okt., 03:46, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Suggestions to make the behaviour better? On Oct 5, 5:55 pm, TheSweetlink yanosh...@gmail.com wrote: Hello Alex, Two things I've found when manually uploading via SQLFORM.factory: 1) You need to specify a table_name='...' to avoid the no_table_newfilename.extension issue like this: form = SQLFORM.factory(...Field definitions..., table_name='some_table_name') 2) Additionally you must specify an uploadfolder in your upload Field definition similar to this: form = SQLFORM.factory(..., Field('invoice_logo', type='upload', uploadfolder=os.path.join(request.folder,'static/uploads/')), ..., table_name='whatever_you_like') **NOTE** 'static/uploads' is just an example, you can upload to wherever it will be appropriate. In this case the newly uploaded and renamed file to your_application's_dir/static/uploads/your_new_filename_here One gotcha to look out for following your field name as an example without the quotation marks: In your form.accepts(...): request.vars.invoice_logo will contain the original filename of your upload whereas form.vars.invoice_logo_newfilename will contain the newly renamed file like yourtablename.9203842903.thaoeu09gu023hgda3p.ext No need to call store() directly as SQLFORM.factory
[web2py] Re: Sharing a database between apps
Nice. So all I have to do is define them in every application that is using them and set migrate=False. And, next time I'll try to RTFM more carefully. Thanks Cliff! On Oct 7, 12:19 pm, Cliff cjk...@gmail.com wrote: Yes. More information is available here: http://web2py.com/book/default/chapter/04#Cooperation On Oct 7, 11:11 am, Harshad hash0...@gmail.com wrote: I was wondering if its possible to share a database between apps. I have two apps. One is a background process that discovers devices on the network using bonjour and adds them to the database. The other app provides a web interface to view these discovered devices. How do I share the same database? Do I define the table twice?
Re: [web2py] Re: new feature - need help
Finally find a little fix so you can play with the query builder with a correct superfish display (pretty ugly) but... Add this to base.css : .web2py-menu-expand .sfHover { width: 275px; } .web2py-menu-vertical li a input { margin: 5px; } Change this in superfis.css : .sf-menu-query ul { width: *275px*; /* left offset of submenus need to match (see below) */ ul.sf-menu-query li li.sfHover-query ul { left: *275px*; /* match ul width */ ul.sf-menu-query li li li:hover ul, ul.sf-menu-query li li li.sfHover-query ul { left: *275px*; /* match ul width */ It should make the each menu level 275px so the last level will be displaying the input and add button on the same line with the appropriate background. Hope I didn't forget anything... Richard On Fri, Oct 7, 2011 at 12:22 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Massimo, I need a class somewhere here, but can't find how to insert it : for option in options: menu[-1][-1].append((T(option),False,False, [(SPAN(INPUT(_type=field.type), INPUT(_type=button,_value=T('add'), _onclick=w2p_build_search('+field.name+ +option+ ',this,event);)), False,False)]), *_class='NEW CLASS'*) I try this : https://mail.google.com/mail/?shva=1#search/add+class+to+menu/12fc24f2a966a78c That works to rename menu class, but can't add a class to the li() that contain the a() that contain the value to be search field and the add button. Richard On Fri, Oct 7, 2011 at 9:44 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Yeah I tried it... I said that need == because at least with the yesterday trunk single = didn't returns any result... By a la Access I mean the query builder that let you write SQL query by not writing SQL (you pick the table, then cross check the field, etc.)... I think the only difference is that it is multitable. I can have a look to improve the actual CSS you drop on for now. I was asking myself if it could be possible to implement a kind of REGEX search functionnality like Datatables... With Datatables grid search field you can put any character and the records are filtered base on the presence absence of each group of character or single character (not sure exactly). So for example, you can filter like this : 7.49 2010-09-09 That will return the rows that contain 7.49 value for the given date... It mays what you try to achieve with more power by allowing the possibility to the user to specify the exact columns he wants it value to be search. I try to improve the CSS. Ciao! Richard On Thu, Oct 6, 2011 at 5:19 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: My problem is the css. The rest we can discuss later. Anyway, field = value is correct. The search string is not DAL syntax, it is english. You can even write field equals value and otherfield starts with something without = and without quotes around values. We can add OR support later but AND is automatic. Did you try add two queries? I am not trying to copy Access. I am trying to create a pluggable and customizable way to built the search strings. Massimo On Oct 6, 2:28 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: I just think for 2 min about it... A popup grid seems to me the appropriate display for this query builder... Grid : Field to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button New row Maybe a 'AND' or 'OR' is needed for createria (between line) Maybe the table should just add a column at the begining when more then one creteria is entered user has to specify the AND or OR... So... AND/ORField to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button DropboxNew row Query completed (button) What about that?! jQuery UI dialog Richard On Thu, Oct 6, 2011 at 3:17 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: Ok, not exactly a la access... Pretty good I notice this : = create : name = 'something' should be name == 'something' I don't think about to much about the background complexity of what you try to achieve, but I don't understand why menu is an appropriate way to display this query building thing. Richard On Thu, Oct 6, 2011 at 2:30 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: A la Access?! Great... I will try to give a ride to the new smartgrid to see that... Do you have a test app or do the code you publish earlier to try the new smartgrid enable automatically the searhcable function?... I try anyway. Richard On Thu, Oct 6, 2011 at 12:01 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: There is a
Re: [web2py] Re: Help for creating template
On Friday, October 7, 2011 1:31:08 AM UTC-4, miroslavgojic wrote: Thanks for blocks - that work, this is similar to modules in joomla, I can write small block and get content on specific place at layout. I tray to use next code: response http://web2py.com/book/default/docstring/response.menu = [('Google', False, 'http://www.google.com',[]), ('Index', True, URL http://web2py.com/book/default/docstring/URL('index'), [])] but without any success. I reed in book that mentioned code I must put in controller but how to get same than in layout and does in controller I must use definition or haw. Can you show the relevant controller and view code related to the menu? What do you expect to see, and what do you actually see? Note, typically you would pass response.menu to the MENU() helper, which will turn it into a nested unordered list, which can then be styled/displayed as a menu via CSS and/or Javascript (e.g., the 'welcome' app uses the Superfish Javascript menu). Anthony
Re: [web2py] Re: new feature - need help
Oh forget to mention... It needs that we fork superfish.css and js and rename every class in superfish.css and their call in superfish.js... It's not pretty nice but it allow to play with the query builder... I not convinced with a menu a proper ui for a query builder since when your mice fall outside the menu everything unwrap and you have to start everything over... Richard On Fri, Oct 7, 2011 at 12:50 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Finally find a little fix so you can play with the query builder with a correct superfish display (pretty ugly) but... Add this to base.css : .web2py-menu-expand .sfHover { width: 275px; } .web2py-menu-vertical li a input { margin: 5px; } Change this in superfis.css : .sf-menu-query ul { width: *275px*; /* left offset of submenus need to match (see below) */ ul.sf-menu-query li li.sfHover-query ul { left: *275px*; /* match ul width */ ul.sf-menu-query li li li:hover ul, ul.sf-menu-query li li li.sfHover-query ul { left: *275px*; /* match ul width */ It should make the each menu level 275px so the last level will be displaying the input and add button on the same line with the appropriate background. Hope I didn't forget anything... Richard On Fri, Oct 7, 2011 at 12:22 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Massimo, I need a class somewhere here, but can't find how to insert it : for option in options: menu[-1][-1].append((T(option),False,False, [(SPAN(INPUT(_type=field.type), INPUT(_type=button,_value=T('add'), _onclick=w2p_build_search('+field.name+ +option+ ',this,event);)), False,False)]), *_class='NEW CLASS'*) I try this : https://mail.google.com/mail/?shva=1#search/add+class+to+menu/12fc24f2a966a78c That works to rename menu class, but can't add a class to the li() that contain the a() that contain the value to be search field and the add button. Richard On Fri, Oct 7, 2011 at 9:44 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Yeah I tried it... I said that need == because at least with the yesterday trunk single = didn't returns any result... By a la Access I mean the query builder that let you write SQL query by not writing SQL (you pick the table, then cross check the field, etc.)... I think the only difference is that it is multitable. I can have a look to improve the actual CSS you drop on for now. I was asking myself if it could be possible to implement a kind of REGEX search functionnality like Datatables... With Datatables grid search field you can put any character and the records are filtered base on the presence absence of each group of character or single character (not sure exactly). So for example, you can filter like this : 7.49 2010-09-09 That will return the rows that contain 7.49 value for the given date... It mays what you try to achieve with more power by allowing the possibility to the user to specify the exact columns he wants it value to be search. I try to improve the CSS. Ciao! Richard On Thu, Oct 6, 2011 at 5:19 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: My problem is the css. The rest we can discuss later. Anyway, field = value is correct. The search string is not DAL syntax, it is english. You can even write field equals value and otherfield starts with something without = and without quotes around values. We can add OR support later but AND is automatic. Did you try add two queries? I am not trying to copy Access. I am trying to create a pluggable and customizable way to built the search strings. Massimo On Oct 6, 2:28 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: I just think for 2 min about it... A popup grid seems to me the appropriate display for this query builder... Grid : Field to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button New row Maybe a 'AND' or 'OR' is needed for createria (between line) Maybe the table should just add a column at the begining when more then one creteria is entered user has to specify the AND or OR... So... AND/ORField to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button DropboxNew row Query completed (button) What about that?! jQuery UI dialog Richard On Thu, Oct 6, 2011 at 3:17 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: Ok, not exactly a la access... Pretty good I notice this : = create : name = 'something' should be name == 'something' I don't think about to much about the background complexity of what you try to achieve, but I don't understand why menu is an appropriate way to display this query
Re: [web2py] Re: new feature - need help
and change in sqlhtml the init call for the query of superfish... Richard On Fri, Oct 7, 2011 at 12:59 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Oh forget to mention... It needs that we fork superfish.css and js and rename every class in superfish.css and their call in superfish.js... It's not pretty nice but it allow to play with the query builder... I not convinced with a menu a proper ui for a query builder since when your mice fall outside the menu everything unwrap and you have to start everything over... Richard On Fri, Oct 7, 2011 at 12:50 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Finally find a little fix so you can play with the query builder with a correct superfish display (pretty ugly) but... Add this to base.css : .web2py-menu-expand .sfHover { width: 275px; } .web2py-menu-vertical li a input { margin: 5px; } Change this in superfis.css : .sf-menu-query ul { width: *275px*; /* left offset of submenus need to match (see below) */ ul.sf-menu-query li li.sfHover-query ul { left: *275px*; /* match ul width */ ul.sf-menu-query li li li:hover ul, ul.sf-menu-query li li li.sfHover-query ul { left: *275px*; /* match ul width */ It should make the each menu level 275px so the last level will be displaying the input and add button on the same line with the appropriate background. Hope I didn't forget anything... Richard On Fri, Oct 7, 2011 at 12:22 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Massimo, I need a class somewhere here, but can't find how to insert it : for option in options: menu[-1][-1].append((T(option),False,False, [(SPAN(INPUT(_type=field.type), INPUT(_type=button,_value=T('add'), _onclick=w2p_build_search('+field.name+ +option+ ',this,event);)), False,False)]), *_class='NEW CLASS'*) I try this : https://mail.google.com/mail/?shva=1#search/add+class+to+menu/12fc24f2a966a78c That works to rename menu class, but can't add a class to the li() that contain the a() that contain the value to be search field and the add button. Richard On Fri, Oct 7, 2011 at 9:44 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Yeah I tried it... I said that need == because at least with the yesterday trunk single = didn't returns any result... By a la Access I mean the query builder that let you write SQL query by not writing SQL (you pick the table, then cross check the field, etc.)... I think the only difference is that it is multitable. I can have a look to improve the actual CSS you drop on for now. I was asking myself if it could be possible to implement a kind of REGEX search functionnality like Datatables... With Datatables grid search field you can put any character and the records are filtered base on the presence absence of each group of character or single character (not sure exactly). So for example, you can filter like this : 7.49 2010-09-09 That will return the rows that contain 7.49 value for the given date... It mays what you try to achieve with more power by allowing the possibility to the user to specify the exact columns he wants it value to be search. I try to improve the CSS. Ciao! Richard On Thu, Oct 6, 2011 at 5:19 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: My problem is the css. The rest we can discuss later. Anyway, field = value is correct. The search string is not DAL syntax, it is english. You can even write field equals value and otherfield starts with something without = and without quotes around values. We can add OR support later but AND is automatic. Did you try add two queries? I am not trying to copy Access. I am trying to create a pluggable and customizable way to built the search strings. Massimo On Oct 6, 2:28 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: I just think for 2 min about it... A popup grid seems to me the appropriate display for this query builder... Grid : Field to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button New row Maybe a 'AND' or 'OR' is needed for createria (between line) Maybe the table should just add a column at the begining when more then one creteria is entered user has to specify the AND or OR... So... AND/ORField to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button DropboxNew row Query completed (button) What about that?! jQuery UI dialog Richard On Thu, Oct 6, 2011 at 3:17 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: Ok, not exactly a la access... Pretty good I notice this : = create : name = 'something' should be name == 'something' I
[web2py] Re: Schema Changes in GAE
I was able to successfully added a field, filled with content and also renamed a field (add a filed, copy and then delete). If it would be of some use for others, here is how I did: Ref the below stackflow thread. Alex offers a simple solution. http://stackoverflow.com/questions/2906746/updating-model-schema-in-google-app-engine You write this code in migrate.py Then in app.yaml have a url like below: - url: /admin/migrate script: migrate.py You can choose the url (I choose /admin). Then launch the app call this url. Voila GAE DB modified. My modified app now lives on http://123-check.appspot.com/ Regards, Joseph
[web2py] Crazy problem !!
Dear All , i am making an E-learning application and am using auth.user.first_name but when i logout an error happens : type 'exceptions.AttributeError'('NoneType' object has no attribute 'first_name') this is the controller : def index(): example action using the internationalization operator T and flash rendered by views/default/index.html or views/generic.html meterials=db().select(db.addmaterial.ALL) metforteacher=db(db.addmaterial.techer==auth.user.first_name).select(db.addmaterial.ALL) return dict(meterials=meterials,metforteacher=metforteacher) what is happening ??
[web2py] Re: SELECT / OPTGROUP
Hello, I answer to myself, since it was not so complex ;) ... Oops! Hum hum ... Dominique In Controller: def search_form(): q = db(db.region.id==db.subregion.region).select(orderby=db.region.name | db.subregion.name) def prepare_select(rows): Creates a list to be used in the SELECT helper: ['Region A', OPTGROUP('SubRegion 1','SubRegion 2', 'SubRegion 3'), 'Region B', OPTGROUP('SubRegion 4','SubRegion 5', 'SubRegion 6')] l_r=[] for row in rows: r = row.region.name if row.region.name not in l_r: l_r.append(row.region.name) interm_list=[] for reg in l_r: l_sr=[] for row in rows: if reg == row.region.name: l_sr.append(row.subregion.name) interm_list.append((reg,l_sr)) res=[] for reg, l_sr in interm_list: res.append(reg) res.append(OPTGROUP(*l_sr)) return res form=FORM(TR(,SELECT(*prepare_select(q), **dict(_name='region_to_search', value=request.vars.requested_categ_name))), TR(,INPUT(_type=submit,_value=Search))) if form.accepts(request.vars, session, keepvalues=True): request.vars.requested_categ_name = form.vars.region_to_search response.flash=%s%form.vars.region_to_search return dict(form=form,)
Re: [web2py] SQLFORM.grid() problem - latest trunk
FYI - Created a whole new install of web2py from trunk and my problem went away. Sorry for the noise... -Jim On 10/6/2011 3:25 PM, Jim Steil wrote: Hi I installed the latest from trunk today and am now getting the following. Traceback(most recent call last): FileC:\dev\web2py\gluon\restricted.py,line194,inrestricted execccodeinenvironment FileC:/dev/web2py/applications/FoodPantry/controllers/default.py http://127.0.0.1:8000/admin/default/edit/FoodPantry/controllers/default.py,line155,inmodule FileC:\dev\web2py\gluon\globals.py,line149,inlambda self._caller=lambdaf:f() FileC:\dev\web2py\gluon\tools.py,line2467,inf returnaction(*a, **b) FileC:/dev/web2py/applications/FoodPantry/controllers/default.py http://127.0.0.1:8000/admin/default/edit/FoodPantry/controllers/default.py,line108,inparticipants ui='jquery-ui',csv=False,details=False) FileC:\dev\web2py\gluon\sqlhtml.py,line1868,insmartgrid user_signature=user_signature,**kwargs) TypeError:unbound method grid()must be called withSQLFORM instance as first argument(got Query instance instead) My call to the grid is: columns = ['member.firstName', 'member.lastName', 'member.city', 'member.state', 'member.phone', 'member.joinedOn', 'memberCampaign.campaignId', 'memberCampaign.amount', 'memberCampaign.paidOn', 'memberTag.tagId'] orderby = [db.member.lastName, db.member.firstName] db.memberCampaign['_plural'] = 'Campaigns' db.memberTag['_plural'] = 'Tags' grid = SQLFORM.smartgrid(db.member, columns=columns, details=False, ui='jquery-ui', csv=False) return dict(grid=grid) Any thoughts on what might be causing this. Worked fine up until today. -Jim -- Jim Steil VP of Information Technology Quality Liquid Feeds, Inc. 608.935.2345 office 608.341.9896 cell
Re: [web2py] Crazy problem !!
after logout auth.user is null (None) so accessing auth.user.first_name gives you this error
[web2py] Re: Crazy problem !!
So what to do ??
[web2py] Re: new feature - need help
Thanks will look at it asap. On Oct 7, 12:06 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: On Fri, Oct 7, 2011 at 1:00 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: and change in sqlhtml the init call for the query of superfish... Richard On Fri, Oct 7, 2011 at 12:59 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Oh forget to mention... It needs that we fork superfish.css and js and rename every class in superfish.css and their call in superfish.js... It's not pretty nice but it allow to play with the query builder... I not convinced with a menu a proper ui for a query builder since when your mice fall outside the menu everything unwrap and you have to start everything over... Richard On Fri, Oct 7, 2011 at 12:50 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Finally find a little fix so you can play with the query builder with a correct superfish display (pretty ugly) but... Add this to base.css : .web2py-menu-expand .sfHover { width: 275px; } .web2py-menu-vertical li a input { margin: 5px; } Change this in superfis.css : .sf-menu-query ul { width: *275px*; /* left offset of submenus need to match (see below) */ ul.sf-menu-query li li.sfHover-query ul { left: *275px*; /* match ul width */ ul.sf-menu-query li li li:hover ul, ul.sf-menu-query li li li.sfHover-query ul { left: *275px*; /* match ul width */ It should make the each menu level 275px so the last level will be displaying the input and add button on the same line with the appropriate background. Hope I didn't forget anything... Richard On Fri, Oct 7, 2011 at 12:22 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Massimo, I need a class somewhere here, but can't find how to insert it : for option in options: menu[-1][-1].append((T(option),False,False, [(SPAN(INPUT(_type=field.type), INPUT(_type=button,_value=T('add'), _onclick=w2p_build_search('+field.name+ +option+ ',this,event);)), False,False)]), *_class='NEW CLASS'*) I try this : https://mail.google.com/mail/?shva=1#search/add+class+to+menu/12fc24f... That works to rename menu class, but can't add a class to the li() that contain the a() that contain the value to be search field and the add button. Richard On Fri, Oct 7, 2011 at 9:44 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Yeah I tried it... I said that need == because at least with the yesterday trunk single = didn't returns any result... By a la Access I mean the query builder that let you write SQL query by not writing SQL (you pick the table, then cross check the field, etc.)... I think the only difference is that it is multitable. I can have a look to improve the actual CSS you drop on for now. I was asking myself if it could be possible to implement a kind of REGEX search functionnality like Datatables... With Datatables grid search field you can put any character and the records are filtered base on the presence absence of each group of character or single character (not sure exactly). So for example, you can filter like this : 7.49 2010-09-09 That will return the rows that contain 7.49 value for the given date... It mays what you try to achieve with more power by allowing the possibility to the user to specify the exact columns he wants it value to be search. I try to improve the CSS. Ciao! Richard On Thu, Oct 6, 2011 at 5:19 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: My problem is the css. The rest we can discuss later. Anyway, field = value is correct. The search string is not DAL syntax, it is english. You can even write field equals value and otherfield starts with something without = and without quotes around values. We can add OR support later but AND is automatic. Did you try add two queries? I am not trying to copy Access. I am trying to create a pluggable and customizable way to built the search strings. Massimo On Oct 6, 2:28 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: I just think for 2 min about it... A popup grid seems to me the appropriate display for this query builder... Grid : Field to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button New row Maybe a 'AND' or 'OR' is needed for createria (between line) Maybe the table should just add a column at the begining when more then one creteria is entered user has to specify the AND or OR... So... AND/OR Field to search Wich type of constrainer Searched value Add createria button Drop box =, , , etc. User input + button Dropbox New row Query completed
[web2py] Re: Crazy problem !!
two problems with this: db.addmaterial.techer==auth.user.first_name auth.user exists only if the user is logged in so your actions should @auth.requires_login() the other problem is it is not a idea to denormalize by storing the user first_name into db.addmaterial.teacher. You should reference users by ID. On Oct 7, 1:50 pm, Web2Py Freak halna...@gardeniatelco.com wrote: So what to do ??
Re: [web2py] Re: Help for creating template
this is my controller from gluon.tools import Crud crud = Crud(db) def index(): form=SQLFORM(db.poruke,fields=['poruka','post_author']) if form.accepts(request.vars,session): session.flash=new post accepted! redirect(URL(r=request)) poruke=db().select(db.poruke.ALL) return dict(form=form,poruke=poruke) def people(): crud.settings.formstyle = ('divs') form = crud.create(db.person,next=URL('people'),message=T(record created)) persons = crud.select(db.person,fields=['name'],headers={'name': 'Name'}) return dict(form = form,persons=persons) def user(): auth.settings.formstyle = ('divs') return dict(form=auth()) this is my layout !DOCTYPE html html head titleWeb2Py/title /head body {{try:}}{{=auth.navbar(action=URL('default','user'))}}{{except:pass}}br / {{include}} div class=sidebar {{block mysidebar}} default sidebar {{end}} /div div class=ez-box id=footer {{=T('Copyright')}} © 2010 - {{=T('Powered by')}} a href=http://www.web2py.com;web2py/a /div /body /html this is my view {{extend 'layout.html'}} {{for poruke in poruke:}} {{if poruke.post_author:}} {{=poruke.post_author}} says {{=poruke.poruka}} br / {{else:}} Anonymous says {{=poruke.poruka}}br / {{pass}} {{pass}} {{=form}} {{include 'test.html'}} {{block mysidebar}} my block {{end}} How t make implementation of response http://web2py.com/book/default/docstring/response.menu = [('Google', False, 'http://www.google.com',[]), ('Index', True, URL http://web2py.com/book/default/docstring/URL('index'), [])] * * - - Miroslav Gojic - - On Fri, Oct 7, 2011 at 18:58, Anthony abasta...@gmail.com wrote: On Friday, October 7, 2011 1:31:08 AM UTC-4, miroslavgojic wrote: Thanks for blocks - that work, this is similar to modules in joomla, I can write small block and get content on specific place at layout. I tray to use next code: response http://web2py.com/book/default/docstring/response.menu = [('Google', False, 'http://www.google.com',[]), ('Index', True, URL http://web2py.com/book/default/docstring/URL('index'), [])] but without any success. I reed in book that mentioned code I must put in controller but how to get same than in layout and does in controller I must use definition or haw. Can you show the relevant controller and view code related to the menu? What do you expect to see, and what do you actually see? Note, typically you would pass response.menu to the MENU() helper, which will turn it into a nested unordered list, which can then be styled/displayed as a menu via CSS and/or Javascript (e.g., the 'welcome' app uses the Superfish Javascript menu). Anthony
[web2py] Re: Windows + Apache + mod_proxy
Paolo, You gave me a hope because it looks you tried it recently and it's very similar to my environment. (Is your OS Windows 7, XP, or Windows Server ??) My environment: OS: Windows 7 SP1 - 32bit Python: 2.7.2 Apache: httpd-2.2.21-win32-x86-openssl-0.9.8r.msi mod_wsgi: mod_wsgi-win32-ap22py27-3.3.so pyodbc: pyodbc-2.1.11.win32-py2.7.exe pywin32: pywin32-216.win32-py2.7.exe I was keep thinking what makes the difference. I know you use Uniform Server but the version of apache included is the same as mine. So it should be the same. Only possible difference is an apache config, The below is the part of httpd.conf let me know if you find anything wrong. It's running fine except pyodbc cannot make connection to mssql/db2 under wsgi but it does connect under Rocket server and console. = NameVirtualHost *:80 VirtualHost *:80 DocumentRoot C:/web2py/applications ServerName ochba-183 Directory C:/web2py Order allow,deny Deny from all /Directory Location / Order deny,allow Allow from all /Location LocationMatch ^(/[\w_]*/static/.*) Order Allow,Deny Allow from all /LocationMatch WSGIScriptAlias / C:/web2py/wsgihandler.py /VirtualHost NameVirtualHost *:443 VirtualHost *:443 DocumentRoot C:/web2py/applications ServerName ochiba-183 Directory C:/web2py Order allow,deny Deny from all /Directory Location / Order deny,allow Allow from all /Location LocationMatch ^(/[\w_]*/static/.*) Order Allow,Deny Allow from all /LocationMatch WSGIScriptAlias / C:/web2py/wsgihandler.py SSLEngine On SSLCertificateFile conf/server.crt SSLCertificateKeyFile conf/server.key /VirtualHost On Oct 6, 6:47 pm, Paolo Caruccio paolo.carucci...@gmail.com wrote: The following istructions have been adapted fromhttp://jdoe.asidev.com/2009/02/26/configure-web2py-to-run-behind-apac... for my dev enviroment Windows + Apache + mod_wsgi. I succesfully tested connection to db2 express from IMB through pyodbc. Maybe it could help you. I premise that I'm not a programmer and computer development is an hobby for me, so my support will be very poor. Below enviroment has been used for development only, not in production. PREREQUISITES: python 2.7 installed on Windows STEP A - webserver preparation [http://sourceforge.net/projects/ miniserver/files/Uniform%20Server/7.1.11-Orion/] a1 - download and install uniformserver; a2 - after installation, access to the server administrator panel and SECURE all entries in the Server Security page; a3 - generate a new SSL certificate by Tools Server Key Cert Gen link on right sidebar; a4 - create a certificate signed by our CA using UniServer_CA_1.0 plugin [http://sourceforge.net/projects/miniserver/files/Plugins/ UniServer_CA/]; a5 - replace the files created in the a3 step in X:\UniServer\usr\local \apache2\conf folder ( X is the drive where uniformserver has been installed ); a6 - install new certificate in Trusted Certification Authorities. Usually I put ca.crt file in main folder of my website, start the server, and by browser go tohttp://localhost/ca.crt ( replace localhost with website name to simulate real situation ) and install the certificate following browser instructions; a7 - start the server and check that https pages are accessible without certificate errors. Notes: when upgrade the server simply copy in their folders on the new server the SSL files created in the previous version of the server STEP B - mod_wsgi [http://code.google.com/p/modwsgi/wiki/ DownloadTheSoftware?tm=2] b1 - download Windows binary selecting the correct one for the version of Python and Apache that is being used ( I use mod_wsgi-win32- ap22py27-3.3.so - Apache 2.2 / Python 2.7 ); b2 - stop UniServer, rename downloaded file in mod_wsgi.so and put it in X:\UniServer\usr\local\apache2\modules folder ( X is the drive where uniformserver has been installed ); b3 - add to X:\UniServer\usr\local\apache2\conf\httpd.conf file following row: LoadModule wsgi_module modules/mod_wsgi.so( without quotation marks ); b4 - restart UniServer and check that mod_wsgi is succesfully installed. Notes: when upgrade the server repeat the step B STEP C - web2py (for sure you know where download it) c1 - download web2py source code and unzip it in X:\UniServer\www folder ( X is the drive where uniformserver has been installed ); c2 - stop UniServer, start web2py server in standard way by double clicking X:\UniServer\www\web2py\web2py.py in order that it create its own files (don't change default settings); c3 - stop web2py server and check that in web2py folder there are options_std.py e parameters_8000.py; c4 - open options_std.py and make sure of row password = 'recycle' is present; c5 - create following symlinks (only in windows7 by mklink command or using Symlink Creator [http://code.google.com/p/symlinker/
[web2py] Flash message: You are being redirected a href=app_namehere/a
Whenever I use redirect after a form submission, the flash message is always: You are being redirected a href=app_namehere/a I have tried setting response.flash and session.flash, but this message always pops up after the page is refreshed. This is really annoying. At the end of http.py, I see that the redirect raises an HTTP exception. Is there a better way to do this so that it doesn't pop a flash message when the redirect is completed? Thanks
[web2py] Re: manual file upload using SQLFORM.factory
I'm happy the upload works for you Alex. do I have to take care about directory traversals and other security risks? What's the easiest way to do this? As I understand it the store() renaming of the file is what takes care of the dir traversal protection. I'm not a web2py dev so don't quote me on that. Perhaps you lot can confirm? David
Re: [web2py] Re: Help for creating template
See http://web2py.com/book/default/chapter/05#Custom-Helpers for details on using the MENU helper. You can see an example of using it in conjunction with Superfish (which is a Javascript library that turns the list structure generated by MENU into a dynamic menu) in the 'welcome' app: http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#102 Anthony On Friday, October 7, 2011 3:08:37 PM UTC-4, miroslavgojic wrote: this is my controller from gluon.tools import Crud crud = Crud(db) def index(): form=SQLFORM(db.poruke,fields=['poruka','post_author']) if form.accepts(request.vars,session): session.flash=new post accepted! redirect(URL(r=request)) poruke=db().select(db.poruke.ALL) return dict(form=form,poruke=poruke) def people(): crud.settings.formstyle = ('divs') form = crud.create(db.person,next=URL('people'),message=T(record created)) persons = crud.select(db.person,fields=['name'],headers={'name': 'Name'}) return dict(form = form,persons=persons) def user(): auth.settings.formstyle = ('divs') return dict(form=auth()) this is my layout !DOCTYPE html html head titleWeb2Py/title /head body {{try:}}{{=auth.navbar(action=URL('default','user'))}}{{except:pass}}br / {{include}} div class=sidebar {{block mysidebar}} default sidebar {{end}} /div div class=ez-box id=footer {{=T('Copyright')}} © 2010 - {{=T('Powered by')}} a href=http://www.web2py.com;web2py/a /div /body /html this is my view {{extend 'layout.html'}} {{for poruke in poruke:}} {{if poruke.post_author:}} {{=poruke.post_author}} says {{=poruke.poruka}} br / {{else:}} Anonymous says {{=poruke.poruka}}br / {{pass}} {{pass}} {{=form}} {{include 'test.html'}} {{block mysidebar}} my block {{end}} How t make implementation of response http://web2py.com/book/default/docstring/response.menu = [('Google', False, 'http://www.google.com',[]), ('Index', True, URL http://web2py.com/book/default/docstring/URL('index'), [])] * * - - Miroslav Gojic - - On Fri, Oct 7, 2011 at 18:58, Anthony abas...@gmail.com wrote: On Friday, October 7, 2011 1:31:08 AM UTC-4, miroslavgojic wrote: Thanks for blocks - that work, this is similar to modules in joomla, I can write small block and get content on specific place at layout. I tray to use next code: response http://web2py.com/book/default/docstring/response.menu = [('Google', False, 'http://www.google.com',[]), ('Index', True, URL http://web2py.com/book/default/docstring/URL('index'), [])] but without any success. I reed in book that mentioned code I must put in controller but how to get same than in layout and does in controller I must use definition or haw. Can you show the relevant controller and view code related to the menu? What do you expect to see, and what do you actually see? Note, typically you would pass response.menu to the MENU() helper, which will turn it into a nested unordered list, which can then be styled/displayed as a menu via CSS and/or Javascript (e.g., the 'welcome' app uses the Superfish Javascript menu). Anthony
[web2py] Re: Why showing a log in option inside of the admin interface
More and more bizarre... In the last post I mentioned the difference in behavior between Firefox and chromium. Well that difference is only occurring when using webfaction. On a local server, it all works perfectly fine, chromium or not!? I am getting a bit desperate here. I am a newbie when it comes to webfaction/web2py/uwsgi and I can't ascertain where the problem is? Webfaction, web2py, uwsgi or ?
[web2py] Re: Google Cloud SQL
Even I am also exited for that, You have already told me regarding GAE +SQL(tested) but i could not understand. Day before yesterday i got this information and i found my solution for ERP. Also along with that Hangout API also i found good that also i want to use in my system. Massimo shell we have demo on hangout or skype and discuss on webinar. On Oct 6, 6:34 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I guess this finally relieves me from the non-disclosure agreement ;-) web2py has already been running on GAE+SQL since March: http://web2py-tests.appspot.com/mysql/tests All web2py apps can now run GAE. Just use a connection string like: DAL('google:sql://gmailcom:web2pytests/guestbook') including: - migrations - all types of web2py queries (or, joins, like, etc.) - transactions By the week-end I will post a more detailed howto. If you have used web2py to build your apps, this is the moment it pays off. Massimo On Oct 6, 6:29 pm, pbreit pbreitenb...@gmail.com wrote: http://googlecode.blogspot.com/2011/10/google-cloud-sql-your-database...
[web2py] Re: Sharing a database between apps
:)
[web2py] html comments within conditional comments
Using 1.99.2 'layout.html' has the following conditional comment... !--[if IE] !-- Always force latest IE rendering engine (even in intranet) Chrome Frame Remove this if you use the .htaccess -- meta http-equiv=X-UA-Compatible content=IE=edge,chrome=1 ![endif]-- I may be wrong, but I think the regular html comment contained in the conditional comment could cause premature closing. Perhaps this would be better !-- Always force latest IE rendering engine (even in intranet) Chrome Frame Remove this if you use the .htaccess -- !--[if IE] meta http-equiv=X-UA-Compatible content=IE=edge,chrome=1 ![endif]--
[web2py] Re: html comments within conditional comments
I agree. Uploading to trunk. On Oct 7, 8:55 pm, Bob St John bobinco...@gmail.com wrote: Using 1.99.2 'layout.html' has the following conditional comment... !--[if IE] !-- Always force latest IE rendering engine (even in intranet) Chrome Frame Remove this if you use the .htaccess -- meta http-equiv=X-UA-Compatible content=IE=edge,chrome=1 ![endif]-- I may be wrong, but I think the regular html comment contained in the conditional comment could cause premature closing. Perhaps this would be better !-- Always force latest IE rendering engine (even in intranet) Chrome Frame Remove this if you use the .htaccess -- !--[if IE] meta http-equiv=X-UA-Compatible content=IE=edge,chrome=1 ![endif]--
[web2py] Mail credentials, recaptcha keys, and privacy/security
It struck me that my recaptcha keys and mail password are stored in db.py as plain text. At least under fluxflex hosting this file is stored in public_html. Am I right that this poses a privacy and security problem, or am I missing a safety feature? I'm also wondering about this kind of information in the app files when I upload them to my (public) github repo. How do people handle obscuring that private information without crippling the app on the repository? As you can tell I'm new to a lot of this. Thanks. Ian
[web2py] Re: Mail credentials, recaptcha keys, and privacy/security
Without elaborate security schemes, it's probably going to be in plain text somewhere. The first alternative is to put it in a file with limited permissions.
[web2py] Re: Schema Changes in GAE
yes, i import the GAE libraries into a web2py controller and run my migrations as web2py controllers (so i can use a mix of DAL and GAE). your method below is also valid.
[web2py] Re: Why showing a log in option inside of the admin interface
Anthony, I do not find it very re-assuring that I have to get to that level of understanding of the framework in order to be able to complete an evaluation of the product. I am not sure if I can really afford the amount of time and effort for an evaluation stage only, with no more to proceed with. It looks a bit too ambitious for an old man! :) Thanks anyway Michel
[web2py] Re: Why showing a log in option inside of the admin interface
I understand your concern but will note that in a year and a half, Ive never seen this problem mentioned. It sounds like either your sessions are not getting written to disk. As Anthony suggested, double check /sessions to make sure you see some files there. Try deleting all of them and then accessing admin again. Make sure that directory is writable and/or owned by the correct owner (root, www-data, etc). The other thing is if cookies are getting blocked for some reason. Could be a Firefox security setting blocking mixed security cookies or third party cookies. Unfortunately, Python deployment remains tricky, especially on shared hosting.
[web2py] Re: Why showing a log in option inside of the admin interface
Well, maybe try a different host and/or different web server. On Saturday, October 8, 2011 12:37:30 AM UTC-4, MidGe wrote: Anthony, I do not find it very re-assuring that I have to get to that level of understanding of the framework in order to be able to complete an evaluation of the product. I am not sure if I can really afford the amount of time and effort for an evaluation stage only, with no more to proceed with. It looks a bit too ambitious for an old man! :) Thanks anyway Michel
[web2py] Re: Flash message: You are being redirected a href=app_namehere/a
That should not happen as far as I know. What does your code look like?
[web2py] Re: Cannot serve any pages after fresh install of Python2.5
Thanks for the advice, pbreit and Christopher! I will give a fresh Ubuntu 10.04 install a spin :)!
[web2py] Re: Google Cloud SQL
Massimo, I am creating a photo gallery application and have questions in regard to Google Cloud SQL. Do you have any best-practice advice on storing images in GAE when using SQL? Should it go in the database as a blob or should it be stored as a blob property in the Google datastore? Thanks, Kurt On Oct 6, 7:34 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I guess this finally relieves me from the non-disclosure agreement ;-) web2py has already been running on GAE+SQL since March: http://web2py-tests.appspot.com/mysql/tests All web2py apps can now run GAE. Just use a connection string like: DAL('google:sql://gmailcom:web2pytests/guestbook') including: - migrations - all types of web2py queries (or, joins, like, etc.) - transactions By the week-end I will post a more detailed howto. If you have used web2py to build your apps, this is the moment it pays off. Massimo On Oct 6, 6:29 pm, pbreit pbreitenb...@gmail.com wrote: http://googlecode.blogspot.com/2011/10/google-cloud-sql-your-database...
[web2py] remove login from navbar
hello one and all, how do i direct auth to remove the login link from the navbar? i already tried auth.settings.actions_disabled.append('login') like you would to remove register, but that didn't seem to work. ideas? thank you in advance. lucas