On Sunday, April 3, 2011 10:42:17 PM UTC-4, VP wrote:
i'm making a few observations as i'm debugging my app. They might
reflect my lack of understanding of how web2py works. Anyway, a few
thoughts
+ It appears session.forget() (as mentioned numerous times in the
book) should be
Hi Arble Samong
Thank you very much.
Actually the application does not run even on web2py server.
The appengine log prove how stupid i am.
It is a simple progam miss 'undefined name'
Thank you, again.
On 4月5日, 午後1:49, Arbie Samong phek...@gmail.com wrote:
In appengine.google.com you have your
LOL :) , alright that works...
thanks :)
On Apr 2, 9:48 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
It is not
{{=plugin_wiki.embed('widget_name',)}}
it is
{{=plugin_wiki.widget('widget_name',)}} # to embed a widget
or
{{=plugin_wiki.render()}} # to embed a
On 4 April 2011 16:11, Richard Vézina ml.richard.vez...@gmail.com wrote:
Are course_week1 and course_week2 not null??
No.
If not you need ...requires=IS_NULL_OR(IS_IN_DB(your requires) and in
...represent= you should use zero option (see book about that) or something
like that :
On 5 April 2011 09:16, Johann Spies johann.sp...@gmail.com wrote:
Thanks! That solved the problem. I could not find something in the book
about a 'zero option' though.
Now .represent works on the screen but not in the CSV-output. I have used:
{{
import cStringIO
I assumed there would simply be a Storage in the response object I
could just stuff things into, but it seems not. So my question is
what's the easiest way to append POST data to a response (for both
cases: a redirect and a non-redirect)?
Maybe I'm going about this the wrong way. I have a simple
From what I can understand you want your data available even after a
redirect. POST won't have that, so you should either store it on the
session, with cookies or with the database. If it's just temporary I
would suggest using session variables.
Regards,
Arbie
On Apr 5, 3:38 pm, Brian Will
Come to think of it, not sure why I'm thinking it has to get passed as
POST data: the redirect isn't triggering a second request, right? I
just want to pass data from the action to the view. (Though I'm still
curious how to POST data in the response.)
I also realized I can manually set
Hi,
I'm trying to do these 2 things:
1)
I have a directory structure which stores sioftware builds (many
builds daily), all versioned and sortable, many products, branches,
blablabla..., alright.
i would like new arrivals to magically announce their arrival in
some section of a web page (but
Using session occurred to me, but I was put off by the idea of
cluttering session with one-time use data. Is it good practice to then
remove the data from session after use? Probably doesn't matter, I
guess.
On Apr 5, 12:47 am, Arbie Samong phek...@gmail.com wrote:
From what I can understand you
I've been looking around http://www.web2py.com/poweredby section, and
decided to go into one of the websites. I don't get why it asked me to
log in, but I can understand this is website policy. The problem I had
was this.
Examine this url:
Why is there no link to poweredby page on the frontpage or did I miss it?
That sounds strange that you have to login, I don´t know why. But if you
click on the name below the screencapture of the site you don´t have to
login.
Kenneth
I've been looking around
Well I browse the code of fpdf.py and pil is only using to check is the file
is and image format, I think is easy to do to support gae, changing in gae
to api or make the check like IS_IMAGE from web2py.
Anyways there are other tools you can use to write pdf reports like PISA,
Reportlab.
Hi,
sometimes I need to use ajax function passing as second argument a
list of ids and costants. There is a way to pass to callback values of
elements by id, AND string costants?
Thanks for help.
It could be interesting to have an IDE configuration section. As far
as Eclipse is concerned you can look at these:
http://code.google.com/p/neo-web2py2eclipse/
http://pierrethibault.posterous.com/2010/10/web2py-eclipse-pydev-recipe.html
Are you currently using an IDE???, which one?
On Apr 4,
Understood, just being really lazy ; ) thanks for the fix.
http://commons.wikimedia.org/wiki/Category:Erlenmeyer_flasks
http://commons.wikimedia.org/wiki/Category:Chemistry_icons
On Apr 4, 2:12 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
I just fixed this in trunk. please remove
There's this plugin for web2py: https://github.com/lucasdavila/appreport
__ ___
*Gilson Filho*
*Web Developer
http://gilsondev.com*
was a design issue. changed.
On Apr 5, 4:15 am, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
Why is there no link to poweredby page on the frontpage or did I miss it?
That sounds strange that you have to login, I don t know why. But if you
click on the name below the screencapture
It would be nice if fpdf were to work on GAE out of the box. Moreover
I think PIL is available on GAE.
On Apr 5, 5:19 am, Martín Mulone mulone.mar...@gmail.com wrote:
Well I browse the code of fpdf.py and pil is only using to check is the file
is and image format, I think is easy to do to
On Apr 4, 2011, at 11:22 PM, Anthony wrote:
You might also want to lock the session even if it is merely being read --
otherwise, if a second action writes to the session after a first action has
read it in, then the first action will be working with a version of the
session that is no
About zero option, search in page for zero :
http://www.web2py.com/book/default/chapter/07
http://www.web2py.com/book/default/chapter/07There is some explanation
near IS_IN_SET...
There maybe more detailed information somewhere else too... I don't use it
in my code since it arrive after I start
I did not use export_to_csv for now... I just test it sometimes ago... But I
guest you should define your .represent for stream table before try to apply
them to your csv output...
Hope it helps.
Richard
On Tue, Apr 5, 2011 at 3:27 AM, Johann Spies johann.sp...@gmail.com wrote:
On 5 April
Answer below
On Mon, Apr 4, 2011 at 7:14 PM, Anthony abasta...@gmail.com wrote:
You're saying when the page loads, the LOAD component shows loading...,
but the create form never actually loads there? Can you reproduce the
problem with a somewhat more simplified example?
Yes and I will try
Could you be a little more specific? Are you trying to pass args and vars?
Or are you trying to load HTML using AJAX and sending it to a target DIV? If
you are using web2py's ajax function, you may be limited to what you can do.
Worst case, you can always try calling jQuery's load() method:
A Textmate like lightweight programmer's text editor right inside of
Chrome. It saves files directly to Dropbox, so if you have the Dropbox
sync software installed, the changes will appear locally as if you did
so with a text editor! Changes will be stored remotely so naturally
this same extension
I would like to use the component with jquery ui tabs plugin... So I would
like my different form to be accessible in different tabs on the same
page... The components seems to me the way to go...
Richard
On Mon, Apr 4, 2011 at 8:51 PM, pbreit pbreitenb...@gmail.com wrote:
I would suggest only
That's basically how it works. Although as you learn more about AJAX, you'll
find that there are a bunch of different ways to do this, including more
2-way types of communication, where you would do something with the data
returned from the controller before or after displaying it on the page.
Instead of locking by default unless explicitly forgetting, we
require locking *only if* sessions is saved/written/modified.
You might also want to lock the session even if it is merely being read --
otherwise, if a second action writes to the session after a first action has
read it in,
On Apr 5, 2011, at 8:13 AM, VP wrote:
I think the policy is quite simple: you don't lock session, if you
are only reading session variables. You lock only if you modify
session certain variables; and you lock it immediately before you
write, and unlock immediately before you write.
If
Hi
I'm enjoying my dive with web2py. I would like to seek help/pointers
re putting logic back at controller.
I have two tables,
db.define_table('person', Field('name'))
db.define_table('cats', Field('name'), Field('owner', db.person))
I have a controller default/index
def index():
I think the policy is quite simple: you don't lock session, if you
are only reading session variables. You lock only if you modify
session certain variables; and you lock it immediately before you
write, and unlock immediately before you write.
If that's your locking policy, I don't
You should really be joining the queries:
records = db(db.person.id==db.cats.owner).select(db.cats.ALL, db.person.ALL)
Then in your view, you access this by using:
{{for record in records:}}
b{{=record.person.name}}/b: {{=record.cats.name}}
{{pass}}
I recently attempted to move my web2py install to a different server.
All went well except for passwords failing to validate. It turns out
that the version of python I was using (2.5.1) had an issue with
hmac. Essentialy the following will give an incorrect digest on this
version of python:
What are people's thoughts on using HTML tags vs plain HTML? I'm thinking of
going more towards pure HTML. Will I be losing anything major?
For example:
a href=/item/{{=item.id}}{{=item.title}}/a
{{=A(item.title, _href=URL('default', 'item', extension='', args=item.id))}}
On Apr 5, 2011, at 8:33 AM, VP wrote:
I think the policy is quite simple: you don't lock session, if you
are only reading session variables. You lock only if you modify
session certain variables; and you lock it immediately before you
write, and unlock immediately before you write.
If
read-1
read-2
write-2
write-1
...so any changes #2 makes are lost.
I think this sequence is okay, as long as the write's are atomic and
they use up-to-date information.
It would be undesirable for read-1 to extract a variable and to update
it with write-1. But if write-1 manipulates
On Tuesday, April 5, 2011 10:00:52 AM UTC-4, Richard wrote:
Also, is that view the 'create.html' view (so, you're loading a 'create'
component on the 'create' page itself)?
Yes, I was in a pretty early stage of testing the component... I get
recursion when it works... I mean when I use
On Apr 5, 2011, at 9:02 AM, pbreit wrote:
What are people's thoughts on using HTML tags vs plain HTML? I'm thinking of
going more towards pure HTML. Will I be losing anything major?
For example:
a href=/item/{{=item.id}}{{=item.title}}/a
{{=A(item.title, _href=URL('default', 'item',
My rule is:
- use html in views
- use html helpers in controllers and models
- always use URL to generate urls (*)
So in your example
a href=URL('default','item',args=item.id){{=item.title}}/a
The first two rules are a matter of test but (*) is not. Soon or later
your code breaks if you do not
Hi,
is there any suggested way to require login for a whole application.
Our application in web2py is for registered customers (whom we
manually add) only. For each action we currently have a decorator
stating that the user must be logged in. Is there any way to this in
one place for the whole
The helpers are useful if you need to do server-side DOM parsing (
http://web2py.com/book/default/chapter/05#Server-side-DOM-and-Parsing) --
otherwise, I suppose it's a matter of preference. I think the URL function
is generally recommended, particularly if there's a chance you might need to
do
Thanks Anthony, that's the information I'm looking for. The only downside
re: the blog is that it's marked as old. Is there an updated source?
Jonathan,
This policy is okay, but not good for reasons argued above. It is
better not acquiring a lock unless you need one than to keeping a lock
unless you don't need it.
My question is: in your locking policy above, what's the purpose of locking
at all?
I wonder whether it would be
On Tuesday, April 5, 2011 12:13:45 PM UTC-4, mikech wrote:
Thanks Anthony, that's the information I'm looking for. The only downside
re: the blog is that it's marked as old. Is there an updated source?
There's a flash message saying the blog is old, but not all the entries are
actually
On Tuesday, April 5, 2011 12:25:13 PM UTC-4, David Warnock wrote:
Jonathan,
This policy is okay, but not good for reasons argued above. It is
better not acquiring a lock unless you need one than to keeping a lock
unless you don't need it.
My question is: in your locking policy
Perception is reality, even more so on these topics.
On Apr 5, 2011, at 9:25 AM, David Warnock wrote:
Jonathan,
This policy is okay, but not good for reasons argued above. It is
better not acquiring a lock unless you need one than to keeping a lock
unless you don't need it.
My question is: in your locking policy above, what's the
On Tuesday, April 5, 2011 9:46:41 AM UTC-4, Jonathan Lundell wrote:
On Apr 4, 2011, at 11:22 PM, Anthony wrote:
You might also want to lock the session even if it is merely being read
-- otherwise, if a second action writes to the session after a first action
has read it in, then the
Perfect. Good to know.
My question is: in your locking policy above, what's the purpose of locking
at all?
If you don't lock during writes (e.g. when updating the counter), two
writes might happen simultaneously and cause inconsistent results.
Essentially, this is what I think how SQLite works: concurrent reads
are
On Apr 5, 2011, at 9:55 AM, Anthony wrote:
Yes, that's a race condition with writing. My point was that even if the
first action is merely reading (but not doing any writing), you can have
problems. For example:
Action 1: read session
Action 2: read session
Action 2: write session
Hi All,
I'm building an app on Pyramid framework and would like to use the
web2py-DAL with it. Pyramid makes every request in a single thread, so
how should I manage the DAL object?
Should it be created once and then passed to every thread? If I do so
and some frequent queries are passed to the
On Apr 5, 2011, at 8:26 AM, VP wrote:
read-1
read-2
write-2
write-1
...so any changes #2 makes are lost.
I think this sequence is okay, as long as the write's are atomic and
they use up-to-date information.
It would be undesirable for read-1 to extract a variable and to update
On Tuesday, April 5, 2011 1:19:04 PM UTC-4, Jonathan Lundell wrote:
On Apr 5, 2011, at 9:55 AM, Anthony wrote:
Yes, that's a race condition with writing. My point was that even if the
first action is merely reading (but not doing any writing), you can have
problems. For example:
On Tuesday, April 5, 2011 12:51:46 PM UTC-4, pbreit wrote:
Perception is reality, even more so on these topics.
Yeah, maybe instead of flashing a warning, the FAQ should just include dates
on the postings.
On Apr 5, 11:09 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
My rule is:
- use html in views
- use html helpers in controllers and models
- always use URL to generate urls (*)
Should HTML helpers appear frequently in controllers/models? I can
see in some ajax stuffs, but
I think we need a new repository for information. I'm not sure Slices is
quite the right approach. A wiki might work better.
https://groups.google.com/d/topic/web2py/HkkZ_-kMUYE/discussion
On Tuesday, April 5, 2011 1:55:35 PM UTC-4, pbreit wrote:
I think we need a new repository for information. I'm not sure Slices is
quite the right approach. A wiki might work better.
On Apr 5, 2011, at 10:52 AM, VP wrote:
On Apr 5, 11:09 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
My rule is:
- use html in views
- use html helpers in controllers and models
- always use URL to generate urls (*)
Should HTML helpers appear frequently in
you can create a new request class extending from the original one and
via using config.set_request_factory(YourReqClass)and make dal an
attribute of it. whenever the request ends, you can close the
connection.
On Apr 5, 7:29 pm, Gleb gleb.sternh...@googlemail.com wrote:
Hi All,
I'm building
I think DAL connection was designed with web2py design in mind:
on each request a controller is executed and also are executed all models
files including database connection,
and after request memory is freed and connection close,
I used it successfully in a long running app with a few
On Tuesday, April 5, 2011 1:52:48 PM UTC-4, VP wrote:
On Apr 5, 11:09 am, Massimo Di Pierro massimo@gmail.com
wrote:
My rule is:
- use html in views
- use html helpers in controllers and models
- always use URL to generate urls (*)
Should HTML helpers appear
Using the @auth.requires_login() on every function is the only way I know
of. However, you may be able to put something like this at the top of each
controller:
if auth.user is None:
redirect(URL('default', 'login'))
However, it might cause a problem if you put that in your default
On Tuesday, April 5, 2011 3:13:22 PM UTC-4, Ross Peoples wrote:
Using the @auth.requires_login() on every function is the only way I know
of. However, you may be able to put something like this at the top of each
controller:
if auth.user is None:
redirect(URL('default', 'login'))
I need a hint!
It seems that LIKE operator doesn't work.Or... I'm not so clever
human...
Say, how can I deal with rawsql query? I need to find all records but
I know only some part of exact value. The code:
n=request.vars.num ### it returns only number
results=db.executesql(SELECT * FROM autos
I believe you want
results=db(db.autos.num.contains(n)).select()
On Apr 5, 3:58 pm, cyber vlad.mul...@gmail.com wrote:
I need a hint!
It seems that LIKE operator doesn't work.Or... I'm not so clever
human...
Say, how can I deal with rawsql query? I need to find all records but
I know
... or the equivalent raw sql
results=db.executesql(SELECT * FROM autos WHERE num LIKE %%%s%%;
%n)
On Apr 5, 4:45 pm, DenesL denes1...@yahoo.ca wrote:
I believe you want
results=db(db.autos.num.contains(n)).select()
On Apr 5, 3:58 pm, cyber vlad.mul...@gmail.com wrote:
I need a
And maybe add something like: vars={'_next': request.url} to the URL()
Wow! didn't know that - You know, there is so much out there, that we
(well, me for sure) rarely take the time to discover things fully. I
love that when I know in advance that there is something to be had by
sticking to something and looking deeper than we (me) usually would!
Thanks for the tip,
I'm trying to add the jquery UI datepicker from this web2py slice:
http://web2pyslices.com/main/slices/take_slice/22
It works well with SQLFORM, but I want to use it on a form I've
defined with the FORM() helper.
Is there a way to do this using a simple syntax similar to the
widget=date_widget
Hello every body:
I have youtube video over the mmodal window in a plugin wiki page.
How to change plugin_wiki elements.
Is there hidden parameter in widget?
It is nice to control the z index of page element.
Thank you in advance.
Hello all,
If I have the following:
db.define_table('languages', Field('language', 'string'))
db.languages.language.requires = \
[IS_IN_SET(['english', 'french', 'german']), \
IS_NOT_EMPTY(error_message='Value required')]
db.languages.language.widget =
Hello,
to eliminate the possibility of an error message, I would rewrite as:
db.languages.language.default = 'english' # or any other in the list
db.languages.language.requires = IS_IN_SET(['english', 'french',
'german'])
db.languages.language.widget = SQLFORM.widgets.radio.widget
On Apr 5,
Is there some way to work with joined data like this?
rows = ((db.item.status=='active')
(db.item.created_by==db.auth_user.id)).select()
return (rows=rows)
{{for item, user in rows.item, rows.auth_user:}}
{{=item.id}} by {{=user.first_name}}
{{pass}}
I'm not sure if it's
Just add _class=date to your INPUT field definition.
On Apr 5, 5:58 pm, Lennon lpru...@hotmail.com wrote:
I'm trying to add the jquery UI datepicker from this web2py
slice:http://web2pyslices.com/main/slices/take_slice/22
It works well with SQLFORM, but I want to use it on a form I've
There is something called reverse ajax, one site explaining the
technique is
http://www.obviously.com/tech_tips/slow_load_technique
I have not had the need for it but I would like to hear from you if
you get around to use it.
On Apr 5, 5:21 pm, mart msenecal...@gmail.com wrote:
Wow! didn't
There's no way to use trunk with the Mac download, correct?
hi,
i want to use condition that if user not log in will redirect to login
page, and if logged in will redirect to index page, heres my
controller :
if not session.authorized:
redirect(URL('user'))
else:
redirect(URL('index'))
def index():
return dict(message=T('Hello
On Apr 5, 7:05 pm, pbreit pbreitenb...@gmail.com wrote:
Is there some way to work with joined data like this?
rows = ((db.item.status=='active')
(db.item.created_by==db.auth_user.id)).select()
return (rows=rows)
{{for item, user in rows.item, rows.auth_user:}}
reverse ajax, eh? alright, then I think it should be reversed! :) Of
course I usually start anything with the word reversed in it with
large pot of of coffee!
stay tuned!
thanks,
Mart :)
On Apr 5, 7:23 pm, DenesL denes1...@yahoo.ca wrote:
There is something called reverse ajax, one site
@auth.requires_login()
def index():
return dict(message=T('Hello World'))
2011/4/5 黄祥 steve.van.chris...@gmail.com
hi,
i want to use condition that if user not log in will redirect to login
page, and if logged in will redirect to index page, heres my
controller :
if not
Yeah, I was trying to avoid the row.table thing. Not a big issue, just
wondering.
it clear for me right now, thank you so much
On Wed, Apr 6, 2011 at 7:02 AM, Martín Mulone mulone.mar...@gmail.comwrote:
@auth.requires_login()
def index():
return dict(message=T('Hello World'))
2011/4/5 黄祥 steve.van.chris...@gmail.com
hi,
i want to use condition that if user not
Thanks DenesL,
It was probably the wrong example. I simplified my case but in my case
I do expect errors to be reported so I was wanting to group the error
messages for the radio buttons into one message.
Cheers, Duane.
On Apr 6, 10:56 am, DenesL denes1...@yahoo.ca wrote:
Hello,
to eliminate
Hi,
I originally thought the FIELDSET might hold the solution but no.
Maybe it can be used.
Otherwise, I think the solution might be to recognise that the radio
buttons relate to the same field and treat them as a group. But we
still need an appropriate place/target to report the error. This
I am aware of that method but I really don't like the default date and
datetime widget.
I want to use the one from that web2py slice.
On Apr 5, 7:12 pm, DenesL denes1...@yahoo.ca wrote:
Just add _class=date to your INPUT field definition.
On Apr 5, 5:58 pm, Lennon lpru...@hotmail.com wrote:
I think that's another term for Comet, which is just a general term for
various server push techniques:
http://en.wikipedia.org/wiki/Comet_(programming)
Note, if you're using Comet/long-polling techniques, I think it keeps a
request open for a long time, so if you're using a server that
Note, if you're using Comet/long-polling techniques, I think it keeps a
request open for a long time, so if you're using a server that blocks a
thread for each request, you could run out of threads if you have lots of
users connected at once. In that case, you may need to look into a
Slight correction:
if auth.user is None:
redirect(URL('default','user', args='login'))
And if you want next functionality (not tested):
if auth.user is None:
redirect(URL('default','user', args='login', vars={'_next': request.url}
))
Thanks for the replies! :) May be fun to compare... If all goes, i
can do this tonight (maybe)
Thanks guys!
Mart :)
On Apr 5, 9:20 pm, David Warnock d...@warnock.me.uk wrote:
Note, if you're using Comet/long-polling techniques, I think it keeps a
request open for a long time, so if you're
I wanted to share code from one web2py application to another.
So I created two packages with the same name in two different web2py
applications. I load the code of the package modules with local_import
from the controllers of both application. The two applications are
having almost the same
Well as a beginner with web2py I first have to say that I like it. So thank
you to all the people who work on it.
I am also a beginner with Python so do not expect very complicated questions
(yet)
Well I am building a application to deploy AIX unix installs on power
machines. My application
I uncommented the error_message config in my global routes.py file and it
broke my whole site. It seemed to block stylesheets from loading but some
site content actually did load. error_message_ticket works OK. Is anyone
using this successfully?
Oups! It does like that it does not work. I was loading old code in my
tests. The modules were not reloaded. I have to find another
solution...
On 5 avr, 22:04, pierreth pierre.thibau...@gmail.com wrote:
I wanted to share code from one web2py application to another.
So I created two packages
OK, now I understand.
I would modify web2py_ajax.html at the beginning to include:
response.files.append(http://ajax.googleapis.com/ajax/libs/jqueryui/
1.7.2/jquery-ui.js)
or a similar line, and then in the web2py_ajax_init function add:
Applications are totally discrete so there would be no chance of a collision
(if I understand correctly).
app1
modules
mypackage1
app2
modules
mypackage2
Nothing in app1 knows about anything app2 (and vice versa).
If you don't want to maintain two copies of the same
Was anyone able to make any progress with Celery? I am very interested as I
am not having much luck with cron and background processes.
On 5 avr, 22:38, pbreit pbreitenb...@gmail.com wrote:
Applications are totally discrete so there would be no chance of a collision
(if I understand correctly).
app1
modules
mypackage1
app2
modules
mypackage2
Nothing in app1 knows about anything app2 (and vice
98 matches
Mail list logo