Hi,
I have a need to write a cron job that will be doing a lot of db
inserts/updates. I am right now writing the code using DAL directly.
But, DAL is not as powerful (I'd like to get exceptions thrown
automatically if a constraint is violated etc. Right now, DAL returns
me native DB exceptions.)
Ca
hi
I can't find solution to call the function protected by auth from
cron.
I have defined auth group managers, and decorated function with
@auth.requires(not request.wsgi or auth.has_membership('managers'))
unfortunatelly, that is not working from cron.
i havetried also
@auth.requires(not requ
The book is very nice. But there are some places with broken code
which make the examples pretty useless. Most of the time it's
something with % in it. There are (3 month old) comments on those
pages who address this, but nothing got changed.
Is there any repository with the source to the book? So
Massimo, here non-2.4 constructions in tools.py:2838 ( get_query
method ).
Here my fast fix:
def get_query(self, field, op, value, refsearch=False):
try:
if refsearch: format = self.get_format(field)
if op == 'equals':
if not refsearch:
Hello,
I am trying to make a form for inserting a new record representing an
internal complaint against a given department. Depending on which department
is selected, different fields must be completed.
The way I'm planning on doing this is with a simple form with a select box
for the department,
Hello,
I have a created table as :
"""
Table definition
"""
db.define_table("member",
SQLField("membership_id", "integer",notnull=True),
SQLField("first_name", "string", notnull=True,length=100),
SQLField("middle_name", "string", notnull=True,length=100),
SQLField("last_na
Hello!
Reading the entries in this group related to authentification brought
no solution for this problem:
This is my controller:
@auth.requires_login()
def demo():
return dict(msg='Hello World')
Calling it with curl does just a redirect:
curl -u u...@domain.de:password http://127.0.0.1:8000
from my experience with pyamf:
I got the same, my conclusion was
web2py process restart is needed. for me it started to work after
rebooting web2py. don't know why and if it is a coincidence or not.
--
Kuba
On Jun 21, 9:59 am, Stefan Scholl wrote:
> There are (3 month old) comments on those
> pages who address this, but nothing got changed.
I fixed a couple recently. If you send me links, I can try to get a
few more?
> Is there any repository with the source to the book?
The online book is it, AF
hi together,
i need help. i need an init to initialize some code like this
(importing apis etc.):
import time
from naoqi import ALBroker
from naoqi import ALProxy
RoboIP = "192.168.0.101"
RoboPORT = 9559
BrokerIP = "127.0.0.1"
BrokerPORT = 999
form=SQLFORM(...,formstyle='divs')
http://groups.google.com/group/web2py/msg/9823ffc7410fd3e4
On Jun 19, 7:18 pm, Binh wrote:
> Hi,
>
> Is there any way to generate the auth form and general SQLForms with a
> div wrapping instead of the default table wrapping without hacking the
> form generator
There is a document form templates in it.
You can fill title, tags, body, comments, expiration date fields with
a selected template.
You can have date and time fields generated dynamically from templates
and you can add days to date field "{$date+10}" minutes to time field
"{$time+60}"...
On jún
On 2010-06-19 12:11, Christopher Steel wrote:
Hey Jean,
I use a link from init to my app as well. Works great for me. You just
need to set up your app name. I have not tried the routes way as of
yet.
Hi Chris,
Where do I set up the app name? I though that the app name was the name
of th
There is a document form templates in it.
You can fill title, tags, body, comments, expiration date fields with
a selected template.
You can have date and time fields generated dynamically from templates
and you can add days to date field "{$date+10}" minutes to time field
"{$time+60}"...
On jún
whoops I was thinking about appadmin, which does work. Haven't tried
the admin.
Where did you read sessions and uploads don't work?
On Jun 20, 4:06 pm, Giuseppe Luca Scrofani
wrote:
> Then Im missing something. Everywhere I read of this limitations...
> Have you made some specific changes to mak
Hi,
I have developed some applications in web2py, and 2 are running
currently in gae, but now i have serious problem.
My current project is a social application, and when i design
(example) the tables to make an user follow the actions other user
(twitter like) I find that many-to-many relationsh
Wow, thanks very much for sharing this trick. I knew it could be easy
and elegant! :-)
On Jun20, 10:15pm, mdipierro wrote:
> Because the form is submitted and returned via ajax the usual
> mechanism does not work but you can do:
>
> def form():
> form=SQLFORM.factory(
> Field('name', r
I wrote a small tutorial on how to use OAuth with web2py by linking a
session with a Twitter account. A future update will include
embedding the access token with auth and creating an oauth
login_method class. It can be found at
http://dougwarren.org/2010/06/oauth-and-web2py-part-1/
The normal way seem to be to add that code to a model file, but it
will be visible/executed for all controllers in the application.
On Mon, Jun 21, 2010 at 5:34 AM, pk wrote:
> hi together,
>
> i need help. i need an init to initialize some code like this
> (importing apis etc.):
>
> import time
@mdipierro - Do you mean do I have multiple versions of Python on my
system?
$ ls usr/bin/ shows ->
...
-rwxr-xr-x 1 root root 82 Jul 10 2008 pydoc
-rwxr-xr-x 1 root root 3572 Jul 10 2008 python
lrwxrwxrwx 1 root root 16 Nov 27 2009 python-config ->
python2.5-config
lrwxrw
When is close_all_instances() in the ConnectionPool class of DAL run?
main.py always calls close_all_instances through BaseAdapter which
seems to always be SQLDB() from sql.py. BaseAdapter is a class in
dal.py that inherits from ConnectionPool, but main.py importas
BaseAdapter from sql.py instead
try below.
db().select(\
db.Members.ALL,\
maxDate,\
left=\
db.MemberEvents.on(db.Members.id ==
db.MemberEvents.MemberID),\
having=(maxDate > date)|
(db.MemberEvents.EventDate==None), \
g
It is necessary. The original fix did not cause an error but did not
update the dict.
On Jun 21, 1:48 am, Yarko Tymciurak
wrote:
> On Jun 21, 1:31 am, mdipierro wrote:
>
> > The fix was wrong but the problem was there. I think I fixed it in
> > trunk. Please check it.
>
> Actually, I'm not sure
Tried with this:
maxDate = db.MemberEvents.EventDate.max()
results =\
db().select(\
db.Members.ALL,\
maxDate,\
left=\
db.MemberEvents.on(db.Members.id == db.MemberEvents.MemberID),\
having=(maxDate > date)|(db.MemberEvents.EventDate==None),\
groupby=db.Members.id)
Same error, "Unknown
crud makes forms and processes form. It would be useless in cron.
I am not even sure you need cron. I think you just need a backgrund
process
web2py.py -S app -M -N -R script.py
On Jun 21, 2:47 am, Narendran wrote:
> Hi,
> I have a need to write a cron job that will be doing a lot of db
> inser
try
@auth.requires(request.client==None or
auth.has_membership('managers'))
On Jun 21, 2:53 am, mika wrote:
> hi
> I can't find solution to call the function protected by auth from
> cron.
>
> I have defined auth group managers, and decorated function with
>
> @auth.requires(not request.wsgi or
thanks. uploading fix in trunk
On Jun 21, 3:34 am, "ont.rif" wrote:
> Massimo, here non-2.4 constructions in tools.py:2838 ( get_query
> method ).
>
> Here my fast fix:
>
> def get_query(self, field, op, value, refsearch=False):
> try:
> if refsearch: format = self.get_f
This is what I would do
- make a single for that contains all fields you need
- use jQuery in the view so that depending on the selected department
some fields are hidden
On Jun 21, 3:38 am, Andrew Buchan wrote:
> Hello,
>
> I am trying to make a form for inserting a new record representing an
try run once with:
db.define_table("member",
SQLField("membership_id", "integer",notnull=True),
SQLField("first_name", "string", notnull=True,length=100),
SQLField("middle_name", "string", notnull=True,length=100),
SQLField("last_name", "string", notnull=Tru
SQLField(
auth.settings.allow_basic_login=True
On Jun 21, 4:23 am, Sven wrote:
> Hello!
>
> Reading the entries in this group related to authentification brought
> no solution for this problem:
>
> This is my controller:
> @auth.requires_login()
> def demo():
> return dict(msg='Hello World')
>
> Callin
In the next month I will diff the book online with the original and
rebuild everything.
On Jun 21, 6:50 am, cjrh wrote:
> On Jun 21, 9:59 am, Stefan Scholl wrote:
>
> > There are (3 month old) comments on those
> > pages who address this, but nothing got changed.
>
> I fixed a couple recently.
Probably it would not be hard to implement. I will look into this next
week but if somebody sends me a patch before that I will take it.
Massimo
On Jun 21, 9:25 am, Carles Gonzalez wrote:
> Hi,
>
> I have developed some applications in web2py, and 2 are running
> currently in gae, but now i have
Thanks for sharing. But ...
I put exactly same code on your page to a myapp/controllers/maze.py,
even use your version of processing.min.js, processing.init.js,
jquery.js, but it just does not work exactly the same as your demo.
When I click somewhere in the maze, say coordinate (x,y), my maze
rea
You can also do
if response.flash: response.headers['web2py-component-
flash']=response.flash
before return and you can keep using response.flash and session.flash
as usual.
On Jun 21, 10:10 am, Iceberg wrote:
> Wow, thanks very much for sharing this trick. I knew it could be easy
> and elegant
+1
On Jun 21, 10:44 am, Doug Warren wrote:
> I wrote a small tutorial on how to use OAuth with web2py by linking a
> session with a Twitter account. A future update will include
> embedding the access token with auth and creating an oauth
> login_method class. It can be found
> athttp://dougwa
On Jun 21, 10:57 am, Yarin wrote:
> @mdipierro - Do you mean do I have multiple versions of Python on my
> system?
>
> $ ls usr/bin/ shows ->
> ...
> -rwxr-xr-x 1 root root 82 Jul 10 2008 pydoc
> -rwxr-xr-x 1 root root 3572 Jul 10 2008 python
> lrwxrwxrwx 1 root root 16 N
You can put it in a function in a module but you still need to import
it and call the function where needed. You can put it a model if all
controller need it or a in a controller if only one needs it.
On Jun 21, 10:49 am, Doug Warren wrote:
> The normal way seem to be to add that code to a model
I've get it wrong, on GAE file uploading works, but one has to modify
the application to charge the uploaded files on the database.
Idem for sessions and tickets, personally I don't like this, so I will
stay away from GAE (for this and the big query limitations, I cant
make too much things), but is
Hi Doug,
I am traveling and this deseves a careful answer. I will try next week
when I will return from vacation. Sorry about this.
On Jun 21, 11:07 am, Doug Warren wrote:
> When is close_all_instances() in the ConnectionPool class of DAL run?
> main.py always calls close_all_instances through
Look at the sql it generates. Figure out what is wrong with it and
figure out what the correct should look like. When we can try
implement it in dal.
On Jun 21, 11:26 am, "Joseph S. Greenawalt"
wrote:
> Tried with this:
>
> maxDate = db.MemberEvents.EventDate.max()
> results =\
> db().select(\
>
See these lines:
x=int((mouseX-20)/
n);
y=int((mouseY-20)/n);
There is a bug in processing the mouseX and mouseY return wrong
coordinates depending on the location of the canvas in the page. the
"-20" fixes the offset for me. For you it may be different.
On Jun 21, 11:44 am, Iceberg wrote
Ok, thanks! I would like to make the patch myself, but the innards of
web2py are somewhat complex...
Thanks again, Carles.
On Mon, Jun 21, 2010 at 6:43 PM, mdipierro wrote:
> Probably it would not be hard to implement. I will look into this next
> week but if somebody sends me a patch before tha
The only file you need to look into is gluon/contrib/gql.py
specifically the select() function which calls filter returns the Rows
object
On Jun 21, 11:55 am, Carles Gonzalez wrote:
> Ok, thanks! I would like to make the patch myself, but the innards of
> web2py are somewhat complex...
>
> Thank
@Yarko
> Try to compare these two:
> $ python -c 'import sys; print sys.path'
> and, from your web2py directory:
> $ python web2py.py -S welcome
> >>> import sys; print sys.path
> Compare the two to see what's missing;
Results, in order:
[
'',
'/usr/lib/python2.5/site-packages/PyAMF-0.5.1-py2.5
I have no idea and I cannot test it now. One more suggestion... edit
3285 try:
3286 import pyamf
3287 import pyamf.remoting.gateway
3288 except:
3289 return "pyamf not installed or not in Python
sys.path"
and replace it with
3
Thanks for the tips! So here comes my modified version with a
calibration feature, so that one-file-fits-all!
var calibrated=0;
var offsetX=0;
var offsetY=0;
...
alert('Click the upper-left corner for calibration.');
void mousePressed() {
if(!calibrated){
// There is a bug in processing the
Not sure if this is a web2py or ckeditor problem or just some
misunderstanding on my part. Here's what's happening:
If I create a CKEditor instance in a SQLFORM, things work as expected until
I try to insert an image. Clicking the Ok button in ckeditor's image dialog
appears to be causing an imme
Hi Massimo, thanks for your sharing another undocumented magic of
web2py, the response.headers['web2py-component-flash'], in this post,
http://groups.google.com/group/web2py/msg/6049af89fbfa2bfc
That makes me think that is just another example to justify my
proposal, this time it is refined to aut
On Jun 21, 12:18 pm, Yarin wrote:
> @Yarko
>
> > Try to compare these two:
> > $ python -c 'import sys; print sys.path'
> > and, from your web2py directory:
> > $ python web2py.py -S welcome
> > >>> import sys; print sys.path
> > Compare the two to see what's missing;
>
> Results, in order:
>
> [
OK. I really stink at SQL (one of the reasons I chose web2py - I come
from a different programming background and just can't seem to wrap my
head around queries). Here's as far as I was able to get in trying to
code this using db.executesql:
q='''
select distinct m.MemberID, m.EventDate
from (
I can't configure a ssl virtualhost.
How can I bypass the ssl requirement for admin page ?
Thank you.
Julien
People here know some cheap hosts, but "free" sounds better than
"cheap". :-) Hope your searching adventure can bring back some info
to the group. By the way, I just saw this but did not try them.
http://www.free-webhosts.com/webhosting-01.php
On Jun20, 4:34am, Giuseppe Luca Scrofani wrote:
> He
Got it!
Stripped the try-catch and let the import fail...
TICKET:
ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the
Python egg
cache:
[Errno 13] Permission denied: '/.python-eggs'
The Python egg cache directory is currently
On Jun 21, 2:01 pm, Yarin wrote:
> Got it!
> Stripped the try-catch and let the import fail...
>
> TICKET:
> ExtractionError: Can't extract file(s) to egg cache
>
> The following error occurred while trying to extract file(s) to the
> Python egg
> cache:
>
> [Errno 13] Permission denied: '/.pyt
I like the idea. Let me think a little bit about the implementation
until the end of this week.
Why {{=BEAUTIFY(response._vars.values()[0])}} and not
{{=response._vars.values()[0]}}
On Jun 21, 1:09 pm, Iceberg wrote:
> Hi Massimo, thanks for your sharing another undocumented magic of
> web2py, th
Ok, I'll try.
Carles
El 21/06/2010, a las 19:03, mdipierro escribió:
> The only file you need to look into is gluon/contrib/gql.py
>
> specifically the select() function which calls filter returns the Rows
> object
>
> On Jun 21, 11:55 am, Carles Gonzalez wrote:
>> Ok, thanks! I would like t
http://web2pyslices.com/main/slices/take_slice/71
On 21 juin, 19:42, oncle_bob wrote:
> I can't configure a ssl virtualhost.
>
> How can I bypass the ssl requirement for admin page ?
>
> Thank you.
>
> Julien
Hi all, I've just installed my first remote copy of web2py, I acquired
a node on vps.net, installed the ubuntu LAMP image, connected via ssh
to the shell and installed all the software via this very useful (and
beatiful!) script:
http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-u
> You should
> be able to add this to options_std.py; I think you should be able,
> alternatively, to do this
> in your parameters*.py file
> (seehttp://www.web2py.com/book/default/section/4/1?search=environ).
>
> that is, put these lines in either:
>
> import os
> os.environ[PYTHON_EGG_CACHE]=..
Hi, as I wrote in another thread Im installing web2py on vps.net and I
have some problem, maybe with apache... I dont know, I hope someone
answer while I serch some info. But now my question is, I read in
manual the included wsgi server in web2py it is not intended for
production use due to lack of
knitatoms,
On Jun 3, 6:46 pm, knitatoms wrote:
> Is it the intention that web2py can be deployed usingRocketfor
> production sites?
The key issue for Rocket and web2py is that it breaks backward
compatibility with Python 2.4. Rocket just won't run on 2.4. I'd love
to move all my production sites
edit the url and replace http:// with https://
On Jun 21, 3:28 pm, Giuseppe Luca Scrofani
wrote:
> Hi all, I've just installed my first remote copy of web2py, I acquired
> a node on vps.net, installed the ubuntu LAMP image, connected via ssh
> to the shell and installed all the software via this
I thought Rocket did run on 2.4. If not, we need to make compatible.
On Jun 21, 4:06 pm, brado wrote:
> knitatoms,
>
> On Jun 3, 6:46 pm, knitatoms wrote:
>
> > Is it the intention that web2py can be deployed usingRocketfor
> > production sites?
>
> The key issue for Rocket and web2py is that it
So simple and so effective :D Thanks my hero. Im now able to login in
the admin panel with the same root password of the system, but Im
unable to install any appliances, made by me or dowloaded from the
appliance archive and uploaded to the node. It simply response a flash
popup telling "unable to
massimo,
> I thought Rocket did run on 2.4.
My colleague and I had consistent failures getting 1 .7 9.2 to run on
a CentOS server whose conservative upgrade policy required Python 2.4.
To verify I tried running on an Ubuntu server and had no problems
until we began using Python 2.4. Experiments
Any chance this could be considered as well?
Currently the DAL doesn't allow you to set the parent which is
required for GAE entity groups.
http://groups.google.com/group/web2py/browse_thread/thread/3c11deb2bfadf207/96a4324e5fd0cf71?lnk=gst&q=GAE+parent#96a4324e5fd0cf71
On Jun 22, 7:35 am, Carle
On Jun 21, 10:44 pm, Giuseppe Luca Scrofani
wrote:
> But now my question is, I read in
> manual the included wsgi server in web2py it is not intended for
> production use due to lack of configurability. But this for a small
> site make sense?
It depends :)
I run an intranet app serving some tens
On Mon, Jun 21, 2010 at 17:44, Giuseppe Luca Scrofani
wrote:
> Hi, as I wrote in another thread Im installing web2py on vps.net and I
> have some problem, maybe with apache... I dont know, I hope someone
> answer while I serch some info. But now my question is, I read in
> manual the included wsgi
On Mon, Jun 21, 2010 at 18:40, Giuseppe Luca Scrofani
wrote:
> So simple and so effective :D Thanks my hero. Im now able to login in
> the admin panel with the same root password of the system, but Im
> unable to install any appliances, made by me or dowloaded from the
> appliance archive and uplo
On Mon, Jun 21, 2010 at 13:30, mdipierro wrote:
> try
>
> @auth.requires(request.client==None or
> auth.has_membership('managers'))
I think the best way to do it is to fake an authentication in the cron
script, isn't it?
--
Álvaro Justen - Turicas
http://blog.justen.eng.br/
21 9898-0141
I think this problem is the wrong one for you to focus on - when you
configure your web2py instance to run
as something other than root (_never_ run a web server as root: IF
you get the slightest injection, it will have abiliity to have full
control, do _anything_ to your system!)
Configure prope
FYI - for year (years?) www.web2py.com ran on just cherrypy --- it
had one problem with download streaming of large files on only some
browsers (e.g. downloads of web2py archives would be incomplete). I
think cherrypy folks my have fixed that.
In anycase, there is precedence for using it for ho
Roger that Yarko- I will do as you say. Big thanks to you and Massimo
too for sticking with me today- It was my first time on this board,
and my first week with web2py, and I've been nothing but impressed
with what I've seen- Awesome framework, great support
On Jun 21, 9:52 pm, Yarko Tymciurak
w
On Mon, Jun 14, 2010 at 14:49, Anand Vaidya wrote:
> Some quick updates:
>
> 1) The labnote book is released as an Opensource app and it can be
> found @ http://cynote.sourceforge.net/ They are actually using the app
> as a digital journal
>
> 2) Met zoom quiet :-)
very shot say hollo, and i make
You are correct, that is what decorators are for.
@logged in()
def myControllerforLoggedInUser()
return dict()
I agree that the folders need to be organized better, but this can be
done without really re-programming, as web2py is very flexible. Why
not try to create the folder structure and file
I'm not sure what I'm doing wrong... I've built a JSON service on
top of Web2py that uses Auth.login_bare() to authenticate via
AJAX... my auth_user table looked like this (standard):
auth.settings.table_user = db.define_table('auth_user',
Field('first_name', length=512,default='', require
I'm not sure what I'm doing wrong... I've built a JSON service on
top of Web2py that uses Auth.login_bare() to authenticate via
AJAX... my auth_user table looked like this (standard):
auth.settings.table_user = db.define_table('auth_user',
Field('first_name', length=512,default='', require
77 matches
Mail list logo