Paul Robinson solved it by just inserted the dict from
connection['table'].find() in to an overridden parse function. I have to
figure out how he exactly did it, but I don't think it will take to long
before we have an experimental working mongodb adapter. I'll keep you all
posted.
Regards Mark,
Use http://tohtml.com/ to highlight the code you want to show
2011/12/4 Rick
> I tried to apply the solution to my code, but it still doesn't work.
> Here is the code:
>
>prerecords = db().select(db.day.ALL, orderby=db.day.thedate)for
> prerecord in prerecords:if
> pr
Interesting, there is some trouble but I coudn't see it.
2011/12/4 Constantine Vasil
> I managed to transfer a very big app initially developed for
> Django+GAE+JQuery Mobile to web2py. Managed to set
> up my Eclipse environment to work with web2py and now
> I can debug my web2py + GAE hybrid ap
I have the following
featured = (0,1,2,3,4,5)
Field('rank','list:integer',requires=IS_IN_SET(featured, zero='rank'),
readable=False, writable=False),
So this field can only be set from appadmin and is set by default to
[] when a record is made, IIUC.
I want to select the tables that have been s
Hi there! I started creating a website for a game at my college with
web2py last winter, and this winter I am cleaning up a lot of the
things I did rushed, and making it something that others can use...
IE: not so reliant on me creating one time use controllers, or going
straight to the shell to f
Pessoal,
Estou querendo contratar um plano na Linode para hospedar minha aplicação
em web2py.
A minha dúvida é que não sei como configurar o servidor lá... Alguém tem
alguma experiência ou link de artigos sobre como fazer e poderia
compartilhar?
--
Bruno Barbosa
Web Developer and Free Software En
I changed my Oracle password and updated my web2py DAL connect string, but
now get the error:
DatabaseError: ORA-00955: name is already used by an existing object
Did something get corrupted? Any suggestions on how I can fix it? (I tried
restarting the web server.)
Here is the full traceback
I found this on another thread:
http://groups.google.com/group/web2py/browse_thread/thread/5a3cb9154e27c1b/4168b21b051dd342
>Adi
...
>I followed instructions from here:
http://www.web2pyslices.com/main/slices/take_slice/14
>Worked for me on linode.
On Dec 5, 8:43 am, Bruno Barbosa wrote:
> Pes
Aren't you setting a field constraint that allows only integers from 0
to 5?
> featured = (0,1,2,3,4,5)
IS_IN_SET has a multiple=True/False argument (false by default) that
allows to validate sequences of objects (for example [int a, int
b, ... int n])
Also you can set a default value in the Fie
> IS_IN_SET has a multiple=True/False argument (false by default) that
Sorry, my mistake, multiple is True by default.
I think that large python files turn difficult to read (specially if
you are contributing to the code)
Here are some recommendations for big sites/apps (in spanish) by
Martín Mulone:
http://www.slideshare.net/martinpm/web2py-pensando-en-grande-9448110
On Dec 5, 4:57 am, Ryan DowlingSoka wrote:
http://web2py.com/book/default/chapter/08
please add an 's' to
auth.setting.extra_fields['auth_user']= [
Field('address'),
Field('city'),
Field('zip'),
Field('phone')]
should be
auth.settings
Oh, I see. Since the password is part of the connect string, the
connection string hash used for migrations has changed. Web2py is
apparently trying to recreate existing tables, assuming that this is a
different database.
Correct? I guess I need to read the migration section in the manual mor
fake_migrate=True
http://zerp.ly/rochacbruno
Em 05/12/2011 10:37, "Tim Korb" escreveu:
> Oh, I see. Since the password is part of the connect string, the
> connection string hash used for migrations has changed. Web2py is
> apparently trying to recreate existing tables, assuming that this is a
If we will have 4th edition of web2py book, I am interested to
translate it (into czech language).
Are there some hints, what to do, when I want start with translation?
Hi,
what is the prefferred way, how to report bugs in web2py?
And what about reporting of (small) mistakes in manual - web2py book?
These slides are really intresting, an english version sould be a must!
2011/12/5 Alan Etkin :
> I think that large python files turn difficult to read (specially if
> you are contributing to the code)
>
> Here are some recommendations for big sites/apps (in spanish) by
> Martín Mulone:
>
> http:/
I don't see any problem with breaking up your controller if you find it
more manageable. Note, if you have utility functions that are needed by
multiple controllers, you can also put them in a model file. Or if you
prefer modules but want to make your db and auth instances more easily
available
It's usually a good idea to mention bugs here on the list first to confirm
it's really a bug -- then submit an issue
here: http://code.google.com/p/web2py/issues/list. This is also a good
place to report book errors.
Anthony
For a list:integer field, you want to set IS_IN_SET(..., multiple=True) to
allow multiple values. Or perhaps you don't really want multiple values, in
which case, just make it an 'integer' field.
See
http://web2py.com/book/default/chapter/06#Many-to-Many,-list:,-and-contains.
With a list:integ
It doesn't look like you applied Massimo's solution. You're calling
select() all by itself (not as a method of a Set object) -- doesn't that
raise an error (there's no function called 'select' in web2py)? The sum
should be applied in the initial query, not on the returned rows after the
query.
How to deploy web2py on PythonAnywhere
http://stackoverflow.com/a/8386751/559935
--
Bruno Rocha
[http://rochacbruno.com.br]
It's best to handle on the client side if you can. The easiest is an IE
conditional comment:
You can also check via jQuery:
if (jQuery.browser.msie) {do something}
Finally, if you need to do something completely different on the server
side, you can check for IE from within your web2py cod
Right the first time -- multiple defaults to False (though for a
list:reference field, by default, an IS_IN_DB validator with multiple=True
is applied).
Anthony
On Monday, December 5, 2011 7:20:20 AM UTC-5, Alan Etkin wrote:
>
> > IS_IN_SET has a multiple=True/False argument (false by default)
I am working on an app for that. very soon.
On Dec 5, 7:41 am, Mirek Zvolský wrote:
> If we will have 4th edition of web2py book, I am interested to
> translate it (into czech language).
> Are there some hints, what to do, when I want start with translation?
Hello,
when will this book be available in PacktPub?
I preordered it but still waiting for news
thank you
António
Also a good idea in the admin is to see the ACL of the app without having
to dig deeper in to the table group ,auth,permissions,etc
2011/12/4 Anthony
> On Sunday, December 4, 2011 4:12:03 PM UTC-5, Ramos wrote:
>>
>> What about an On/OFF button in admin to disable individualy every app( or
>>
Is there any way to keep the value that was inserted on an upload
field after failing to validate the form due to another field, so that
the user doesn't have to search for the file again?
That is great! Thank you both!
I want to share my research about web2py + jQuery Mobile - made a lot of
tests. The bottom line id as follows.
JQuery Mobile is designed for mobile but it turns out it works on desktop
too. This is great because one design can work for both mobile and desktop
an
the only way to see it is to recreate the project. Custom imports solves a
real speed issue and everything will work much faster so it is worth to do
it. But this issue should be resolved. Because the debugger cannot be used
it is very hard to detect. I mentioned it because i wanted to hide the
This is tricky. When the form is submitted, it doesn't send the location of
the file on the user's computer -- it sends the actual file. Even if you
knew the location of the file on the user's computer, you couldn't
pre-populate the form field with that value because browsers won't allow it
for
Just my 2 cents:
- web2py application and desktop application will probably read the
data a lot, updates not so often
- additional strings in web2py application gets "automagically" added
to the language files
The only doubt remains the one: if you need to add something to
language files within yo
I made a flash messages enhancement with two levels 'info' and 'error'. I
set up my layout.html to accept {{=flash_level}} and to make the flash
message visually different for each case. It works when in my controller I
set flash_level = 'info' and send it to the view.
web2py has many internal
Why do you do:
self.auth_def = lambda: self.define_auth
Anyway, that won't work as expected, because your lambda returns a function
instead of calling the function. Also, you might need to add the 'self'
parameter to the lambda. Maybe:
self.auth_def = lambda self: self.define_auth()
But again
The flash message is stored in response.flash. There are a few web2py
operations that automatically set that. The actually flashing is handled by
JS on the client side (in web2py_ajax.js).
Anthony
On Monday, December 5, 2011 11:32:22 AM UTC-5, Constantine Vasil wrote:
>
> I made a flash message
> The only doubt remains the one: if you need to add something to
> language files within your desktop app, did you figure how to do that?
I have a fake web2py environment in the desktop application and create
an ad-hoc T object,
so it works as if within web2py (anything wrapped by T updates the
l
So how does it work for other form elements? I'm guessing they are stored
in session. So the way to go would be to store the uploaded file in session
too and then on form resubmission check what to display. If file is in
session the input field should look as on update of an existing object
(i.
Other form elements aren't stored in the session -- when the form
submission comes in, they are in request.vars, and they can be moved to
form.vars and returned with the form (no need to put anything in the
session). The file itself, on the other, cannot be returned with the form,
so you have t
Anyone else having trouble with web2py trunk this morning?
A fresh install gets me a ticket and trying to view the ticket results
in another ticket.
Also get a warning in the console:
C:\Deleteme\web2py\gluon\contrib\user_agent_parser.py:379: Warning: 'as'
will become a reserved keyword in P
They told me another 3 months. We are doing writing but they do not
use any markup language. Packt does all the editing and processing
using MS word so it takes time.
massimo
On Dec 5, 9:16 am, António Ramos wrote:
> Hello,
> when will this book be available in PacktPub?
>
> I preordered it but
Thank you all for the ideas and I just submitted the ticket (Issue#
556) for Plumo.
I'm still not sure if it's a best practice to compile the app even if
you don't see any performance issue, but that would be great if it's
done automatically.
On Dec 2, 10:41 pm, Massimo Di Pierro
wrote:
> That's
It is a bug. Fixed now.
On Dec 5, 11:06 am, Jim Steil wrote:
> Anyone else having trouble with web2py trunk this morning?
>
> A fresh install gets me a ticket and trying to view the ticket results
> in another ticket.
>
> Also get a warning in the console:
>
> C:\Deleteme\web2py\gluon\contrib\use
That fixed it.
Thanks Massimo.
-Jim
On 12/5/2011 11:26 AM, Massimo Di Pierro wrote:
It is a bug. Fixed now.
On Dec 5, 11:06 am, Jim Steil wrote:
Anyone else having trouble with web2py trunk this morning?
A fresh install gets me a ticket and trying to view the ticket results
in another
mikech,
Have you looked here:
http://web2py.com/examples/default/examples
On Dec 5, 12:33 am, mikech wrote:
> I've been thinking along these same lines. I would like to see a workbook
> to go along with the web2py book in which the concepts in the book are
> illustrated in a sample in the workb
Please a tip
i created my certificates reading a tutorial for openssl and apache.
What is the best way to create certificates for web2py?
a simple tutorial?
Thank you
Em 2 de novembro de 2011 11:02, António Ramos escreveu:
> Context: Windows
> Did not tried yet using the source code but using 1
Interesting I have this working without passing the self parameter, anyways
this is an old code I update this code a lot. And yes is not need to use a
defined auth you can remove it.
2011/12/5 Anthony
> Why do you do:
>
> self.auth_def = lambda: self.define_auth
>
> Anyway, that won't work as ex
Yeah, I wasn't sure about the need for 'self' -- I guess Python doesn't see
it as a method. But is it supposed to call define_auth() rather than simply
return it? What is the purpose of that code?
Anthony
On Monday, December 5, 2011 12:47:09 PM UTC-5, Martin.Mulone wrote:
>
> Interesting I have
OK but I want to intercept it before actual flash is done, I want to format
my flash code on the layout.html before flash to appear.
In your action before "return " you can access it in
response.flash
If your action before "redirect " you can access it in
session.flash
You have to do both. Alternatively, you can access response.flash in
the view, before {{extend...}}
On Dec 5, 11:56 am, Constantine Vasil wrote:
> OK
The default layout.html includes:
{{=response.flash or ''}}
and there is some CSS that controls how it looks, and some code in
web2py_ajax.js controlling its display.
You could add some code there, or in the controller that generates the
response.flash.
Anthony
On Monday, December 5, 2011 12
thanks to you both!
I was following the code here:
"Optimize your web2py app using the new import method"
http://martin.tecnodoc.com.ar/default/tag?name=import
If there is a bug in this code how you would do that correctly?
Forget the self.auth_def = lambda... -- just call self.define_auth()
directly. Does that work?
On Monday, December 5, 2011 1:21:31 PM UTC-5, Constantine Vasil wrote:
>
> I was following the code here:
>
> "Optimize your web2py app using the new import method"
> http://martin.tecnodoc.com.ar/defau
1.99.2, WinXP
Model works fine from browser and from integrated shell.
But there is problem from exec_environment, when model contains Auth:
os.chdir(r'c:\python27\Lib\site-packages\web2py')
from gluon.shell import exec_environment
cas = exec_environment('applications/cas/models/db.py')
Traceba
I think this is not a bug.
Auth needs 'request' to build some paths and also will need it to do other
things.
The fact is that Auth was designed to run in a server-client environment,
where server will always have a request object. if you need to run in
exec_environment or in shell mode you will
I mean, Class based logic in modules.
--
Bruno Rocha
[http://rochacbruno.com.br]
Thanks Cliff, I will take a look. I
Mike
I am trying to setup eclipse for web2py development. I tried using (if 0:
import things) trick, then i get lot of warning about unused functions. Is
there any neater way of doing this.
Hi Andrea,
I am working on a book about learning web development with web2py. The
conzept is a mixture of railsturial.org and Headfirst Html.
I will post the first 3 chapters before christmas.
Marco
I will try and tell you soon. Thanks. I am learning web2py three weeks
already and think now I understand it how it works.
The web2py community help is great!
Currently I am reading a draft book in Safari Books Online for which I paid
for in advance. I get emails when an update is ready, I click on the link
http://my.safaribooksonline.com/mydownloads, login to my account, download
an encoded pdf of the book and read it in draft. When the book is finis
I got response form jQuery Mobile developers and the answer is:
"The redirect issue isn't solvable until XmlHttpRequest2 see's better
support and a redirect callback is added upstream in jQuery Core. If you
are doing redirects on submission turning off ajax is really your only
option."
Now - h
Yes it was! Thanks. The site is largely remaining the same, just with
improvements and cleaner code, it was mostly developed over 4 weeks
last year so shortcuts are numerous and terrifying.
One of the main problems I'm having with splitting the code is the
utility functions needing access to auth
On Monday, December 5, 2011 4:34:16 PM UTC-5, Ryan DowlingSoka wrote:
>
> So to clarify, is there something fundamentally wrong with having
> utility (non-view) functions defined in a controller?
>
I don't think there's anything fundamentally wrong with that, if it works
for you.
Maybe instead of a regular redirect, send back a regular 200 response with
the Ajax request, and add a special response header with the redirect URL
(e.g., response.headers['client_redirect'] = URL('other_function')). On the
client side, have some JS code that runs upon successful Ajax completio
Do you think this simple solution will work?
http://www.adequatelygood.com/2010/7/Saner-HTML5-History-Management
I'm using web2py with nginx, and I've experienced the following error
on redeploying my app:
socket.gethostbynamesocket.gethostbyname(http_host) File "/var/
web2py/cow/gluon/main.py", line 396, in wsgibase
socket.gethostbyname(http_host)]
gaierror: [Errno -2] Name or service not k
Don't know -- give it a try.
On Monday, December 5, 2011 5:48:01 PM UTC-5, Constantine Vasil wrote:
>
> Do you think this simple solution will work?
> http://www.adequatelygood.com/2010/7/Saner-HTML5-History-Management
>
Your approach is better.
"On the client side, have some JS code that runs upon successful Ajax
completion and looks for that header."
How you would do that?
By the way I discovered jsbin - an easy way to publish html code, then got
the source from browser bar just before it is rendered:
http://jsbin.com/ojamak/4/edit
here is where I hit submit:
and I see:
So if the page showing up after redirect is 'myinfo' (correct) but the
browser bar is still
You could use the jQuery ajaxSuccess event handler
(http://api.jquery.com/ajaxSuccess/), and in the ajaxSuccess event handler,
check for the special header via xhr.getResponseHeader('name-of-header').
>From there, you'll have to figure out what to do, based on how jQuery
Mobile works (I'm not r
Hi,
in models/db.py I have:
from gluon.globals import current
current.db = db
In modules/example.py I have:
from gluon.globals import *
db = current.db
but I get this error: AttributeError: 'thread._local' object has no
attribute 'db'
if I print current.db I get the output but why can't I a
Read the callout box at the end of this
section:
http://web2py.com/book/default/chapter/04#Accessing-the-API-from-Python-modules.
You're not supposed to assign items from 'current' to global variables
within the module, which are defined only once when the module is first
imported.
Anthony
thanks Anthony, but how can I have access to db in modules then?
On Dec 6, 1:14 am, Anthony wrote:
> Read the callout box at the end of this
> section:http://web2py.com/book/default/chapter/04#Accessing-the-API-from-Pyth
> You're not supposed to assign items from 'current' to global variables
you cant assign db to current. you need to pass db to you class __init__
http://zerp.ly/rochacbruno
Em 05/12/2011 23:21, "Francisco Costa" escreveu:
> thanks Anthony, but how can I have access to db in modules then?
>
> On Dec 6, 1:14 am, Anthony wrote:
> > Read the callout box at the end of th
Hi,
I believe there's a bug in SQLFORM, where "cls" is not defined.
line # 842 @ __init__
line # 1097 @ accepts
"UploadWidget" should be used instead?.
Thanks,
Carlos
removed labda, now it is:
def __init__(self):
pass
Now I see self.define_auth() executed in init_auth, but got this
error at this line:
label=T('Username')),
NameError: global name 'T' is not defined
Thank you, Anthony, will check it.
are you doing:
if 0: from gluon import *
or are you doing something else?
On Dec 5, 2:40 pm, chandrakant kumar wrote:
> I am trying to setup eclipse for web2py development. I tried using (if 0:
> import things) trick, then i get lot of warning about unused functions. Is
> there any neater way o
Look forward to this.
On Dec 5, 3:12 pm, "ma...@rockiger.com"
wrote:
> Hi Andrea,
>
> I am working on a book about learning web development with web2py. The
> conzept is a mixture of railsturial.org and Headfirst Html.
>
> I will post the first 3 chapters before christmas.
>
> Marco
right. thanks!
On Dec 5, 7:32 pm, Carlos wrote:
> Hi,
>
> I believe there's a bug in SQLFORM, where "cls" is not defined.
>
> line # 842 @ __init__
> line # 1097 @ accepts
>
> "UploadWidget" should be used instead?.
>
> Thanks,
>
> Carlos
Hi i have used custom form in my application
example:
{{=form.custom.label.mobile}}:
{{=form.custom.widget.mobile}}
{{=form.custom.label.email}}:
{{=form.custom.widget.email}}
I need a javascript/jqeury function to allow spaces and numbers o
Hi,
I'm really enjoying the simplicity of Web2py. However, for the life of
me, I cannot figure out a way to accomplish this without re-writing
FORM/SQLFORM. So, I know I'm not understanding something :)
I'm writing a small app to make lists. Each list has many "items". I'd
like a user to be able
Alright I have another question. I'm bashing my head against the wall-
I've started by defining those earlier utility functions I talked
about in a model- and want to be able to access it in layout.html -
possible?
On Dec 5, 5:31 pm, Anthony wrote:
> On Monday, December 5, 2011 4:34:16 PM UTC-5,
@chandrakant kumar,
https://groups.google.com/group/web2py/browse_thread/thread/b6c0cf5d61d0c565/a40a34c4f91661bb?lnk=gst&q=eclipse#
In that thread, see the post by "Miguel Lopes" -- 4th from the bottom.
HTH.
--- Vineet
On Dec 6, 6:53 am, Massimo Di Pierro
wrote:
> are you doing:
>
> if 0: fro
I'm experiencing this problem as well, and signs on my side are also
pointing to Rocket. Although my case is a little different because I'm not
currently experiencing this problem with web2py, but I'm using Rocket by
itself to serve a light-weight service using a smaller micro-framework.
Howe
jQuery('#tablename_fieldname').keyup(function()
{this.value=this.value.replace(/[^ 0-9]/g,'');});
On Dec 5, 9:46 pm, Saurabh S wrote:
> Hi i have used custom form in my application
>
> example:
>
>
> {{=form.custom.label.mobile}}:
> {{=form.custom.widget.mobile}}
>
Try label = current.T('Username').
On Monday, December 5, 2011 8:48:58 PM UTC-5, Constantine Vasil wrote:
>
> removed labda, now it is:
>def __init__(self):
>pass
>
> Now I see self.define_auth() executed in init_auth, but got this
> error at this line:
>
I would like to make a controller function that does csv export
compressed . How can this be done in web2py?
On Monday, December 5, 2011 11:01:54 PM UTC-5, Ryan DowlingSoka wrote:
>
> Alright I have another question. I'm bashing my head against the wall-
> I've started by defining those earlier utility functions I talked
> about in a model- and want to be able to access it in layout.html -
> possible?
Y
Thanks! Turns out the reason I thought that wasn't working, was
because I'm an idiot- and was uploading the wrong file, as in the one
I wasn't updating...
Again thanks.
On Dec 5, 11:25 pm, Anthony wrote:
> On Monday, December 5, 2011 11:01:54 PM UTC-5, Ryan DowlingSoka wrote:
>
> > Alright I have
Is there a way, or example, I could be pointed to which demonstrates
using mathplotlib to plot upon request without writing the image file
to disk?
I'm able to create my plot and save it to the static/images directory
which then I can load within my view, however I would like to be able
to generat
def myimage():
import cSringIO
fig=Figure()
...
canvas=FigureCanvas(fig)
stream=cStringIO.StringIO()
canvas.print_png(stream)
return stream.getvalue()
then use {{=IMG(_src=URL('myimage'))}} to include it.
On Dec 5, 10:32 pm, Pumplerod wrote:
> Is there a way, or examp
Thanks Massimo :)
On Dec 6, 9:18 am, Massimo Di Pierro
wrote:
> jQuery('#tablename_fieldname').keyup(function()
> {this.value=this.value.replace(/[^ 0-9]/g,'');});
>
> On Dec 5, 9:46 pm, Saurabh S wrote:
>
>
>
>
>
>
>
> > Hi i have used custom form in my application
>
> > example:
>
> >
> >
Ahh. Thank you. It was the inclusion part I couldn't grasp.
On Dec 5, 8:47 pm, Massimo Di Pierro
wrote:
> def myimage():
> import cSringIO
> fig=Figure()
> ...
> canvas=FigureCanvas(fig)
> stream=cStringIO.StringIO()
> canvas.print_png(stream)
> return stream.getval
Perhaps I should explain my problem once again. I'd like to summarize
the values for each day in the record list. With other words, so that
this:
record.thedate[0] = 2011-12-01
record.value[0] = 10
record.thedate[1] = 2011-12-01
record.value[1] = 20
record.thedate[3] = 2011-12-02
record.va
That's what Massimo's code does. You'll just have to add the
auth.user_id and session.adate filters to the query (i.e., in the
parentheses before the .select).
Anthony
On Dec 6, 1:05 am, Rick wrote:
> Perhaps I should explain my problem once again. I'd like to summarize
> the values for each day
Reference post:
Scope authenticated users in accounts
https://groups.google.com/group/web2py/browse_thread/thread/4e2bfa3f4b0911a5/0fef76dbec18829c
I used fishwebby's method to scope authenticated users. The code used
is:
>> db._request_tenant = 'account_id'
>> db._common_fields=[Field('account_id
98 matches
Mail list logo