Ah yes, so back to my original thought
db(status == 'pending').update(status = 'pending-' + request.now)
for db(status == 'pending-' + request.now).select():
task.update_record(status = 'processing-' + request.now
success = do_the_long_thing(task)
fail
if success:
Just letting everyone know about this... This is AWESOME. As a
programmer, I don't like css... but this makes css that much more
bearable :)
http://sandbox.pocoo.org/clevercss/
now only if I could integrate this into web2py
-Thadeus
--
You received this message because you are
OK,
It works perfectly well using the Python version of my
distribution. :-)
I wanted to install version 2.4, 2.5, 2.6 of Python to test my code
and later contribute to Web2Py.
Why do I need to do more than just build and install Python from the
source?
Here are the test results for my Python
I never got the global thing to work, there is another article
somewhere (cant remember maybe at slices) that tells of a different
option by using a conditional at the begining of your controllers. I
am using the following now:
if 0:
from gluon.globals import *
from gluon.html import *
what's the problem with integrating it into web2py?
On Dec 29, 10:31 am, Thadeus Burgess thade...@thadeusb.com wrote:
Just letting everyone know about this... This is AWESOME. As a
programmer, I don't like css... but this makes css that much more
bearable :)
Sugestion:
I think that a better spec would be a directory to plugins, with a diretory
for the plugin, and a application-like struture. So web2py read it as read
application directory.
- application
--cache
--controllers
..
--models
--modules
..
--plugins
---myplugin
cache
It is a bug.
On Dec 28, 11:54 pm, Thadeus Burgess thade...@thadeusb.com wrote:
When I set
auth.settings.controller = 'admin'
Shouldn't it then default to that?
When I request an action that requries login, it takes me
tohttp://127/init/default/user/loginwhich is... well wrong.
I think you need both sqlite3 and (optional) tkinter
On Dec 29, 3:12 am, pierreth pierre.thibau...@gmail.com wrote:
OK,
It works perfectly well using the Python version of my
distribution. :-)
I wanted to install version 2.4, 2.5, 2.6 of Python to test my code
and later contribute to
web2py libraries does not use (a if Condition else b) but example apps
and plugins may.
It works with 2.4 but you need some extra modules. There is an
AlterEgo entry about this.
On Dec 29, 7:48 am, Richard richar...@gmail.com wrote:
did you manage to get web2py running with 2.4? I noticed
This was discussed. I did not rule it out but now as then I have to
point out that things are more complex than it seems.
If plugins have models in their own folder, then should all models be
executed when a non-plugin controller is called, including plugin
models? If so, there would be a lot
As a programmer??? But if Blogitizer has the shiny and cleaner interface
I could see in web2py...
thanks for lower my morale :-P
Alex
El 29/12/2009 9:31, Thadeus Burgess escribió:
Just letting everyone know about this... This is AWESOME. As a
programmer, I don't like css... but this makes css
Hi,
I'm getting an error for putting cron in default welcome application
which came with web2py 1.74.4 src code
I edited crontab file in welcome application as:
0-59/1 * * * * *default/index
Error:
WARNING:root:WEB2PY CRON: exception: list index out of range
WARNING:root:Traceback (most recent
0-59/1 * * * * user *default/index
On Dec 29, 11:55 am, vvk varunk.ap...@gmail.com wrote:
Hi,
I'm getting an error for putting cron in default welcome application
which came with web2py 1.74.4 src code
I edited crontab file in welcome application as:
0-59/1 * * * * *default/index
Error:
Thanks sir, it's working now.
On Dec 29, 10:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:
0-59/1 * * * * user *default/index
On Dec 29, 11:55 am, vvk varunk.ap...@gmail.com wrote:
Hi,
I'm getting an error for putting cron in default welcome application
which came with web2py 1.74.4
My testing show that having a taskbar=True in the options.py results
in the splash screen and the taskbar icon
However using 'web2py_no_console.exe -t -L options.py ' results in not
having the splash screen but also not the taskbar icon as well. Task
Manager shows the exe actually running in the
If plugins have models in their own folder, then should all models be
executed when a non-plugin controller is called, including plugin
models? If so, there would be a lot overhead to new directory
structure. Moreover in which order would they be executed? Whatever
you choose would not be obvious.
I mean integrate into web2py in that it will generate new css files if
the clevercss file has changed on the next pass through... its just
some glue code in a model to make it happen.
As a programmer??? But if Blogitizer has the shiny and cleaner interface I
could see in web2py...
thanks for
Let me look more into this and think about it.
On Dec 29, 12:23 pm, Delaney delaneygilli...@gmail.com wrote:
My testing show that having a taskbar=True in the options.py results
in the splash screen and the taskbar icon
However using 'web2py_no_console.exe -t -L options.py ' results in not
I think I agree with Thadeus in his exposition, this way we could
implement a quickly module setup page for applications where you can
choose install uninstall modules inside applications.
Another thing:
What about a plugin designed to overrides views/layout.html or views/
web2py_ajax.html or
I agree that what I call a plugin^1 is not what other people call a
plugin^2.
Within the current system you can already create a plugins/ subfolder
and put stuff in there as Alexandre and others have proposed.
They would not be visible by web2py but you could create a special
model
You can just put your clevercss in
private/style.clevercss
and use a controller like this:
def style():
import os, stat, clevercss
expire = 10**10 # never
filename = os.path.join
(request.folder,'private','style.clevercss')
def gettime(): return os.stat(filename)[stat.ST_SIZE]
Very clever, thank you! If it crashes, these items will be lost
though. Is there a way to use transactions, to pull a single item at
a time from the table, process and delete it, within a single
transaction? Something like this:
while queue is not empty:
db.begin()
task =
I think there are a few examples in sql.py, such as lines 2928 and
2939
On Dec 30, 1:53 am, mdipierro mdipie...@cs.depaul.edu wrote:
web2py libraries does not use (a if Condition else b) but example apps
and plugins may.
It works with 2.4 but you need some extra modules. There is an
How the settings 'auth.settings.allow_basic_login = True' is supposed
to work? I tried to login to protected method('@auth.requires_login
()') via basic auth, but was not succesfull. Is there some additional
setting for protected methods or '@auth.requires_login()'' is simply
used for both auth ?
I make a new version, Full Breadcrumb for applications that use nested
functions, where you want the user pass by a function first to go to
another, so you can set the parent functions, getting the history of
navigation or hide the own function
Attention. There is no db.begin(). it is implicit. You can commit
automatically but why not:
while queue is not empty:
task = db(~status.belongs(('done','failed'))).select(limitby=
(0,1))[0]
success = do_long_thing(task)
if success:
task.update(status =
The allow basic login allows you to call functions that
@auth.requires_login() by passing the credential using basic auth for
example call the url using wget and curl.
How are you using it?
On Dec 29, 2:59 pm, David Marko dma...@tiscali.cz wrote:
How the settings
Ouch! You are right. That code slipped in. I have just removed them in
trunk (hg only, I am having problem posting on launchpad) and will
repost 1.74.5 later this week.
Massimo
On Dec 29, 2:59 pm, Richard richar...@gmail.com wrote:
I think there are a few examples in sql.py, such as lines 2928
Sorry I don't understand you, could you put an example please?
Alex F
El 29/12/2009 22:14, Alexandre Andrade escribió:
I make a new version, Full Breadcrumb for applications that use
nested functions, where you want the user pass by a function first to
go to another, so you can set the
Hi,
I was going through the Crash course in web2py found on
http://www.web2py.com/AlterEgo/default/show/253/1. After the Adding
Views part I get a invalid function message when clicking on a blog
post and I was wondering what lies beneath this error. Is invalid
function covering for a 404 or
I want to know how create a w2p file of plugin, like in themes.w2p
2009/12/29 mdipierro mdipie...@cs.depaul.edu
This was discussed. I did not rule it out but now as then I have to
point out that things are more complex than it seems.
If plugins have models in their own folder, then should
Actually I did found a couple of more typos in the code example and I
have fixed them now.
Also it is important that before you create posts using appadmin, you
create an account and login in your application, else the posts have
no author. This was designed to mimic the Django app referenced in
There are two ways.
1) In admin if you create a model or controller called
plugin_somrthing.py you will se at the bottom of the edit page a
plugin item already created for you. Click on it and you get to the
plugin page. There is a [pack plugin] button that will give you the
w2p.
2) For more
thanks
2009/12/29 mdipierro mdipie...@cs.depaul.edu
There are two ways.
1) In admin if you create a model or controller called
plugin_somrthing.py you will se at the bottom of the edit page a
plugin item already created for you. Click on it and you get to the
plugin page. There is a [pack
On Dec 15, 2009, at 3:23 PM, mdipierro wrote:
You may also want to look into scripts/cleanhtml.py and scripts/
cleancss.py.
cleanhtml.py would benefit from some comments
--
You received this message because you are subscribed to the Google Groups
web2py-users group.
To post to this
Does .update_record() call a db.commit()?
-Thadeus
On Tue, Dec 29, 2009 at 2:10 PM, toomim too...@gmail.com wrote:
if success:
db.commit()
else:
db.rollback()
--
You received this message because you are subscribed to the Google Groups
Currently I am using the following, works perfect for my applications...
import re
def save_pre(match):
s = match.group()
if s.startswith('pre') \
or s.startswith('textarea') \
or s.startswith('blockquote'):
pass
else:
s = ''
return s
def
You can also do:
def compress_response(d):
if not isinstance(d,dict): return d
import scripts.cleanhtml
return scripts.cleanhtml.cleanhtml(response.render(d))
On Dec 29, 8:06 pm, Thadeus Burgess thade...@thadeusb.com wrote:
Currently I am using the following, works perfect for my
Mine compresses it all to one line.
-Thadeus
On Tue, Dec 29, 2009 at 9:15 PM, mdipierro mdipie...@cs.depaul.edu wrote:
You can also do:
def compress_response(d):
if not isinstance(d,dict): return d
import scripts.cleanhtml
return scripts.cleanhtml.cleanhtml(response.render(d))
A transaction starts when a request arrive and it is committed when a
request returns. If there is an error that it not caught the
transaction is rolledback.
You can insert db.commit() (and db.rollback()) everywhere to break the
transaction in smaller parts.
Massimo
On Dec 29, 8:54 pm, toomim
Hi sir,
Cron job function in my application is working only when there is no
validator for that function.
My function:
@auth.requires_permision('xyz')
def takebackup():
Is there a way to put a validator for that function because if there
is no validator, any one can run backup function.
This is
Thank you. So you are saying that each request basically does:
sql BEGIN
...
call appropriate controller function
...
sql COMMIT if success
What I do not understand is:
1) When called from cron, there is no automatic begin transaction,
so where does the begin come from?
2)
Please advise.
Error traceback
Traceback (most recent call last):
File gluon/restricted.py, line 173, in restricted
exec ccode in environment
File /home/web2py/applications/test/models/db.py, line 12, in
module
SQLField('network',type=cidr))
File
I need your help debugging this... the relevant code in sql.py is
if isinstance(field.type,SQLCustomType):
ftype = field.type.native or field.type.type
elif ...
elif not field.type in self._db._translator:
raise SyntaxError,
You are referring to the auth decorator. Try this:
@auth.requires(not request.env.remote_addr or auth.has_permission
('xyz'))
def takebackup():
When the request comes from cron there is no request.env.remote_addr
On Dec 29, 9:29 pm, vvk varunk.ap...@gmail.com wrote:
Hi sir,
Cron job
From: http://www.firstsql.com/tutor5.htm
In SQL92, there is no BEGIN TRANSACTION statement. A transaction
begins with the execution of a SQL-Data statement when there is no
current transaction. All subsequent SQL-Data statements until COMMIT
or ROLLBACK become part of the transaction. Execution
any simple example on how to create a persistent background process
that runs continuously on the server side no matter what user signs in
or out, and no matter how many concurrent users are on the system?
Here are a couple of examples:
when a user performs an event, it kicks off a server side
There are many GAE types that one may want to use. Today I needed
StringListProperty so I extended the web2py GAE apy so that you can
have a field of type
db.define_table('person',Field('names','.StringListProperty()'))
and you can do
db.person.insert(names=['Massimo','Max'])
I simply tried to call the method with URLcontaining the username/
password. e.g. tttp://username:p...@localhost:8080/ . Its just
internal call so its fine that username/pwd is in URL. I simply tried
this in browser, but login form apeared instead.
David
On Dec 29, 10:25 pm, mdipierro
This code start to work
===
from gluon.sql import SQLCustomType
db = DAL('postgres://web2py:gfhj...@db.sibnet.su/test1',
pool_size=10)
inet = SQLCustomType ( type='string',native='inet')
db.define_table('firewall',
SQLField('network',type=inet))
===
Look like
==from gluon.dal
50 matches
Mail list logo