Hi ,
I was using rewrite for making the URL reader friendly . When I use a space
or hypen in the URL instead of passing it to the controller , it gives an
invalid request .
I have configured the routes as follows
routes_in = (( r'/$id/$name' , r'/app/default/view/$id/$name') )
routes_out = ( (
I am not convinced about tab. I hate tab, it only causes problems.
On May 1, 12:29 am, Jonathan Lundell jlund...@pobox.com wrote:
On Apr 25, 2011, at 7:46 PM, Massimo Di Pierro wrote:
I agree.
Perhaps tab should be retained as well.
On Apr 25, 8:59 pm, Jonathan Lundell
yes
routes_in = (( r'/$id/$name' , r'/app/default/view/$id/$name'), )
routes_out = ( ( r'/app/default/view/$id/$name' , r'/$id/$name'), )
the extra comma at the end. ;-)
On May 1, 12:58 am, Syed Mushtaq syed1.mush...@gmail.com wrote:
Hi ,
I was using rewrite for making the URL reader
I guess one question is what is the point.
It's very similar to the regex [:print:] which apparently in PERL includes
[:space:] which includes \t. I was actually using it to strip out tabs but I
ended up going with a custom validator.
http://en.wikipedia.org/wiki/Regular_expression
On 05/01/2011 07:18 AM, Massimo Di Pierro wrote:
http://hackerpublicradio.org/eps/hpr0711.mp3
OH NICE!!!
Very good!
BR,
Jason Brower
I need to make sure curtain session data is wiped when the user is
logged out.
This bring up two things:
1: How can I run a method like that to make sure this happens when ever
the logout is clicked.
2: I wonder if there could be a spacial area of sessions that is just
for that users
i'm understand right now, thank you so much for your detail reference,
pbreitenbach
On Sun, May 1, 2011 at 10:49 AM, pbreit pbreitenb...@gmail.com wrote:
Because sql.log only tracks define_tables(). As noted in the Book:
Currently the DAL API does not provide a command to create indexes on
thank you so much for your detail explaination, Vinicius Assef. i like what
u've wrote on your blog. just for info, i'd realized that if you want to
validate self reference table, it can do on the define table (returns an
error)
On Sun, May 1, 2011 at 10:22 AM, Vinicius Assef
i'd like your logic bruno, could you explain about the function, please?
000_essentials.py = what for?
100_authdatabase.py = what for?
200_dbmodel.py = what for?
300_validators.py = what for?
400_utilities.py = what for?
500_preload.py = what for?
thank you so much
On Sun, May 1, 2011 at 11:03
Thanks, now is working
2011/4/30 villas villa...@gmail.com
Hi Martin
I was just trying out powerpack but it seems there are a few things
broken, I suppose you are working on that?
plugin_ip2_admin.py def editcat should be catedit
.xml() has been cancelled etc.
Regards, D
--
hi,
is there anybody know the difference between is_not_empty(),
notnull=true and required=true?
should i use both or just 1 of it's?
please give an advice or pointer about this
thank you so much in advance
In powerpack I have this:
config.py (application settings)
data.py (all the db definition and menus)
main.py (auth, mail, service, registration settings, etc) (this is
independant of the app)
then I usually do:
mod_clients.py
mod_users.py
mod_someother.py
mod_someother2.py
I have classes like
hi,
is anybody know how to create nested list? my intention is to create
category that have sub category (parent child list), should i use 2
table or just one table that refer to itself?
e.g.
db.define_table('category',
Field('title'
)
)
thank you so much for your info, martin, i've already tried and learn from
powerpack plugins, it's cool but because i'm a newbie in python and web2py,
so that a lot of things on powerpack that i don't know the function is what
for?
pardon me, could you explain about:
mod_clients.py = what for?
mod_clients.py = what for?
mod_users.py = what for?
It was an example, you can have mod_nameyouwant.py.
and inside you have for example something like this:
class Clients(object):
def show():
'show a list of clients'
def delete():
'delete ...'
def add():
On Apr 30, 2011, at 11:13 PM, Massimo Di Pierro wrote:
I am not convinced about tab. I hate tab, it only causes problems.
In Python it does, but it solves problems elsewhere. I don't know what the
expected use case is for CLEANUP; I don't see it used anywhere in the web2py
apps.
It might
just an example, i'm understand right now, thank you so much, martin
On Sun, May 1, 2011 at 8:29 PM, Martín Mulone mulone.mar...@gmail.comwrote:
mod_clients.py = what for?
mod_users.py = what for?
It was an example, you can have mod_nameyouwant.py.
and inside you have for example
Thanks Massimo for the reply ,
I tried with the comma at the end but no luck :(
I traced it back to the code where it was giving a 400 and found that its
not able to match the regular expression in
rewrite.py function regex_url_in line 542 , The regular expression for this
is
regex_url =
On May 1, 2011, at 7:23 AM, Syed Mushtaq wrote:
Thanks Massimo for the reply ,
I tried with the comma at the end but no luck :(
I traced it back to the code where it was giving a 400 and found that its not
able to match the regular expression in
rewrite.py function regex_url_in line
Hi,
You can see this:
http://www.web2py.com/book/default/chapter/06
[Self-Reference and Aliases]
Best Regards,
Jose
try this:
auth.sesttings.logout_onlogout = lambda user,s=session:
session.clear()
On May 1, 2:46 am, Jason Brower encomp...@gmail.com wrote:
I need to make sure curtain session data is wiped when the user is
logged out.
This bring up two things:
1: How can I run a method like that to make
notnull = True is enforced at the level of the database and the field
value cannot be None/NULL
requires=is_not_empty() is enforced in forced in forms ate web2py
level
required=True is completely different. It has nothing to do with the
field value. It requires that a value always be specified in
I do not have a strong opinion. I can make it accept tab. Uploading to
trunk.
On May 1, 8:57 am, Jonathan Lundell jlund...@pobox.com wrote:
On Apr 30, 2011, at 11:13 PM, Massimo Di Pierro wrote:
I am not convinced about tab. I hate tab, it only causes problems.
In Python it does, but it
thank you so much for your reference link jose
On Sun, May 1, 2011 at 9:52 PM, Jose jjac...@gmail.com wrote:
Hi,
You can see this:
http://www.web2py.com/book/default/chapter/06
[Self-Reference and Aliases]
Best Regards,
Jose
i'm understand right now, thank you so much for your detail explaination,
massimo
Hi,
I used the script 'setup-web2py-nginx-uwsgi-ubuntu.sh' to configure
my server.
But now when I go to http://myserver.com, it automatically redirect me
to http://myserver.com/welcome
Now I want to configure apache to map http://MYAPP.domain.com/ to
http://myserver.com/MYAPP.
So I think I
hi Massimo,
how about the following:
the _select/select would accept extra parameter 'inner_join' with
syntax/semantic analog to 'left', but emit JOIN at the sql level.
In case of such a unpleasant query as mine, it would be possible to
construct it with inner_join instead of the usual way.
My
The Nginx web server has it's own way to configure routing. Have a look at:
http://nginx.org/en/docs/http/server_names.html
You might be able to get what you want simply by setting a
default_application in routes.py:
1. in web2py directory, open router.example.py
2. modify default_application =
Sorry Its not with the nginx script but the apache script !
I want to redirect each subdomains on different web application of
we2py :
sub1.domain.com
- welcome app
sub2.domain.com
- application2
So changing only the default application on routes.py its not the
prefered solution
On 1
Any ideas please!
*
On 1 май, 00:20, cyber vlad.mul...@gmail.com wrote:
hi everyone!
I need a help/hint/advase again.
I have a code in the controller:
results=db((db.autos.dt=t1)
(db.autos.dt=t2)).select(orderby=~db.autos.dt)
export
Have you tried using the new parameter-based routing system to map
subdomains to different apps (see
http://web2py.com/book/default/chapter/04#Parameter-Based-System)? If that
doesn't work, maybe you can do it with the older pattern-based system (
I wanted to spend a correction on the logical layout. Removing the sum of the
amount+ 1, pq instead of displaying 5 records per page, for example, is
showing 6.
http://web2py.com/book/default/chapter/12#Pagination
http://web2py.com/book/default/chapter/12#Pagination
_limit = (page * per_page,
You can provide a link to the controller below, instructing the user
to right click on it and then select 'save link as...', he can store
the response in any selected directory using his choice of filename (a
name ending in .csv):
def tocsv():
response.headers['content-type']='text/csv'
There have many many positive articles written about web2py. It's a
good idea to collect them and place on the web2py.org website.
On Apr 30, 11:18 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
http://hackerpublicradio.org/eps/hpr0711.mp3
I try to collect them all using twitter.
Massimo
On May 1, 4:09 pm, VP vtp2...@gmail.com wrote:
There have many many positive articles written about web2py. It's a
good idea to collect them and place on the web2py.org website.
On Apr 30, 11:18 pm, Massimo Di Pierro
I remind you that, for months we had these:
http://web2py.com/layouts
but also these:
http://web2py.com/drupal
and these:
http://web2py.com/zengarden
they are all converted automatically so some may work and some may
not. If you can help improve the drupal anes and the zengarden ones, I
will
In trunk we have - experimentally - conditional web2py models
1) models/anything.py (for all controllers)
2) models/c/anything.py (only forfunction in controller c)
3) models/c/f/anything.py (only for function f in controller c)
when you can http:///c/f
all models 1 are executed
Thanks I found that for each domains :
In routes.py on web2py root folder :
routers = dict(
BASE = dict(
# default_controller =
'default',
domains = {
app1.com : app1,
app2.com : app2
}
),
)
But I can't use Parameter-Based
As I understand it, we only get the Markitup editor for a text field
when we install plugin_wiki.
Does anyone have an easy step-by-step method to do it otherwise?
you just need this code in your views and plugin_wiki/markitup under
static/.
{{
response.files.append(URL('static','plugin_wiki/markitup/
jquery.markitup.pack.js'))
response.files.append(URL('static','plugin_wiki/markitup/sets/markmin/
set.js'))
p.s. you need the markiup js that comes with plugin_wiki because the
official one does not support markmin. One year ago I have submitted a
patch to the author but never got back from him. Perhaps you can help
by contacting him and advocating for it.
On May 1, 6:18 pm, Massimo Di Pierro
great improvement, I am testing right now.
A question that will raise soon is: How do I execute a model on demand? if I
am in /default/foo and want an object defined in /default/bar, how do I
force this model file to run?
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
On Sun, May 1,
I tried lot of things and I cant use Parameter Based System + Pattern-
Based System at same time
How can I do to map controllers and other when I use :
routers = dict(
BASE = dict(
# default_controller =
'default',
domains = {
app1.com : app1,
On Sunday, May 1, 2011 8:27:39 PM UTC-4, Alexandre Strzelewicz wrote:
I tried lot of things and I cant use Parameter Based System + Pattern-
Based System at same time
No, currently you cannot mix the two systems. However, you might be able to
use the pattern-based system to do the
not that I recommend this but you can do
def index():
execfile(os.path.join(request.folder,'models','mymodel.py'))
...
return locals()
The execfile can be outside.
I do not think it is a good idea because it would not take advantage
of pyc caching, bytecode compilation would break
In dealing with authentication and session do I need to deal with raw
cookies? or does web2py handle that for me?
On May 1, 2011, at 5:27 PM, Alexandre Strzelewicz wrote:
I tried lot of things and I cant use Parameter Based System + Pattern-
Based System at same time
How can I do to map controllers and other when I use :
routers = dict(
BASE = dict(
# default_controller =
it does.
if 'counter' in request.cookies:
# retrieve cookie
counter = request.cookies['counter'].value +1
else:
counter=1
# set cookie
response.cookies['counter'] = counter
request.cookies[name] is a Morsel Object
http://docs.python.org/library/cookie.html
Massimo
On May 1, 7:36 pm,
Ok, thanks
Example:
How do I allow a user to stay logged in to my site for as long as
possible? Or have the site remeber the user? without allowing the user
log in again and again
On May 2, 1:56 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
it does.
if 'counter' in request.cookies:
Nononononononono
This breaks the way it currently works. I have multile web2py apps that take
advantage of subfolders for models to group them in the way they should
execute.
This feature means i could NEVER upgrade my apps again.
On May 1, 2011 7:44 PM, Massimo Di Pierro
How can I include HTML in an RSS feed? By default HTML tags are escaped,
even though generic.rss has escape=False.
Nice work.
You can try it by clicking the [zengarden] button on the top-right corner
of the page
Top-left
On Sunday, May 1, 2011 9:28:13 PM UTC-4, Plumo wrote:
How can I include HTML in an RSS feed? By default HTML tags are escaped,
even though generic.rss has escape=False.
Does it work if you wrap the HTML in XML() (see
http://web2py.com/book/default/chapter/05#XML)?
Thadeus, this is an improvement for code organization and less use of
memory, I dont think it breaks compatibility. because there are no place in
actual documentation where you can find info about using subfolders. Massimo
said sometime ago that subfolders was reserved for future implementation.
web2py cookies never expire (unless the client deleted cookies) but
authentication does in two ways:
1) it check last acces datetime so you can change the expiration time
in seconds
auth.settings.expiration = 100
2) admin deletes session files that have been unused in a while, so
delete
How about we provide a script that fixes that automatically?
models/a/b.py - models/a_b/py
is anybody else using model subfolder?
Massimo
On May 1, 8:09 pm, Thadeus Burgess thadeus.burg...@gmail.com wrote:
Nononononononono
This breaks the way it currently works. I have multile web2py
Am I understanding correctly that we could save memory by not loading all
models on all page views? That seems like a reasonable objective.
yes. You would not be saving memory as much as you would be saving
time.
On May 1, 9:50 pm, pbreit pbreitenb...@gmail.com wrote:
Am I understanding correctly that we could save memory by not loading all
models on all page views? That seems like a reasonable objective.
Would there be an approach to this using some sort of loading scheme? The
directory approach seems like it could get cumbersome as well as be
problematic for models that are used in multiple controllers.
I too would like to know what is the best way to interact with the
experts4solutions list. Do we just spam the list with the work I
have?
On Apr 27, 2:25 pm, Jim Karsten iiijjj...@gmail.com wrote:
We are working on a new web2py project. We are making progress and web2py
has certainly improved
I tested here, I created designs seen around the controller and also in
specific actions,and everything is quiet, working perfectly.
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*
2011/5/2 pbreit pbreitenb...@gmail.com
Would there be an
Yes, lets say we have this app:
models/general.py # this model and all models in root folder is always
executed
models/default/something.py # this model and all on the same folder is only
executed when http:///app/default/* is requested
models/default/index/something.py # this model and all
Will need more tests or already is scheduled to play for production?
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*
2011/5/2 Bruno Rocha rochacbr...@gmail.com
Yes, lets say we have this app:
models/general.py # this model and all models in
Also, I think it is a benefit when working with 'web2py_components' that
today on every ajax call executes all models again on a separate request, in
a modular page built with 5 components we are going to have all models
loaded for 5 different requests.
This new approach is a memory saver if you
experts4solutions should be considered an association of web2py
experts.
experts4solutions does not take programming jobs. The members and/or
the companies of members take the jobs and write the contracts.
As an association we do not open the doors to everybody but only to
those programmers who
On Mon, May 2, 2011 at 12:04 AM, pbreit pbreitenb...@gmail.com wrote:
Would there be an approach to this using some sort of loading scheme? The
directory approach seems like it could get cumbersome as well as be
problematic for models that are used in multiple controllers.
I agree that some
It works for me but under the hood there were a few changes.
We need to make sure that indeed we did not break anything and in
particular we did not break backward compatibility.
Some people, like Thadeus, have been using subfolders already. I do
not think that should be considered a backward
Breaking with other versions will be difficult, because they will be using
templates tothe application level. With that would not cause any bugs.
Perhaps what needs to betested is the automatic update of the framework.
_
*Gilson Filho*
*Web Developer
Im somewhat new to web2py, having tried out django first. I like this
much more. But one thing im still wondering is how others manage their
web2py installations vs the applications in them. Especially when
needing to push an application to your server/live site. Normally
(like iwth django, or
On Mon, May 2, 2011 at 12:25 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
It works for me but under the hood there were a few changes.
We need to make sure that indeed we did not break anything and in
particular we did not break backward compatibility.
For me this does not
I'm wondering why this doesn't work:
delta=datetime.timedelta(seconds=15*60)
db(request.now(db.qa.time_start+delta)).count()
TypeError: can't compare datetime.datetime to Expression
while this one does:
delta=datetime.timedelta(seconds=15*60)
I do that with mercurial (HG)
I have web2py folder as an hg repo, when a new version of web2py is released
I pull my web2py folder to the current release, in development I always work
with trunk.
Inside applications folder I have one HG repo for each application, on
development I push that to
Can I do joins in CRUD?
I'm getting a 404 Not Found error with this:
rows=crud.select(db((db.qa.candidate==user_id)(db.quiz.id==db.qa.quiz)))
But the following works alright:
rows=db((db.qa.candidate==user_id)(db.qa.quiz==db.quiz.id)).select()
/r
Nik
I have this button that redirects to a URL:
form[0][-1][1].append(INPUT(_type='button',_value=T('Previous')
,_onclick='document.location=%s'
%URL(question)))
what do I add to _onclick to do the following:
1) session.current_item -=1
2) redirect(URL('question'))
/r
Thanks Anthony.
I've actually tried that, but it was a tad too slow for me. :(
On May 1, 12:32 pm, Anthony abasta...@gmail.com wrote:
This may help:http://www.web2pyslices.com/main/slices/take_slice/85
On Saturday, April 30, 2011 10:53:16 PM UTC-4, niknok wrote:
I am clueless about
How would i use applications in a different directory? would there be
any pros/cons to doing it like this? After getting an application
setup i find (so far, more advanced stuff might be different) i dont
edit the core web2py stuff very often. I can see the application in a
different dir could be
Except that I don't have any models that are specific to components. Will I
need to duplicate model files into each folder corresponding to the
controllers that use them? My models seem to be fairly cross-controller so
I'm not sure how I will use this approach.
This screams import to me.
=== default.py ===
from myapp.models import db
def index()
...
I do exactly the same as Bruno, including pushing to BitBucket.
I assume a symbolic link should work but it's not really necessary. If you
create your HG repos at the app level, it all works fine.
79 matches
Mail list logo