Re: [web2py] Re: tip of the day. The power of routes

2014-07-06 Thread Nguyen Minh Tuan
Hi Lyn2py, can you send your script? On 5 July 2014 14:33, lyn2py wrote: > Hi Tuan, > > I tried the change (line in red) but it couldn't route to my app properly. > I'm not familiar with the regex routes, so I'm using it as-is. I don't know > how to troubleshoot this. > > > > On Friday, July 4,

[web2py] Re: tip of the day. The power of routes

2014-07-05 Thread lyn2py
In using this routes.py, cannot have the word "admin" within the function. Not sure why that is so, but it breaks the routes and generates an "Invalid Request". This was my issue: https://groups.google.com/forum/#!topic/web2py/2GyztlR-ZYI In addition, I am unable to use more than the default.py

Re: [web2py] Re: tip of the day. The power of routes

2014-07-05 Thread lyn2py
Hi Tuan, I tried the change (line in red) but it couldn't route to my app properly. I'm not familiar with the regex routes, so I'm using it as-is. I don't know how to troubleshoot this. On Friday, July 4, 2014 9:59:37 AM UTC+8, Nguyen Minh Tuan wrote: > > Hi Massimo, > > Lyn2py posted above

Re: [web2py] Re: tip of the day. The power of routes

2014-07-04 Thread lyn2py
Hi Tuan I will try your modification when I get back to my terminal and post back on the results. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You re

Re: [web2py] Re: tip of the day. The power of routes

2014-07-03 Thread Nguyen Minh Tuan
Hi Massimo, Lyn2py posted above is that issue I met, I post complete script : (I mark the only one line I changed with red color) -- routes.py --- config = ''' site1.com.vn /hhp/default site2.com.vn /welcome/default ''' def auto_in(apps): routes = [

[web2py] Re: tip of the day. The power of routes

2014-07-03 Thread Massimo Di Pierro
There is nothing "default" specific in the script. Something else must be the problem. On Thursday, 3 July 2014 07:04:44 UTC-5, lyn2py wrote: > > I have a question for anyone using this… I realized that it only works for > redirects to the functions within default.py. If I setup another > contr

[web2py] Re: tip of the day. The power of routes

2014-07-03 Thread lyn2py
I have a question for anyone using this… I realized that it only works for redirects to the functions within default.py. If I setup another controller, it can't route to that controller. Is this the intended behaviour? How can I include other controllers without having to add one controller for

[web2py] Re: tip of the day. The power of routes

2014-07-01 Thread lyn2py
I don't know how I missed this, but these routes are working very well and very stable on production server. Thanks Massimo for sharing the great tip! On Monday, June 23, 2014 12:51:03 PM UTC+8, Massimo Di Pierro wrote: > > Can you post the complete correct script? thanks. > > On Sunday, 17 Oct

[web2py] Re: tip of the day. The power of routes

2014-06-22 Thread Massimo Di Pierro
Can you post the complete correct script? thanks. On Sunday, 17 October 2010 21:03:25 UTC-5, mdipierro wrote: > > Replace your web2py/routes.py with this: > > - begin routes.py--- > try: config=open('routes.conf','r').read() > except: config='' > def auto_in(apps): > r

[web2py] Re: tip of the day. The power of routes

2014-06-22 Thread Nguyen Minh Tuan
Hi Massimo, I think there is error in your script : CURRENT line 69 : ('.*:https?://(.*\.)?%s:$method /$anything' % domain, '%s/$anything' % path) should be : ('.*:https?://(.*\.)?%s:$method /%s/$anything' % (domain, app), '/%s/$anything' % app) Regards, Tuan On Monday, October 25, 2010 11:04

[web2py] Re: Tip of the day... ajax buttons in grid

2013-03-08 Thread wwwgong
can you explain what triggers view refresh after thing.update_record(active=not thing.active) On Thursday, March 7, 2013 5:09:01 PM UTC-5, wwwgong wrote: > > I am using v2.4.2 on win7, tried both chrome and firefox, same issue, I > have to do a refresh to see Active field checked/unchecked > > O

[web2py] Re: Tip of the day... ajax buttons in grid

2013-03-07 Thread 黄祥
nice tips, thank you. just a suggestion if user use the signature in the table, i think it can be implement in field : is_active please correct me if i'm wrong -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group

[web2py] Re: Tip of the day... ajax buttons in grid

2013-03-07 Thread wwwgong
I am using v2.4.2 on win7, tried both chrome and firefox, same issue, I have to do a refresh to see Active field checked/unchecked On Thursday, March 7, 2013 4:54:45 PM UTC-5, Massimo Di Pierro wrote: > > It should update it. it does for me. > > On Thursday, 7 March 2013 15:43:08 UTC-6, wwwgong w

[web2py] Re: Tip of the day... ajax buttons in grid

2013-03-07 Thread Massimo Di Pierro
It should update it. it does for me. On Thursday, 7 March 2013 15:43:08 UTC-6, wwwgong wrote: > > Thanks for the tip, > I noticed that the checkbox is not updated after clicking on/off button. > how to make active field refresh automatically > > > On Wednesday, March 6, 2013 9:09:41 PM UTC-5, Mass

[web2py] Re: Tip of the day... ajax buttons in grid

2013-03-07 Thread wwwgong
Thanks for the tip, I noticed that the checkbox is not updated after clicking on/off button. how to make active field refresh automatically On Wednesday, March 6, 2013 9:09:41 PM UTC-5, Massimo Di Pierro wrote: > > Do you know you can do this? > > > db.define_table('thing',Field('name'),Field('ac

Re: [web2py] Re: tip of the day. The power of routes

2011-02-17 Thread Bruno Rocha
jqgrig, plugin_wiki or any other plugin which has a controller can't work with this autoroutes, because in autotoures we define a default controller in this case 'default.py' is the controller. any request with ' domain.com/action' will try to find this action inside default.py, but plugin_wiki and

Re: [web2py] Re: tip of the day. The power of routes

2011-02-16 Thread Johann Spies
On 16 February 2011 17:35, Bruno Rocha wrote: > Thats my working solution > > http://snipt.net/rochacbruno/routespy/ > > http://snipt.net/rochacbruno/routesconf/ > > > Thanks. It is about the same as mine. I was just wondering whether my jqgrid-problem (another thread) on my production server wa

Re: [web2py] Re: tip of the day. The power of routes

2011-02-16 Thread Bruno Rocha
Thats my working solution http://snipt.net/rochacbruno/routespy/ http://snipt.net/rochacbruno/routesconf/ -- Bruno Rocha http://about.me/rochacbruno/bio 2011/2/16 Johann Spies > > > On 29 November 2010 01:03, Bruno Rocha wrote: > >> HI, I am trying

Re: [web2py] Re: tip of the day. The power of routes

2011-02-16 Thread Johann Spies
On 29 November 2010 01:03, Bruno Rocha wrote: > HI, I am trying to use autoroutes for the firsttime, what I want is my site > running in 127.0.0.1:8080/index instead of 127.0.0.1/app/default/index. > > I tried the autoroutes and routes.conf explained here but i did't figure > out how to make the

[web2py] Re: tip of the day with a challenge

2011-02-01 Thread DenesL
The processing of the records depends on that. A short lived idea was to use dbset.query to get the info but since the query can look like a tree full of ANDs and ORs its complicated. So, no easy way out?. On Feb 1, 3:17 pm, Massimo Di Pierro wrote: > You cannot tell easily from just looking at i

[web2py] Re: tip of the day with a challenge

2011-02-01 Thread Massimo Di Pierro
You cannot tell easily from just looking at it. On Feb 1, 2:05 pm, DenesL wrote: > I have been thinking about this. > How can one tell if the resulting records are going to have fields > from multiple tables?. > > On Jan 30, 12:01 am, Massimo Di Pierro > wrote: > > > > > > > > > Immagine you hav

[web2py] Re: tip of the day with a challenge

2011-02-01 Thread DenesL
I have been thinking about this. How can one tell if the resulting records are going to have fields from multiple tables?. On Jan 30, 12:01 am, Massimo Di Pierro wrote: > Immagine you have the following (suggested by user Nik): > > db.define_table('person',Field('name'),format='%(name)s') > db.

[web2py] Re: Tip of the day

2011-01-10 Thread mart
Yes, I saw the slice and was all sounds great, I just dont have the big picture on how they stay linked (at least i don't see it)..other thing that may do the trick is a variation on the "audit slice"... looking into that one Do we know if this 'Tip of the day' works well with the audit (saw t

[web2py] Re: Tip of the day

2011-01-10 Thread Arun K.Rajeevan
This one was there at web2pyslice's But It doesn't worked for me when I had a field of type file in one of the forms. Yes, it worked fine on rocket server comes with web2py. But I had to make that work on GAE (but it doesn't worked) I had a long thread here. And waiting Massimo to figure out wha

[web2py] Re: Tip of the day

2011-01-10 Thread mart
Hi, Just tried this and does the trick! :) I''m just a little unclear on how these two (or more?) tables are linked once submitted? Example: request forms. There can be many types of requests and let's say that they all have a set fields that all request forms have (like: name, email, priority, cr

[web2py] Re: Tip of the day

2010-12-12 Thread Carlos
Hi, I am wondering how this solution (single form with linked tables) can be used for updates (in addition to creates)?. Thanks, Carlos On Dec 6, 4:32 am, DenesL wrote: > True, only restriction is no common field names. > I have added this to the book. > > On Dec 5, 11:05 pm, mdipierro wr

[web2py] Re: Tip of the day

2010-12-06 Thread DenesL
True, only restriction is no common field names. I have added this to the book. On Dec 5, 11:05 pm, mdipierro wrote: > No field names in comment yes. References between them is not a > problem as long the reference fields are not writable and readable > when generating the form. > > On Dec 5, 9

[web2py] Re: Tip of the day

2010-12-05 Thread weheh
This is the first time I'm seeing the construct "_filter_fields". I can guess at what it does, but could you explain, please? I couldn't find it in the doc. Also, for clarification, do readable and writable only apply to forms (seems so)? If a field is writable=False, it seems like it can still be

[web2py] Re: Tip of the day

2010-12-05 Thread mdipierro
No field names in comment yes. References between them is not a problem as long the reference fields are not writable and readable when generating the form. On Dec 5, 9:41 pm, DenesL wrote: > This only works for tables that do not have field names in common > and have no references between them.

[web2py] Re: Tip of the day

2010-12-05 Thread DenesL
This only works for tables that do not have field names in common and have no references between them. On Oct 16, 9:57 am, mdipierro wrote: > It often happens that you have two tables (for example 'client' and > 'address' which are linked together by a reference and you want to > create a singl

Re: [web2py] Re: tip of the day. The power of routes

2010-11-28 Thread Bruno Rocha
HI, I am trying to use autoroutes for the firsttime, what I want is my site running in 127.0.0.1:8080/index instead of 127.0.0.1/app/default/index. I tried the autoroutes and routes.conf explained here but i did't figure out how to make the access to static files to work. I am using web2py 1.89.5

[web2py] Re: tip of the day. The power of routes [CLOSED]

2010-10-24 Thread mdipierro
:-) On Oct 24, 11:19 pm, VP wrote: > Great. It appears to be working as intended now.  Thanks.

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Great. It appears to be working as intended now. Thanks.

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
Aha! My mistake. $a should have been $anything everywhere in the code. I fixed is and re-posted in trunk now under scripts/autoroutes.py Massimo On Oct 24, 10:51 pm, VP wrote: > Update: > > if the function has no arguments, it works.  I.e.   > http://domain.com/app/default/f > gets mapped corr

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Update: if the function has no arguments, it works. I.e. http://domain.com/app/default/f gets mapped correctly to http://domain.com/f But if the function has arguments, it did not work for me. I.e http://domain.com/app/default/g/a/b does not get mapped to http://domain.com/g/a/b PS: I got

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
The messages that starts the thread explains that. I tried and it works. On Oct 24, 9:02 pm, VP wrote: > What works is thathttp://domain1.comwill map to app1 as intended. > > What doesn't work is that app1/default/f/a/b is not mapped to f/a/b or > vice versa.  This is ugly. > > Can you show me ho

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
What works is that http://domain1.com will map to app1 as intended. What doesn't work is that app1/default/f/a/b is not mapped to f/a/b or vice versa. This is ugly. Can you show me how to get rid of "app1/default"? Thanks.

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Thank you Massimo. Your script as is didn't work for me (I use debian lenny). Apache complained about not recognizing virtual hosts and that there was a duplicate of the wgsi deamon (I suppose only one deamon should be named web2py). I had to modify it to make it work. (But still not desirable,

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
Assuming you have the routes described above and this in routes.conf - BEGIN routes.conf--- domain1.com /app1/default domain2.com /app2/default - END -- you would need this in apache config file: WSGIDaemonProcess web2py user=www-data group=www- data WSGIProcessGroup web

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Massimo, Can you please show us more specifically how to do this? (I think someone also asked the same question in a previous topic). Thanks. On Oct 24, 1:25 pm, mdipierro wrote: > This assumes web2py is serving static files. But it does not prevent > you to use a apache for it. > In this cas

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
This assumes web2py is serving static files. But it does not prevent you to use a apache for it. In this case you would need the virtual hosts for the different apps. On Oct 24, 1:18 pm, VP wrote: > Can Massimo or someone clarify if this tip will result in web2py > serving static files or Apache

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Can Massimo or someone clarify if this tip will result in web2py serving static files or Apache serving static files? Is this a "production" (high-performance) set up? The assumption "one domain per app" appears to suggest that this is a production set up. Yet, Massimo mentioned in an early tip s

[web2py] Re: tip of the day. The power of routes

2010-10-19 Thread Martin.Mulone
Great tip!. This is very usefull! and you make it in trunk :D On 17 oct, 23:03, mdipierro wrote: > Replace your web2py/routes.py with this: > > - begin routes.py--- > try: config=open('routes.conf','r').read() > except: config='' > def auto_in(apps): >     routes=[ >         (

[web2py] Re: tip of the day. The power of routes

2010-10-18 Thread VP
thank you. I think many of us can use this tip. Many of these tips should be archived somewhere.

Re: [web2py] Re: tip of the day. The power of routes

2010-10-18 Thread Michele Comitini
WoW :D 2010/10/18 Albert Abril : > Wow! Thank you Massimo. > Just now I was having that problem. > > On Mon, Oct 18, 2010 at 9:01 AM, Tom Atkins wrote: >> >> Fantastic - thanks Massimo.  That is extremely useful - my regex skills >> are pretty poor but this really helps with getting to grips with

Re: [web2py] Re: tip of the day. The power of routes

2010-10-18 Thread Albert Abril
Wow! Thank you Massimo. Just now I was having that problem. On Mon, Oct 18, 2010 at 9:01 AM, Tom Atkins wrote: > Fantastic - thanks Massimo. That is extremely useful - my regex skills are > pretty poor but this really helps with getting to grips with routes.py. > > Love the 'tips of the day' -

Re: [web2py] Re: tip of the day. The power of routes

2010-10-18 Thread Tom Atkins
Fantastic - thanks Massimo. That is extremely useful - my regex skills are pretty poor but this really helps with getting to grips with routes.py. Love the 'tips of the day' - keep 'em coming! On 18 October 2010 03:07, mdipierro wrote: > I put the script in trunk under scripts/autoroutes.py >

[web2py] Re: tip of the day. The power of routes

2010-10-17 Thread mdipierro
I put the script in trunk under scripts/autoroutes.py to use it cp scripts/autoroutes.py routes.py then edit routes.conf as explained below: On Oct 17, 9:03 pm, mdipierro wrote: > Replace your web2py/routes.py with this: > > - begin routes.py--- > try: config=open('routes.c

Re: [web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-08 Thread Michele Comitini
with a .load component, it wouldn't be more cleaner and reusable? 2010/10/8 Thadeus Burgess : > How about this... > > It allows to use it in any normal form, you still have to press the > submit button, but it means no security issues. It also downgrades > gracefully if the client does not have ja

Re: [web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread Thadeus Burgess
How about this... It allows to use it in any normal form, you still have to press the submit button, but it means no security issues. It also downgrades gracefully if the client does not have javascript $(document).ready(function() { $('.boolean').each(function() { var on_off; if($(t

[web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread mdipierro
Point taken. How about Say you have a table db.define_table('item',Field('name'),Field('check','boolean',default=False)) you can have two controllers like def items(): rows=db(db.item.owner==auth.user_id).select() return dict(rows=rows) def check(): # this is a callback! i

[web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread guruyaya
> No the check action never creates any record. it just allows you to > edit if you have access... OK, Imagine that. Say I have a "show my email to the world" boolean on my blog. Say I'm allowing pictures in my comments, for registered users. Now the attacker, puts this tag: http://www.mysite.com/

Re: [web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread Thadeus Burgess
You should modify this a little bit to turn any boolean checkbox into this. The javascript will hide the checkbox and replace it with this custom widget, but since the checkbox still exists on the DOM it works on any form. -- Thadeus On Thu, Oct 7, 2010 at 2:14 PM, mdipierro wrote: > No the

[web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread mdipierro
No the check action never creates any record. it just allows you to edit if you have access... # optional check if auth.user is allowed to edit record On Oct 7, 1:30 pm, guruyaya wrote: > I'm not sure, but isn't this method open to Cross site scripting? I > can create an image tag with t

[web2py] Re: tip of the day: how to make a ON/OFF toggle button to represent a boolean field

2010-10-07 Thread guruyaya
I'm not sure, but isn't this method open to Cross site scripting? I can create an image tag with the http://.../check with ease! On Oct 6, 8:26 pm, mdipierro wrote: > Say you have a table > > db.define_table('item',Field('name'),Field('check','boolean',default=False)) > > you can have two control