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 imp
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, (
lasses match, yet I cannot catch the exception.
I hope somebody can point out the error of my ways...
Ed Greenberg
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.fo
"belongs()" Thanks.
On Feb 11, 7:09 am, Marin Pranjić wrote:
> http://web2py.com/books/default/chapter/29/6#belongs
>
> Marin
>
> On Sat, Feb 11, 2012 at 12:34 PM, Ed Greenberg wrote:
>
>
>
>
>
>
>
> > I feel like I should know this. I'
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
I have some html files which I want to render inside the layout.
Something like this:
{{extend 'layout.html'}}
content goes here
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 views/default/content.html
M
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?
Tha
; has died.
>
> > Is anybody using the module that hooks web2py to FirePHP that could
> > send me what had previously been found
> > athttp://www.box.com/shared/dtm0dhgze9
>
> > Did it work?
>
> > Many thanks
>
> > Ed Greenberg
what had previously been found at http://www.box.com/shared/dtm0dhgze9
Did it work?
Many thanks
Ed Greenberg
; > return (cleanUpNumber(value), None)
>
> > FORM(INPUT(_name='phone',requires=MyValidator())
>
> > On Oct 8, 7:48 am, Anthony wrote:
> > > Something like:
>
> > > FORM(INPUT(_name='phone',
> > > requires=lambda v
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
I've tried and tried, but can't find a google search term that answers
this.
I have a FORM(), not a SQLFORM(), with a SELECT and a bunch of
options in it, and I need to set the _selected attribute on one of
them. When I construct the SELECT, I don't know which one needs to be
selected until late
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?
.login != None:
> ...
> 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.
>
>
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:
mai
I found my log messages. When using consoleHandler with apache/WSDL,
apparently, the logging messages go to the server error log, not the
console.
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 system
My user had success (and closed his issue) after removing all Firefox
add-ons. Thank you.
On Apr 27, 12:06 pm, pbreit 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 session._for
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 l
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 G
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 an
f you have further suggestions, I'm very interested.
Ed
On Mar 1, 2:26 pm, Massimo Di Pierro
wrote:
> this should work, no?
>
> def index():
> auth.logout()
> response.flash="bye bye user"
>
> On Mar 1, 1:12 pm, Ed Greenberg wrote:
>
> > At the
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 summari
When I click password and username recovery in my app, the app flashes
"Mail Sent" but it isn't. Reviewing the mail server logs I find...
Feb 27 03:45:10 admin01 sendmail[13140]: STARTTLS=server,
relay=localhost [127.0.0.1], version=TLSv1/SSLv3, verify=NO,
cipher=DHE-RSA-AES256-SHA, bits=256/256
Can one have more than one view share a controller?
In cases where more than one operation shares a common amount of HTML,
this would be useful.
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 'room/list.htm
These look like exactly what I'm looking for. I'll try 'em out.
Thanks.
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 mor
omer==customer_id)
>
> On Feb 15, 2:13 pm, Ed Greenberg 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 = se
: 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
wrote:
> def index():
> query = .
Way cool, and many thanks.
On Feb 14, 4:19 pm, Massimo Di Pierro
wrote:
> def index():
> query =
> db.table.field.requires=IS_IN_DB(db(query),)
> form=SQLFORM(...)
> if form.accepts(...)
> ...
> return dict(form=form)
>
> On Fe
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
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 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, bu
, I could handle it in my select.
There's probably a web2py 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.
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 sp
today. Can you please open a googlecode
> issue?
>
> On Jan 25, 9:28 pm, Ed Greenberg 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 tr
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
42 matches
Mail list logo