I was happy to find that I could do 'from gluon import current' in my
modules, and get access to the various treasures that lie within ;)
Recently I went to try and run epydoc on my modules directory, so that I
could have some doc while writing code, and discovered that epydoc gets an
error
: Unexpected error:class
'applications.gw.modules.CustomException.CustomException'
The two classes match, yet I cannot catch the exception.
I hope somebody can point out the error of my ways...
Ed Greenberg
I have to point out that my line
except CustomException.CustomException:
was earlier just
except CustomException:
The first version was an attempt during testing, and was accidentally
pasted into the message.
I've also tried
except CustomException as e:
and
except CustomException,
I create lots of modules which need to interact with my app. I've
been passing things into them and wonder if I'm doing the simplest and
best practice:
aObj=local_import(a,reload=True)
a=aObj(db,auth,settings,session,module_specific_params)
Then, in the class, I use them as self.settings.foo
I feel like I should know this. I've searched, but Google doesn't
really allow for the word in as it's too short and common.
I'd like to do select column in (a,b) in the dal. Any idea how?
Thanks,
Ed
belongs() Thanks.
On Feb 11, 7:09 am, Marin Pranjić marin.pran...@gmail.com wrote:
http://web2py.com/books/default/chapter/29/6#belongs
Marin
On Sat, Feb 11, 2012 at 12:34 PM, Ed Greenberg greenberg...@gmail.comwrote:
I feel like I should know this. I've searched, but Google
I have some html files which I want to render inside the layout.
Something like this:
{{extend 'layout.html'}}
div id=homeContent
content goes here
/div
All it needs is an empty dict, since it won't look for anything from
the controller to customize it.
I put this file in
Using the DAL, I'd like to select records that are less than some
interval old, or newer than a certain date. My records have a
datetime field in them.
So I want something like:
select * from table where mydate (now()-interval 1 day)
Can I do this in the dal, or do I have to use raw sql?
20, 4:37 pm, Ed Greenberg greenberg...@gmail.com wrote:
I happened upon this old thready from
2009:https://groups.google.com/group/web2py/browse_thread/thread/cc13960a5...
But unfortunately, the link to the code has become 404 and the thread
has died.
Is anybody using the module
what had previously been found at http://www.box.com/shared/dtm0dhgze9
Did it work?
Many thanks
Ed Greenberg
I have a table of US phone numbers in ten digit form. When I store
them, I take out all non-numeric characters using:
def cleanUpNumber(number):
return re.sub(r'\D',,number)[-10:]
I use a FORM() to get the numbers. Not a SQLFORM or CRUD.
I would like to use IS_NOT_IN_DATABASE(...) to make
',
requires=lambda v: IS_NOT_IN_DB(db,
'yourtable.phone')(cleanUpNumber(v
Anthony
On Saturday, October 8, 2011 8:10:51 AM UTC-4, Ed Greenberg wrote:
I have a table of US phone numbers in ten digit form. When I store
them, I take out all non-numeric characters using
Looking at the code to gluon.dal.Rows.export_to_csv(), it does not
seem possible to suppress the header on the first line. Is there a
way to do this?
Hi, I'd like to enable logging so I can see the various warnings that
web2py might be issuing.
I am running Version 1.91.6 (2011-01-03 17:55:14), using apache2 and
WSDL on Centos 5.5.
I copied logging.example.conf to logging.conf, and restarted apache.
I would expect to see logging on the
I found my log messages. When using consoleHandler with apache/WSDL,
apparently, the logging messages go to the server error log, not the
console.
When trying to send registration or lost password email, web2py
flashes that it cannot send email (so registration fails) and logs
[Wed May 11 10:07:31 2011] [error] 2011-05-11 10:07:31,049 - web2py -
WARNING - Mail.send failure:login() takes exactly 3 arguments (2
given)
My app's db.py says:
:
...
server.login(*self.settings.login.split(':',1))
I think you must have somewhere a statement like
auth.settings.login = ...
and the ... is missing a : separating username and password.
On May 11, 5:13 am, Ed Greenberg greenberg...@gmail.com wrote:
When trying
My user had success (and closed his issue) after removing all Firefox
add-ons. Thank you.
On Apr 27, 12:06 pm, pbreit pbreitenb...@gmail.com wrote:
Is this the standard login code or has it been customized in any way?
It's the standard login code. Other than a few syslog calls, my entire
gluon directory is absolutely the way it came from web2py.
I have a user of my app that is unable to log in with his (Ubuntu)
Firefox browser. He can log in with Chrome, and others can log in with
various flavors of Firefox. He's cleared his caches, cleared his
cookies, and done all sorts of similar browser cleansing things.
I found that his
Hi Folks,
Not really a web2py question, but it affects me daily.
When running the epydoc web pages at
http://web2py.com/examples/static/epydoc/frames.html,
I get odd behavior, and I wonder if it's just me, or if everybody sees
this:
Whenever I hit source code for a function, the large frame
Following the book, I do this in db.py, after auth has been
instantiated.
from gluon.tools import Recaptcha
auth.settings.captcha =
Recaptcha(request,'6LczqcISA...cAoH','6L...L2')
and I get a ticket:
AttributeError: 'Recaptcha' object has no attribute 'options'
Any ideas? Traceback below.
Ed
This returns me to /default/index with the flash of Logged out. My
response.flash, specified below the auth.logout() is never seen.
I also tried it with the response.flash= statement ABOVE the
auth.logout().
The user gets logged out, but I have no control over what he sees
next.
Do you have any
further suggestions, I'm very interested.
Ed
On Mar 1, 2:26 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
this should work, no?
def index():
auth.logout()
response.flash=bye bye user
On Mar 1, 1:12 pm, Ed Greenberg greenberg...@gmail.com wrote:
At the end of my controller
At the end of my controller function, I'd like to log the user out and
send him back to the login screen, hopefully with a response.flash on
the screen.
I've tried several things, none of which work.
I tried sending him to URL(c='default',f='user',args=('logout')) which
got close. One was
In my 'room' controller, I did this:
def list():
rooms =
db((db.rooms.customer==session.customer_id)(db.rooms.property==db.properties.id)).select(db.rooms.ALL,
db.properties.ALL, orderby=db.properties.short_desc)
return dict(rooms=rooms)
which I thought was way cool.
In my
I'd like to suppress some fields in a SQLFORM.
Imagine that a user is filling out a form to create or edit a record,
and his user_id is a column in the record. We need to populate the
user_id, but he should never see it.
If I declare the field as writable=False,readable=False then nobody
with
These look like exactly what I'm looking for. I'll try 'em out.
Thanks.
sql : Why is the same sql
failing in web2py that is succeeding in the mysql program. Perhaps I'm
only seeing a fragment of what web2py submitted to mysql? How can I
see the whole thing?
Many thanks.
Ed Greenberg
On Feb 14, 4:19 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
def index
15, 2:13 pm, Ed Greenberg greenberg...@gmail.com wrote:
Sorry to be back with a request for clarification.
My relationship is that a customer has properties and a property has
rooms.
I did this...
customer_id = session.customer_id
query = select id from properties where
visible).
A crud won't work reliably -- it's too generic. Do I have to create my
own form and populate my dropdown, or can I have SQLFORM do the work
in some fashion?
Thanks
Ed Greenberg
I'd like to store some session variables on login. (Look the userid up
in another table and get some convenient stuff out of there. ) Is
there any way to tag onto the Auth login method AFTER login is
successful and before it redirects to whatever is specified in the
_next argument?
Thanks,
Ed
, Ed Greenberg greenberg...@gmail.com wrote:
When SQLFORM constructs an HTML form with a dropdown of foreign keys,
I need to limit the records to only those that match a certain where
clause.
This is a master-detail problem. For instance, when displaying a
detail form, we only want some
I'd like to redirect http to https so that users who don't specify
https are forced to use it, especially for login/password
transactions. Also it would be nice if the admin pages, which are
blocked in http, would redirect, rather than fail.
There were some postings about htaccess in the group,
best practice for this, as well.
Can somebody please explain.
Thanks,
Ed Greenberg
If I call db.tablename.insert(...) it expects individual column-value
pairs. I already have these in a dict (which has been pre-screened
for valid columns and types).
Is there a way to call insert with this dict, or to properly explode
the values into something I can pass to insert?
Thanks.
you please open a googlecode
issue?
On Jan 25, 9:28 pm, Ed Greenberg greenberg...@gmail.com wrote:
I have a new centos installation. I followed the script
athttp://web2pyslices.com/main/slices/take_slice/98. When I use the new
application wizard, I get the same traceback that others have
I have a controller function that we can call next() since that's
what it is called :)
I have created a block of html in that function, contained in a
string.
I'd like to return it to the user so he can reuse it (not just view it
in the browser.)
Sending it to the browser causes the various
I have a new centos installation. I followed the script at
http://web2pyslices.com/main/slices/take_slice/98. When I use the new
application wizard, I get the same traceback that others have
posted:
Traceback (most recent call last):
File /opt/web-apps/web2py/gluon/restricted.py, line 188, in
39 matches
Mail list logo