[web2py] Re: EC2 Ubuntu Install without Apache

2012-12-09 Thread Richard Shea
I suspect that what I've got to tell you is not all that useful as I just wanted to try out web2py and using EC2 was an easy way of doing it. I don't have any longterm need to run it on EC2. Like you I didn't really want to get involved in using Apache but I did use the script you reference

[web2py] Re: EC2 Ubuntu Install without Apache

2012-12-09 Thread Richard Shea
Sorry my last attempt at a reply was poorly formatted ... here's another attempt : I suspect that what I've got to tell you is not all that useful as I just wanted to try out web2py and using EC2 was an easy way of doing it. I don't have any longterm need to run it on EC2. Like you I didn't

[web2py] Re: Allowing external access to web2py server ?

2012-12-09 Thread Richard Shea
Thank you Massimo. On Saturday, December 8, 2012 5:52:28 AM UTC+13, Massimo Di Pierro wrote: python web2py.py -a passwd -i 0.0.0.0 -p 80 On Friday, 7 December 2012 03:21:55 UTC-6, Richard Shea wrote: I want to start a web2py server so that it can be accessed externally to the hosting

[web2py] what is wrong with this function in view

2012-12-09 Thread yashar
i get syntax error for the first 'elif', i tried if pass, if pass... but i wasnt able to escape error, what is wrong? {{ def populate_row(value): currency_map={'U':'USD','E':'Euro','P':'Pound'} if value: currency = value[-1:].upper() value = int(value[:-1]) pass if (value 0 and currency == 'B')

[web2py] Re: Ref: custom form issue

2012-12-09 Thread yashar
insert like this: {{form.insert(0,my_extra_element)}} return like this: {{=form[0]}} if this solve your problem. --

[web2py] Re: what is wrong with this function in view

2012-12-09 Thread Niphlod
def populate_row(value): currency_map={'U':'USD','E':'Euro','P':'Pound'} if value: currency = value[-1:].upper() value = int(value[:-1]) pass if (value 0 and currency == 'B'): return XML('td%s/tdtd/tdtd/tdtd/td'%value) elif ( value 0 and currency ==

[web2py] Re: unit of work support in DAL

2012-12-09 Thread Niphlod
It is conceivable that multiple update records on a single entry be done, due to complex conditions (e.g. under certain conditions, you update stock but not description, etc.) Since web2py either commits or rollbacks at the end of each request, all the works are done then. Therefore,

[web2py] impersonate broken

2012-12-09 Thread weheh
Since upgrading to web2py 2.x from 1.9x.x, (I'm running 2.2.1 stable from source) auth.impersonate isn't working for me any more. My controller user.py has an impersonate action that calls auth.impersonate (first bold line below): @auth.requires_login() def impersonate(): user_id =

[web2py] Re: what is wrong with this function in view

2012-12-09 Thread yashar
it works, thank you. --

[web2py] Re: Unexpected content in error file name -- can anyone explain? (and possible security concern)

2012-12-09 Thread Chris
1.99.7, running from source on Red Hat EL 6 --

[web2py] Re: unit of work support in DAL

2012-12-09 Thread VP
I don't quite understand how this works. That's why I am asking a question if webp2y supports this so-called feature called Unit of Work, something that SQLAlchemy supports. It is possible that this concept does not apply to web2py DAL. I don't know. I have a feeling you are defensive

[web2py] Re: impersonate broken

2012-12-09 Thread Massimo Di Pierro
I believe this is fixed in the nightly built. On Sunday, 9 December 2012 07:44:45 UTC-6, weheh wrote: Since upgrading to web2py 2.x from 1.9x.x, (I'm running 2.2.1 stable from source) auth.impersonate isn't working for me any more. My controller user.py has an impersonate action that calls

[web2py] Re: Unexpected content in error file name -- can anyone explain? (and possible security concern)

2012-12-09 Thread Massimo Di Pierro
This should no longer be a problem in 2.2.x. The spoofed requests should be rejected. On Sunday, 9 December 2012 09:15:07 UTC-6, Chris wrote: 1.99.7, running from source on Red Hat EL 6 --

[web2py] Re: unit of work support in DAL

2012-12-09 Thread Massimo Di Pierro
Hello VP, niphlod is right. It does not apply to the DAL only to ORMs. Another way to put it, the DAL does not have it because it is contrary to the DAL philosophy. The SQLA docs (http://www.sqlalchemy.org/features.html) say SQLAlchemy's Object Relational Mapper (ORM), organizes pending

[web2py] Re: Basic access control

2012-12-09 Thread dbv
Need email + password only for authentication and authorization. Each user represents an entity (organization) defined by their unique email + password combination. A user has no role defined and if there were a default role defined internally in web2py it would be the same for all users.

[web2py] Re: EC2 Ubuntu Install without Apache

2012-12-09 Thread dbv
Thanks Richard. We use WinSCP + PuTTy and so your instructions make sense. It would be good to get confirmation from the moderators as I suspect it must be a common request these days to access EC2 from a remote Windows or Mac (as well as not wanting Apache!). --

[web2py] New use for detect_record_change=True?

2012-12-09 Thread Joe Barnhart
I've been investigating the use of the DAL feature detect_record_change=True. Apparently it was conceived as a way of detecting when the record in the database has changed since the form was originally built and populated. My need is for a way to detect when the USER has changed fields in

[web2py] Re: Basic access control

2012-12-09 Thread Anthony
Still not sure what the problem is. Are you saying all users have the same permissions? If so, then you don't need to bother with roles or permissions at all -- just verify that the user is logged in in order to control access. If something in the session is needed to determine access, then you

Re: [web2py] Login button should say Login...

2012-12-09 Thread Anthony
I'm not advocating for a change, just suggesting that if we're going to make one anyway, Sign in might be preferable. Anthony On Saturday, December 8, 2012 10:36:59 PM UTC-5, Massimo Di Pierro wrote: I like this better than Log In. Yet we would have to change it in a lot of places. On

[web2py] session.clear() does not seem to work

2012-12-09 Thread simon
How do I clear the session storage object? Controller as below. Call setsession and it sets session.temp and shows all the session variables. If I call clearsession then it shows a page with an empty storage object as if it had cleared the session object. However if I then call showsession

[web2py] Re: New use for detect_record_change=True?

2012-12-09 Thread Massimo Di Pierro
Something like this? form=SQLFORM(db.table,record_id) if form.process(dbio=False).accepted: if any(v!=form.record[k] for k,v in form.vars.iteritems()): record_has_changed else: record_has_NOT_changed On Sunday, 9 December 2012 10:51:14 UTC-6, Joe Barnhart wrote: I've

[web2py] Re: session.clear() does not seem to work

2012-12-09 Thread Massimo Di Pierro
I think you found a bug. This bug was introduced recently as result of optimization. I will fix it today and it will be gone by the next stable release. On Sunday, 9 December 2012 12:22:34 UTC-6, simon wrote: How do I clear the session storage object? Controller as below. Call setsession

[web2py] Noob to web2py question about importing data.

2012-12-09 Thread len
I have data in an old cobol legacy system using ISAM files two of the files are customer and sales_history. There is a relationship between these two files based on customer_id which is auto incremented in the legacy system by add 1 to the last customer_id used. I already have a python

[web2py] problem with matplotlib

2012-12-09 Thread Ralph
I'm trying to setup a server with apache 2.2, wsgi_mod and web2py. So far it works until I choose in the app wizard the matplotlib pluging. I'm getting a type 'exceptions.ImportError' No module named matplotlib.backends.backend_agg I tried then to run the plugin file direct with the python

[web2py] Re: Basic access control

2012-12-09 Thread dbv
Not a problem per se but request for clarification which has been provided ie. all users have the same permission and so don't need a role to be defined. Working through the book examples and should be done soon. Thanks! --

[web2py] Re: New use for detect_record_change=True?

2012-12-09 Thread Niphlod
This is something I faced building w2p_tvseries. There is a page with several tabs and I needed to tell the user to remember to save the changes before going elsewhere.. What I knew already was that this has to be done client-side: you can't - yep, some ajax post hooked up to the unload

[web2py] Re: problem with matplotlib

2012-12-09 Thread Niphlod
did you search on google first ? this is usually an issue with mod_wsgi and maplotlib. In this group you can find several replies already, including https://groups.google.com/forum/#!topic/modwsgi/97bnQk9ojtY On Sunday, December 9, 2012 6:23:28 PM UTC+1, Ralph wrote: I'm trying to setup a

[web2py] Re: Noob to web2py question about importing data.

2012-12-09 Thread Massimo Di Pierro
Sounds like a good plan. You will still need to db.define_table(, migrate=False) The migrate=False to tell web2y the table already exists. On Sunday, 9 December 2012 12:25:48 UTC-6, len wrote: I have data in an old cobol legacy system using ISAM files two of the files are customer and

[web2py] Re: Basic access control

2012-12-09 Thread Anthony
Also, if you specify auth.settings.everybody_group_id='[a group name]', a role with that name will be created, and everyone will be assigned to it by default. That way, you can use the auth.requires_membership() decorator and specify that role, even if you want to allow access to everyone with

[web2py] Re: session.clear() does not seem to work

2012-12-09 Thread Massimo Di Pierro
This is now fixed in trunk and nightly. Thanks for reporting this nasty problem. Massimo On Sunday, 9 December 2012 12:43:14 UTC-6, Massimo Di Pierro wrote: I think you found a bug. This bug was introduced recently as result of optimization. I will fix it today and it will be gone by the

[web2py] Adding a button to a form and adding an action

2012-12-09 Thread Daniele
Hello guys, I'm trying to add a button to a form and when clicked, I'd like for an action to be called that erases a record from the db. I saw the butting addition can be done with form.add_button('Delete Record', URL('other_page')) However, I am wondering how I can tie in an action instead of

[web2py] Code changes not honored (by web2py?)

2012-12-09 Thread Chr_M
Sometimes the changes in the code of a module (in the modules directory) are not working when requesting the url that uses these modules. in the modules directory I have a subdirectory with python files that form a package (__init__.py file in this subdirectory). I have added from

[web2py] Re: Displaying an image

2012-12-09 Thread Daniele
The uploads seem to be working now, but I still can't figure out how to display them. I have a line in my controller that gets the images in the database: images = [row.t_Image for row in db().select(db.tutor.ALL)] which I can access in the view with {{=images}} Buthow do i get those

[web2py] Re: Displaying an image

2012-12-09 Thread Daniele
WOHO!!! I GOT IT!!! I needed to put URL('download', args=images[0]) I was spending time trying to figure out what the heck that request.args[-1]thing was. Is that even necessary? On Wednesday, December 5, 2012 2:06:57 PM UTC, Daniele wrote: Guys I know this sounds simple but I'm

[web2py] Re: Code changes not honored (by web2py?)

2012-12-09 Thread Massimo Di Pierro
This has come up before. from gluon.custom_import import track_changes; track_changes() must be a model file, before the modules are imported, not in the modules themselves which are otherwise cached and therefore the line may or may not be executed. Massimo On Sunday, 9 December 2012

[web2py] Unexposed Action?

2012-12-09 Thread David Tucker
Is there a way to add a private function that isn't exposed/accessible via URL to a controller? I imagine there is a way to do this with routes, and I know it can be done with modules; however, I have only a single, short method that is repeated in multiple actions in the same controller and do

[web2py] Re: Unexposed Action?

2012-12-09 Thread Massimo Di Pierro
There are three ways: - function takes arguments - function name is prefixed by __ - there is a space between the function name and (). (*) I do not like (*) very much and I cannot really promise will stay in the future since it is not documented. Massimo On Sunday, 9 December 2012 14:51:52

[web2py] Re: onaccept in CRUD

2012-12-09 Thread Kenneth
Hi, I converted the problematic row ( row = db(db.assets.asset_id == form.vars.id).update(asset_name = form.request_vars.asset_name_2) ) into normal SQL and used it on the database directly, works fine. I made a static version of the same row ( row = db(db.assets.asset_id ==

[web2py] Re: New use for detect_record_change=True?

2012-12-09 Thread Paolo Caruccio
For update forms I used the following strategy (maybe hackish but it does its dirty work) The submit button is disabled at start. I added (by the controller) to each form control: - an attribute initval containing the stored value - an attribute isdirty with default = false - an event onchange

Re: [web2py] Re: web3py?

2012-12-09 Thread Ovidio Marinho
look is this http://ovidiomfalcao.wordpress.com/2011/10/24/web2py-ja-roda-em-python3-web2py-py3k/ Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826

[web2py] Login form in sidebar

2012-12-09 Thread Vixus
Hi, I've made a customised login form that gets displayed in the sidebar like so: def mini_login(form): for lbl in form.elements(label): lbl[_style] = display:none form.element(_name=email)[_placeholder] = Email Address form.element(_name=email)[_class] = btn-block

[web2py] Re: Displaying an image

2012-12-09 Thread Anthony
I was spending time trying to figure out what the heck that request.args[-1] thing was. Is that even necessary? request.args[-1] simply refers to the last arg in the URL (which in this case is the only arg). Anthony --

[web2py] Re: New use for detect_record_change=True?

2012-12-09 Thread Joe Barnhart
Wow, I wish I could mark all of you as best answer. Massimo -- I was thinking at lunch and wondered if I can calculate the same hash function on the form vars in the browser. I suppose I could at least create a server callback that takes the form.vars and uses the same hashing function to

[web2py] Re: impersonate broken

2012-12-09 Thread weheh
I tried running nightly build, but web2py wouldn't start: Traceback (most recent call last): File N:\eclipse\plugins\org.python.pydev.debug_2.4.0.2012020116\pysrc\pydevd.py, line 3, in module import pydev_imports File

[web2py] high availability

2012-12-09 Thread Oli
could this be a part of w2p. http://sqlrelay.sourceforge.net/documentation.html --