Please, keep up the series, very nicely done!
On Jan 24, 8:29 pm, "ma...@rockiger.com"
wrote:
> Hello,
> the tutorial is making some progress:
>
> Begining with chapter 5, it should be interesting for web2py users, that
> are already familiar with the basics of web2py and want
> to learn about fu
Well apparently you're correct.
Nesting a table within a table is only possible if the inner table is
within a td according to the HTML spec. (Not that it doesn't render ok in
most browsers)
I was copying from some Google result on nested tables.
I managed to get my wanted result by setting a cor
On Wednesday, February 1, 2012 12:23:54 AM UTC-5, Lewis wrote:
>
> Thanks.
>
> So, would I expand the default form to include buttons to access the
> other methods? Not sure how to expose those...
>
You just have to add links pointing to those URLs (e.g., URL('default',
'user', args='change_pa
Thanks Anthony, that's exactly right. In fact, there is even no need
for us to call db.define_table('person') at all with RedBean. It would
look more like dal.insert(, =, ...) and
gets created automatically if it does not exist.
The best use case IMO is the ability to store/insert variable
dictio
Thanks that will do it, I was close to that exact same approach when I was
playing around today.
--
Regards,
Bruce
On Tue, Jan 31, 2012 at 7:54 PM, Bruno Rocha wrote:
> Hi Bruce,
>
> delete the database if the sample app created one, then replace
> modules/datamodel/user.py with this https://gi
Thanks.
So, would I expand the default form to include buttons to access the
other methods? Not sure how to expose those...
Guess I am ok on hashing but should probably look at using the key.
Hi Bruce,
delete the database if the sample app created one, then replace
modules/datamodel/user.py with this https://gist.github.com/1714979
--
Bruno Rocha
[http://rochacbruno.com.br]
You can always put the static pages into app/static/
On Jan 31, 6:51 pm, pbreit wrote:
> You pretty much need to add both a controller function and a view to add
> static pages like that.
>
> Otherwise, you would need to program some sort of traffic cop to see the
> incoming request and manually
I think the assignment should be in the if form.process().accepted: clause.
I'm trying to add a hidden form to a SQLFORM using the sample code on p.
331 of the 4th edition book (pdf):
form.vars.a = request.vars.a
form = SQLFORM(..., hidden=dict(a='b'))
When I submit the form, though, I get an error because I'm calling the
variable 'form' before assignment. If I reverse
>
> The controller above exposes multiple actions:
> http://.../[app]/default/user/register
> http://.../[app]/default/user/login
> http://.../[app]/default/user/logout
> http://.../[app]/default/user/profile
> http://.../[app]/default/user/change_password
> http://.../[app]/default/user/ver
Hi Massimo,
Thank you for the prompt reply.
It wasn't an indentation problem.
I made a silly mistake.
I didn't realize auth.define_tables() was already called in earlier
parts of the default code for db.py!
Once again thank you & the community for developing something so
awesome.
On Feb 1,
In the beginning, I think the service providers are pretty good if you can
afford it. Some have free tiers and pricing usually starts around
$10/month. If you're on RackSpace cloud, you get free SendGrid. Postmark,
Amazon and MailGun are other providers.
You pretty much need to add both a controller function and a view to add
static pages like that.
Otherwise, you would need to program some sort of traffic cop to see the
incoming request and manually render it with a view.
So create a controller content.py with something like this:
def index()
Thanks. I think I'll try the honeypot (hidden field) approach and see how
successful it is.
Thanks Benjamin. That sounds quite simple.
If you're just looking to add fields and not completely redefine your auth
table this is really simple. From the web2py book:
## after auth = Auth(db)
> auth.settings.extra_fields['auth_user']= [
> Field('address'),
> Field('city'),
> Field('zip'),
> Field('phone')]
> ## before auth.defi
Thanks! At the moment this is just a personal blog that only I'm going to
be posting on so security isn't an issue. Once I start expanding it out
feature wise then I'll get more into security. I plan on eventually
branching it off as a forum app as well so it will be important eventually.
thanks a lot
Hi Bruno,
I have been looking at your code. How would you override the Auth to not
include first name last name using your class?
IE: How would we do the following using your approach? (BaseAuth)
db.define_table(
auth.settings.table_user_name,
Field('username', length=128, default='0
1. The book, in chapter 9, describes many methods accessible as part
of the authorization system.
Thus:
The controller above exposes multiple actions:
http://.../[app]/default/user/register
http://.../[app]/default/user/login
http://.../[app]/default/user/logout
http://.../[app]/default/user/prof
How about this?
{{extend 'layout.html'}}
{{include "default/content.html'}}
you do not need a controller function to include a view.
On Jan 31, 4:18 pm, Ed Greenberg wrote:
> I have some html files which I want to render inside the layout.
> Something like this:
>
> {{extend
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
I have seen several posts about this problem. I just had the problem
and solved it. However, none of the several posts I read had the
answer that applied in my case. I did not read ALL of the posts
mentioning this problem so some of them may have had an applicable
answer.
If you are a linux noo
in controller default.py
*def update():
> form = SQLFORM.factory(Field("category",
> requires=IS_IN_SET(["category1", "category2"]), comment="Choose a category
> to update"),
> Field("new_value",
> "double"))
>
>if form.process().accepted
I have seen several posts about this problem. I just had the problem
and solved it. However, none of the several posts I read had the
answer that applied in my case. I did not read ALL of the posts
mentioning this problem so some of them may have had an applicable
answer.
If you are a linux noo
I agree with the fact that there are two timeouts but the one I am
talking about is SOCKET_TIMEOUT.
It is set in --socket-timeout in widget.py and passed to rocket in
line 777 of main.py
rocket.SOCKET_TIMEOUT = socket_timeout
which does change the constant value SOCKET_TIMEOUT=1 to 60.
I am pret
Try this:
t = TABLE(
(1,2,3),
(4,5,6), # trailing comma
# a blessing for sloppy coders
)
Reasoning that nesting is allowed, we come to this:
t = TABLE(
(1,2,3),
(4,5,6),
(TABLE(
('one', 'two', 'three'),
('four', 'five', 'six
Thank you for the immediate reply.
my problem is how and where to write the statement in controller and
views ?
Regards,
Ashraf
lets say you have a lot of records with somefield == "anything"
db(db.mytable.somefield == "anything").update(field="something")
On Tue, Jan 31, 2012 at 5:01 PM, Ashraf Mansour wrote:
> Hi all,
>
> I am looking for an example that updates many records in a table.
> ( similar to sql update)
>
{{=XML(posts.body)}}
On Tue, Jan 31, 2012 at 6:46 PM, HittingSmoke wrote:
> Sorry if this is a dumb question. I'm working on a very basic blog and I'd
> run into a hurdle which I thought would be very trivial. I've skimmed the
> book looking for an answer but I can't seem to find one. Google sear
Content inserted in views is automatically escaped. To avoid that, use
XML(): http://web2py.com/books/default/chapter/29/5#XML.
Note, this can be very dangerous if you're allowing users to enter
arbitrary HTML -- in that case, you should at least sanitize the content
via XML(..., sanitize=True)
On Tuesday, January 31, 2012 3:40:00 PM UTC-5, Massimo Di Pierro wrote:
>
> from gluon.contrib.htmlminify import minify
> retrun minify(response.render(...))
>
> Yet I am not sure this will provide any improvement over gzip http
> responses. In fact the gzipping would be performed by the web ser
Sorry if this is a dumb question. I'm working on a very basic blog and I'd
run into a hurdle which I thought would be very trivial. I've skimmed the
book looking for an answer but I can't seem to find one. Google searching
turns up nothing but dozens of unrelated results.
How do I get web2py to
Are you just trying to decrease the network payload? If so, maybe just set
the server to gzip the content. Once gzipped, minifying will probably only
provide modest additional benefit, and may not be worth the extra
processing.
Anthony
On Tuesday, January 31, 2012 3:23:09 PM UTC-5, Kernc wrote
On Tuesday, January 31, 2012 9:37:54 AM UTC-5, Massimo Di Pierro wrote:
>
> In trunk socket timeout is 60 and this resulted in another problem.
> Ctrl-C waits for 60 seconds before joining the worker processes.
> Perhaps we should increate socket-timeout, catch Ctrl+C and then kill
> the process
Hi,
I know that scheduler is only 6 months old, and it is fantastic, as is
web2py. I have not had this much fun and ease in programming in years.
I do have a questions about whether anyone has implemented it in
web2py on GAE.
How do you start the worker threads in web2py in GAE. Can you do it in
Hi all,
I am looking for an example that updates many records in a table.
( similar to sql update)
It seems that crud.update is handling one record.
I thought about looping (for) and/or executesql.
An example will be perfect.
Regards,
Ashraf
I apologize. My answers were not always informative not correct.
I understood the issue was about minification of css and js which is
included.
As far as the minification of html is concerned. I do not think it
belongs to response.render because there is nothing html specific in
there. If you wan
Hi,
Looking to this list for guidance...
The web2py issue #369 (http://code.google.com/p/web2py/issues/detail?
id=369) discusses a possible method of minifying response output HTML
(compressing it as in removing all extraneous whitespace). The issue
was closed with WontFix because "minify feature
I suspect you have tables which use represent to look up the
representation of each record.
for example:
db.define_table('item',
Field('name'),
Field('owner','reference auth_user'))
{{=SQLFORM.grid(db.item)}}
The grid needs to represent each owner. It is a user to will look up
the repre
This is off-topic, but since a fair number of web2py users send e-mail from
their applications, I thought this post from 37Signals might prove helpful
to some.
There were nearly 16 million e-mails sent from 37Signals' eight web
applications in the last seven days. About 99.3% of them were accep
You hit the nail on the head. So I'm really just misunderstanding the
tutorial. And of course, looking at the code now it makes sense,
because it only redirects to the second page if there is actually a
value in "visitor_name". Now I get it.
Thanks, folks. It's a self-facepalm. But there will
Here is my log from the Google App Engine local dev server. I don't
understand where all these "1"s are being printed from and what they
mean. Some of these pages are just static and are not making any
Datastore calls in the controller. Any insight would be helpful. Thank
you.
2012-01-31 18:08:29,
Oups you're right.
Now I remember what I didn't understand at this point, and probably
what the OP was expecting.
The book says :
"
Note that if the "second" action is ever called before a visitor name
is set, it will display "Hello anonymous" because session.visitor_name
returns None.
"
What t
What if you just do:
auth=Auth(db)
auth.settings.extra_fields['auth_user']= [Field('Skype')]
auth.define_tables()
On Jan 31, 9:55 am, Jarvert wrote:
> Hi,
>
> I am new to web2py and have been enjoying it immensely.
>
> I have been trying to add extra fields to the db.auth_user. In
> particular,
You cannot just swith from the datastore to gae:sql. They are
different databases. To use the latter you need to setup an instance
for it. Google has documentation about it.
Anyway, that may solve your problem or make it worse. First of all you
need to identify why you have to many read operations
>
> I'm pretty sure the first should be like this :
>
>
>
> **
>
> def first():
> if request.vars.visitor_name:
> session.visitor_name = request.vars.visitor_name
> redirect(URL('second'))
> return dict(form=form)
>
> **
>
> NOTICE THE return dict(fo
Hi,
I am new to web2py and have been enjoying it immensely.
I have been trying to add extra fields to the db.auth_user. In
particular, I am trying to associate additional profile details
like a "avatar" and other stats to a user...postal code..and so on.
I have tried in the db.py:
auth=Auth(db)
Hi all,
For my current project I am making an interactive survey application for a
environment research project. Its currently hosted on GAE.
My problem is my Datastore read operations are through the roof. A few
users can max the quota in about an hour.
Ive tried switching DAL adapters from ga
Ah, stupid me. Thanks.
On Jan 31, 8:42 am, Anthony wrote:
> Not sure if this is the problem, but it should be:
>
> IS_IN_DB(db, ...)
>
> not
>
> IS_IN_DB(db.A, ...)
>
> Anthony
>
>
>
>
>
>
>
> On Tuesday, January 31, 2012 9:11:48 AM UTC-5, Rick Ree wrote:
>
> > I've run into a basic problem that
Hello again,
I'm pretty sure the first should be like this :
**
def first():
if request.vars.visitor_name:
session.visitor_name = request.vars.visitor_name
redirect(URL('second'))
return dict(form=form)
**
NOTICE THE return dict(form=form), I think it'
Hi,
I did the tutorial of the pdf last week (newest pdf of december) and
there is a missing step exactly at this spot of the PDF. (or actually
a "not so clear change which needs to be made to run the tutorial
without any issue"). I didn't know of the google groups at that time
so I didn't post the
Thanks.
On 1/31/12 8:42 AM, Anthony wrote:
form.custom.widget.name_on_card['_class'] += ' my-class'
or
form.element(_name='name_on_card')['_class'] += ' my-class'
Anthony
On Tuesday, January 31, 2012 7:46:44 AM UTC-5, David J wrote:
I have
{{=form.custom.widget.name_on_card }}
Not sure if this is the problem, but it should be:
IS_IN_DB(db, ...)
not
IS_IN_DB(db.A, ...)
Anthony
On Tuesday, January 31, 2012 9:11:48 AM UTC-5, Rick Ree wrote:
>
> I've run into a basic problem that I can't seem to figure out:
>
> db.define_table('A', Field('name'), format='%(name)s')
>
I agree. In particular considering this:
https://groups.google.com/group/web2py/browse_thread/thread/d7f6faddb841790b/3ef04bd25c5b81b1#3ef04bd25c5b81b1
On Jan 31, 4:00 am, Ricardo Pedroso wrote:
> On Tue, Jan 31, 2012 at 3:14 AM, Massimo Di Pierro
>
>
>
>
>
>
>
>
>
> wrote:
> > Specifically it
This is very valuable.
In trunk socket timeout is 60 and this resulted in another problem.
Ctrl-C waits for 60 seconds before joining the worker processes.
Perhaps we should increate socket-timeout, catch Ctrl+C and then kill
the process instead of joining the workers.
On Jan 31, 12:16 am, nick n
I've run into a basic problem that I can't seem to figure out:
db.define_table('A', Field('name'), format='%(name)s')
db.define_table(
'B',
Field('number'),
Field('name', db.A,
requires=IS_EMPTY_OR(IS_IN_DB(db.A,'A.id','%(name)s')))
)
All I want to do is allow db.B.name
Note the following line:
if request.vars.visitor_name:
That means it will only store the value in the session and do the redirect
if "visitor_name" is in request.vars. If you're not submitting a visitor
name, then that variable will not be in request.vars, and the conditional
branch in the co
form.custom.widget.name_on_card['_class'] += ' my-class'
or
form.element(_name='name_on_card')['_class'] += ' my-class'
Anthony
On Tuesday, January 31, 2012 7:46:44 AM UTC-5, David J wrote:
>
> I have
>
> {{=form.custom.widget.name_on_card }}
>
> which generates
>
> id="no_table_name_on_card"
i added it to the db.py and its not working and i used this one from
the book and it didnt work two :
auth.settings.register_next = URL('user', args='profile')
auth.settings.login_next = URL('dashboard',args=['profile'])
auth.settings.register_next = URL('dashboard',args=['profile'])
auth.settings.profile_next = URL('dashboard',args=['profile'])
Its in the docs. For more info.
On 1/31/12 5:37 AM, Web2Py Freak wrote:
Dear All,
How can redirect anyone
I have
{{=form.custom.widget.name_on_card }}
which generates
id="no_table_name_on_card" class="string">
How do I add an additional class to the rendered output?
ie: big
id="no_table_name_on_card" class="string big">
Thanks.
I have seen the stopping problem on 1.99.4.
Running on Ubuntu 10.04 LTS, Gnome. No Tk library on the machine, so
I just use 'python web2py.py'
and take the defaults.
Ctrl-C won't stop it and neither will 'Kill -SIGTERM '
The problem occurs after using the application.
On Jan 30, 9:37 am, Ross
something like this http://www.web2pyslices.com/slices/take_slice/35
On Tue, Jan 31, 2012 at 10:31 AM, Johann Spies wrote:
> The book describe record versioning in the Forms section (SQLFORM and
> Crud).
>
> How can I get the same when updating/deleting records through queries that
> do not use f
The book describe record versioning in the Forms section (SQLFORM and Crud).
How can I get the same when updating/deleting records through queries that
do not use forms?
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
...
ajax('url/to/the/controller/function', [], 'target_element_for_the_return');
...
the ajax function is included in web2py_ajax.js, the second argument is a
list/array ['input'] to be used if you want to send form input values to
the server, you can leave it null with an empty list [].
The la
How to call the Controller function from javascript
I just downloaded web2py, and I'm going through the html book for the first
time. I'm just getting to the point where I think I can understand the
web2py approach, and I'm starting to get enthused.
I've gotten as far as the Postback section, and I'm running into problems.
The code does not se
In have been trying to initialize a password field in a custom form using
SQLFORM.factory, although I cannot initialize password type fields using
form.vars['passfield'] = 'somevalue'. I am not using the registration form
but instead am using a custom form that I want control over.
Setting the
Dear All,
How can redirect anyone who register at my website to the profile page
On Tue, Jan 31, 2012 at 3:14 AM, Massimo Di Pierro
wrote:
> Specifically it waits for the socket timeout of 60 seconds here:
>
> rocket.py line 1063:
> # Wait until they pull the
> trigger
> for t in self.threads:
> if t.isAlive():
> t.join()
>
> I feel it i
If its a big file, need to adjust:
client_max_body_size 100M;
Le 31/01/2012 09:18, nick name a écrit :
No, the thread started with Ie8 being suspects, but at least from my
experiments it is a problem in Rocket which can be triggered with any
browser or even without a browser (e.g. wget/curl instead of a browser)
See e.g.
https://github.com/explorigin/Ro
No, the thread started with Ie8 being suspects, but at least from my
experiments it is a problem in Rocket which can be triggered with any
browser or even without a browser (e.g. wget/curl instead of a browser)
See e.g. https://github.com/explorigin/Rocket/issues/1#issuecomment-3734231
The reas
Le 31/01/2012 07:38, nick name a écrit :
Almost surely the same problem discussed in this thread:
https://groups.google.com/d/msg/web2py/1_b63bhBeQs/sYFbXNJL8D4J
It looks like the problem is with IE8 in this thread ?
Tried to set the content-lenght header but I miss something:
response.hea
76 matches
Mail list logo