[web2py] session.connect() on 127.0.0.1 or on domain.

2014-07-01 Thread Annet
I have a front-end (init) and a back-end (myleoneuxs) application in db.py 
of the init application I set:

session.connect(request, response, masterapp=myleonexus)

so they share the same session.

The init application has the following menu items:

{{if auth.is_logged_in():}}
  lia href={{=URL('myleonexus', 'default', 
'index')}}myLeonexus/a/li
{{else:}}
  lia href={{=URL('myleonexus', 'default', 'user', 
args='login')}}Login/a/li
{{pass}}


on 127.0.0.1:8000 this works. In production I needed to add a scheme and 
host to the url

{{if auth.is_logged_in():}}
  lia href={{=URL('myleonexus', 'default', 'index', scheme='https', 
host='my.leonexus.com')}}myLeonexus/a/li
{{else:}}
  lia href={{=URL('myleonexus', 'default', 'user', args='login', 
scheme='https', host='my.leonexus.com')}}Login/a/li
{{pass}}

now the menu no longer works it contains the menu item 'login' even if the 
user is logged in. What's the difference between
the two, which causes it to no longer work?

Regards,

Annet

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: auth.login() and use of _next

2014-07-01 Thread lyn2py
I just saw this post, and it explains the issue I'm facing. I guess will 
wait for the patch.

https://groups.google.com/forum/#!topic/web2py/e5eNdZnW4uc

My version:
2.9.5-trunk+timestamp.2014.06.14.10.06.38
(Running on Rocket 1.2.6, Python 2.7.1) 

On Tuesday, July 1, 2014 11:36:00 AM UTC+8, Anthony wrote:

 The code you have shown would not show up in the HTML page source -- they 
 are calls to the redirect() function, which happens server side. You might 
 need to show more context to indicate where/when those redirect calls 
 happen.

 Anthony

 On Monday, June 30, 2014 9:02:59 PM UTC-4, lyn2py wrote:

 What I did was to have two links generated:

 redirect(URL('default','user',args='login',vars=dict(_next=URL(args=request.args,
  
 vars=request.vars
 redirect(URL('default','user',args='register',vars=dict(_next=URL(args=request.args,
  
 vars=request.vars

 And on the separate pages (login vs register), do a view source, search 
 for _next. The post-login vs post-register redirects are as reflected in 
 the _next in the source code, which, for:

- register - the _next is correctly reflected
- login - the _next is not correctly reflected

 Hope that explained well. Thanks for assisting!

 On Monday, June 30, 2014 9:23:57 PM UTC+8, Anthony wrote:

 Can you show the code or explain how you are adding the _next variable? 
 What does the final URL look like?

 Anthony

 On Monday, June 30, 2014 6:38:29 AM UTC-4, lyn2py wrote:

 Thanks Annet for the reply. 

 I did not use the function you mentioned, auth.login_next(). 

 I specifically only used _next, which is in the URL (as vars). Which, 
 according to your reply, should be the priority/overriding post-login 
 redirect, is that correct?



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: improving uwsgi configuration

2014-07-01 Thread lyn2py
Hi Niphlod,

I'm using nginx, uwsgi, ubuntu setup as well. And restarting the 
uwsgi-emperor caused all my apps to fail with

Internal errorTicket issued: unrecoverable

I need to get the apps back without having to reinstall everything...

Newbie question… where can I find web2py2.xml to remove the vacuum 
directive you mentioned? Anything else I need to do? Thanks!

On Friday, December 7, 2012 6:02:37 AM UTC+8, Niphlod wrote:

 PS: confirmed that the error is related to having a vacuum directive on 
 web2py2.xml  I though it was a safer default, but removing it solved 
 this final issue Is there something against 'vacuum' using the emperor 
 mode ?

 PS2: uwsgi is just awesome :-P



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: improving uwsgi configuration

2014-07-01 Thread lyn2py
Sorry for the noise, I have resolved it after some mucking around. For 
those who run into similar situations, you may find your answers in the 
uwsgi.log (errors are logged there)

You may need to muck around to get to it, if yours isn't already at 
 /var/log/uwsgi/uwsgi.log

Good luck!

On Thursday, December 6, 2012 7:50:07 AM UTC+8, Niphlod wrote:

 call for help. I almost managed to get a simple uwsgi emperor config 
 running on upstart (will post that script soon) on ubuntu. Hopefully it 
 should alleviate the problems and the intricacies of 
 managing/installing/upgrading the overcomplicated standard debian 
 distribution. Works on 12.04 and on 12.10, with a single issue... 

 I have the usual nginx+uwsgi combo, all works ok if I start uwsgi in 
 emperor mode with upstart, but fails on restarting the uwsgi daemon the 
 socket gets reaped after restart and no process is respawned to handle the 
 web2py process
 Basically: 
 start uwsgi-emperor
 #all fine
 stop uwsgi-emperor
 #bad gateway, correct, reporting errors in nginx log trying to access a 
 non-existing socket file
 root@w2p-tests:/tmp# start uwsgi-emperor
 uwsgi-emperor start/running, process 2279
 root@w2p-tests:/tmp# restart uwsgi-emperor
 uwsgi-emperor start/running, process 2304
 #bad gateway, correct, reporting errors in nginx log trying to access a 
 non-existing socket file... doh!

 configurations and logs available at 
 https://dl.dropbox.com/s/qhapgzee667zx3m/uwsgi.tar.gz
 Anyone having this problem ?



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: auth.login() and use of _next

2014-07-01 Thread Massimo Di Pierro
It should be fixed. Is it not?

On Tuesday, 1 July 2014 03:20:30 UTC-5, lyn2py wrote:

 I just saw this post, and it explains the issue I'm facing. I guess will 
 wait for the patch.

 https://groups.google.com/forum/#!topic/web2py/e5eNdZnW4uc

 My version:
 2.9.5-trunk+timestamp.2014.06.14.10.06.38
 (Running on Rocket 1.2.6, Python 2.7.1) 

 On Tuesday, July 1, 2014 11:36:00 AM UTC+8, Anthony wrote:

 The code you have shown would not show up in the HTML page source -- they 
 are calls to the redirect() function, which happens server side. You might 
 need to show more context to indicate where/when those redirect calls 
 happen.

 Anthony

 On Monday, June 30, 2014 9:02:59 PM UTC-4, lyn2py wrote:

 What I did was to have two links generated:

 redirect(URL('default','user',args='login',vars=dict(_next=URL(args=request.args,
  
 vars=request.vars
 redirect(URL('default','user',args='register',vars=dict(_next=URL(args=request.args,
  
 vars=request.vars

 And on the separate pages (login vs register), do a view source, search 
 for _next. The post-login vs post-register redirects are as reflected in 
 the _next in the source code, which, for:

- register - the _next is correctly reflected
- login - the _next is not correctly reflected

 Hope that explained well. Thanks for assisting!

 On Monday, June 30, 2014 9:23:57 PM UTC+8, Anthony wrote:

 Can you show the code or explain how you are adding the _next variable? 
 What does the final URL look like?

 Anthony

 On Monday, June 30, 2014 6:38:29 AM UTC-4, lyn2py wrote:

 Thanks Annet for the reply. 

 I did not use the function you mentioned, auth.login_next(). 

 I specifically only used _next, which is in the URL (as vars). Which, 
 according to your reply, should be the priority/overriding post-login 
 redirect, is that correct?



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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): 
 routes=[ 
 ('/robots.txt','/welcome/static/robots.txt'), 
 ('/favicon.ico','/welcome/static/favicon.ico'), 
 ('/admin$a','/admin$a'), 
 ] 
 for a,b in [x.strip().split() for x in apps.split('\n') \ 
 if x.strip() and not x.strip().startswith('#')]: 
 if not b.startswith('/'): b='/'+b 
 if b.endswith('/'): b=b[:-1] 
 app = b.split('/')[1] 
 routes+=[ 
 ('.*:https?://(.*\.)?%s:$method /' % a,'%s' % b), 
 ('.*:https?://(.*\.)?%s:$method /static/$a' % a,'%s/static/ 
 $a' % app), 
 ('.*:https?://(.*\.)?%s:$method /appadmin/$a' % a,'%s/ 
 appadmin/$a' % app), 
 ('.*:https?://(.*\.)?%s:$method /$a' % a,'%s/$a' % b), 
 ] 
 return routes 

 def auto_out(apps): 
 routes=[] 
 for a,b in [x.strip().split() for x in apps.split('\n') \ 
 if x.strip() and not x.strip().startswith('#')]: 
 if not b.startswith('/'): b='/'+b 
 if b.endswith('/'): b=b[:-1] 
 app = b.split('/')[1] 
 routes+=[ 
 ('%s/static/$a' % app,'static/$a'), 
 ('%s/appadmin/$a' % app, '/appadmin/$a'), 
 ('%s/$a' % b, '/$a'), 
 ] 
 return routes 

 routes_in=auto_in(config) 
 routes_out=auto_out(config) 
 --- END --- 

 what does it do? It writes routes for you based on a simpler routing 
 configuration file called routes.conf. here is an example: 

 - BEGIN routes.conf--- 
 127.0.0.1   /examples/default 
 domain1.com /app1/default 
 domain2.com /app2/default 
 domain3.com /app3/default 
 - END -- 

 It maps a domain (the left had side) into an app and it shortens the 
 URLs for the app, by removing the listed path prefix. That means 

 http://domain1.com/index will be mapped into  /app1/default/index 
 http://domain2.com/index will be mapped into  /app2/default/index 

 It is safe in that it preserves admin, appadmin, static files, 
 favicon.ico and robots.txt. 

 http://domain1.com/favicon.ico 
 http://domain1.com/robots.txt 
 http://domain1.com/admin/...   /admin/... 
 http://domain1.com/appadmin/...  /app1/appadmin/... 
 http://domain1.com/static/...  /app1/static/... 

 and vice-versa. 

 It does assume one app per domain. 

 I think something like this should be default since lots of people 
 find routes.py hard to work with. 
 Comments? Suggestions? 

 Massimo



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] how to trier submit action of form(SQLFORM) under separated div(outside form)

2014-07-01 Thread Andrey K
Dear web2py users,
I have a straight forward need in trigger submit action of sqlform outside 
of form div - by clicking other button and hide original submit button on 
the form. 
Can I do it and how?
I have only found that I can hide submit button on the original w2p form by 
using:
def myform():
 form = SQLFORM.factory(Field('your_name', requires=IS_NOT_EMPTY()),Field(
'your_image', 'upload'))

return locals()


myform.thml:
div
{{=form}}
/div


divbutton type=submit value=myValue class=btn btn-primarySeparate 
Submit/button/div
Thank you in advance.
All suggestion are very welcome.

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: session.connect() on 127.0.0.1 or on domain.

2014-07-01 Thread Anthony
By default the session cookie will not be shared across subdomains. Try 
adding something like the following in a model file in both apps:

response.cookies[response.session_id_name]['domain'] = '.leonexus.com'

Anthony

On Tuesday, July 1, 2014 4:07:17 AM UTC-4, Annet wrote:

 I have a front-end (init) and a back-end (myleoneuxs) application in db.py 
 of the init application I set:

 session.connect(request, response, masterapp=myleonexus)

 so they share the same session.

 The init application has the following menu items:

 {{if auth.is_logged_in():}}
   lia href={{=URL('myleonexus', 'default', 
 'index')}}myLeonexus/a/li
 {{else:}}
   lia href={{=URL('myleonexus', 'default', 'user', 
 args='login')}}Login/a/li
 {{pass}}


 on 127.0.0.1:8000 this works. In production I needed to add a scheme and 
 host to the url

 {{if auth.is_logged_in():}}
   lia href={{=URL('myleonexus', 'default', 'index', scheme='https', 
 host='my.leonexus.com')}}myLeonexus/a/li
 {{else:}}
   lia href={{=URL('myleonexus', 'default', 'user', args='login', 
 scheme='https', host='my.leonexus.com')}}Login/a/li
 {{pass}}

 now the menu no longer works it contains the menu item 'login' even if the 
 user is logged in. What's the difference between
 the two, which causes it to no longer work?

 Regards,

 Annet


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: When to use jQuery.ajax or $.web2py.component ?

2014-07-01 Thread Anthony
Note, LOAD is just a server-side helper that creates an empty DIV that 
ultimately gets filled via a call to $.web2py.component when the parent 
page is initially rendered in the browser.

Anthony

On Tuesday, July 1, 2014 12:42:21 AM UTC-4, Andrew W wrote:

 Thank you Anthony,
 I have read that section many times, and I'll probably go back and read it 
 again as javascript is not my strong point. 

 Perhaps I'm getting component confused with a component plugin, which may 
 require a view to LOAD it.  Using the looser definition, a callback 
 function (controller) is still a component that can be called by 
 $.web2py.component.

 Maybe Massimo was just using that approach for demonstration / education 
 purposes.  If both are relevant, I'll try the $.web2py.component until I 
 find a situation where I get stuck.   I'll try and rewrite that section of 
 reddit_clone as an example.  

 Regards
 Andrew W

 On Tuesday, July 1, 2014 1:40:17 PM UTC+10, Anthony wrote:

 The jQuery ajax method can be used but is not web2py specific. web2py 
 components provide some additional functionality and convenience. See the 
 documentation: 
 http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components--LOAD-and-Ajax
 .

 Anthony

 On Monday, June 30, 2014 8:30:24 PM UTC-4, Andrew W wrote:

 Hello,
 I've been looking into the use of callbacks and components to make a 
 more dynamic app.   I revisited the reddit_clone app from web2py training 
 videos and noticed that is uses the following:

  jQuery.ajax({method:'post',url:'{{=URL(comm_vote_callback)}}',

 Trying to understand the rule when I would use the above technique over 
 using $.web2py.component.   Is it correct that either could have been used 
 for the reddit_clone scenario ?  

 Thanks



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQLEDITABLE plugin

2014-07-01 Thread 'kato' via web2py-users
Hi.

I tried to make SQLEDITABLE plugin.

demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html

It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
If you are interested, please try.

Thanks.

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: importing a module that has db

2014-07-01 Thread Kurt Jensen
Thank You!
That did it... I was missing current in *models/db.py.*

Now the only problem to solve is that I can not get* URL()* in Module 
*images.py* to point to *http://127.0.0.1:8000/images/*

When I view *http://127.0.0.1:8000/articles/edit/2* which includes module 
*images.py, *
URL(images/show, args=image.id) in  module *images.py* produces 
*http://127.0.0.1:8000/articles/images/show/2 *instead of 
*http://127.0.0.1:8000/images/show/2*

I am sure this is a classic newB question but I have not found the solution 
yet.



On Monday, June 30, 2014 6:37:03 AM UTC-7, 黄祥 wrote:

 yes, you are right, thank you so much for the additional information, 
 anthony.

 *models/db.py*

 from gluon import current
 current.db = db
 current.auth = auth
 current.mail = mail

 best regards,
 stifan


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Using Sphinx to automatically create documentation of an application

2014-07-01 Thread Luis Garcia
Hi all, 

I am just working in a project that involves to create a large App for 
web2py and we would like to use Sphinx to read the docstring documentations 
that we already have in the code. I tried to use the autodoc but some 
problems arise when I tried to make the build.
I saw that the web2py documentation is moving to sphinx, so I am assuming 
that could be possible to document a single app inside web2py with sphinx 
and autodoc. Is it really possible?

Thank you.

Regards,
Luis 

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] can we make E-commerce web portal in web2py for multiple users and hits.

2014-07-01 Thread kanchan
I have to develop a ecommerce software with payment gateway also in web2py. 
In this more than 500 users can use and hit it  simulataneously . My query 
is that will software speed decrease on multiple user hits or web2py will 
not comfortable  for this .  

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] can we make e-commerce web portal in web2py with multiple hits and users.

2014-07-01 Thread kanchan
we have to develop a complete E-commerce software with payment gateway also 
. In this software  more than 500 users will use it , hit it simultaneously 
. So my query is that does web2py can handle multiple user easily , or 
 will it decrease the software speed if we make it in web2py or any other 
issue will create in future with multiple users.

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Security Problem: appadmin is accessible whithout any authentication

2014-07-01 Thread Detlev Bielz
Hello,

we, a small company, are using web2py for some web services with a couple 
of different apps we developed ourselves.
Recently, a collegue of mine pointed me to the fact, that he was able to 
access *https://ourdomain/our_app/appadmin/index* whithout having to 
authenticate in any way. Since these services are my concern, I checked 
instantly, but with three different browsers (firefox, chrome, IE) and 
different user profiles for firefox and chrome I was not able to reproduce 
this.

Now, my collegue observed this phenomenon again, and a third collegue and 
my own browsers could reproduce this issue. But not only '*our_app/appadmin*' 
is accessible; appadmin of ALL other apps as well:

   - *https://ourdomain/our_other_app/appadmin/index*
   - *https://ourdomain/our_third_app/appadmin/index*, even
- *https://ourdomain/welcome/appadmin/index* 
   
is accessible without having to login! The only exception is 
/admin/appadmin, here we have to login.

We all cleared caches etc. from our browsers or used browsers and browser 
profiles we never accessed this web2py instance before.

I know, Massimo recommends to not expose admin and appadmin on production 
instances, but this is not a public server (only known to a small circle of 
customers), and we value the benefit of direct access to appadmin higher 
than the risk. As long as appadmin is protected, that is. So we would like 
to keep this option.

Where can we check why appadmin is not protected any more?

Thanks for your attention,

Detlev

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Sending the ID of the newly registered user in email message (auth.messages.verify_email)

2014-07-01 Thread Kenwyn Pilgrim
Massimo

Thanks. Your suggestion to change the code in gluon/tools.py works like a 
charm.
I am now able to send the ID in email.
Thanks much
(I had initially *misread *your answer as *%(id)s **shouldn't **be allowed*)

On Wednesday, June 25, 2014 10:52:03 AM UTC-5, Massimo Di Pierro wrote:

 wrong cut and paste. From the code

 d = dict(request.vars)
 d.update(dict(key=key, link=link,username=form.vars[username]))

 I just changed

 d = dict(from.vars)
 d.update(dict(key=key, link=link,username=form.vars[username]))

 because you are right. %(id)s should be allowed.

 On Wednesday, 25 June 2014 10:49:54 UTC-5, Massimo Di Pierro wrote:

 from the code gluon/tools.py

 d.update(dict(key=key, link=link,username=form.vars[username]))


 On Tuesday, 24 June 2014 18:08:48 UTC-5, Kenwyn Pilgrim wrote:

 Hi
 I'm trying to send the *id* of the newly registered user in the string 
 *auth.messages.verify_email*. I've tried *%(id)s* but immediately get a 
 ticket.

 type 'exceptions.KeyError' 'id'

 When initializing the string *auth.messages.verify_email*, I've been 
 able to use other place holders, such as *%(first_name)s*, *%(last_name)s 
 *and even customer fields such as *%(referring_name)s*.
 I've tried setting *auth.messages.verify_email* in default.py in the 
 user() function as well, but it returns none.
 I've also tried setting *auth.messages.verify_email * in a custom 
 function through *auth.settings.register_onaccept*. Here I can see the 
 *id* of the newly registered user, but it seems as though at this 
 point, the mail has already been sent.

 Also, where can I find a list of all the place holders such as *%(key)s* 
 etc., 
 that can be used in *auth.messages.verify_email*

 Thanks much
  



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Any one intergrated Indian Payment Systems with web2py app?

2014-07-01 Thread Sarbjit
Hi All,

Has any one integrated Indian Payment System with web2py app. In India, 
ccavenue seems to be more popular (http://www.ccavenue.com/quick.jsp) but 
they doesn't appears to provide python support. 

But apparently, I found few Django app's integarted with ccavenue on 
google, has any one implemented any Indian Payment System with web2py.

I am no-voice to Payment Integration.

-Sarbjit

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: auth.login() and use of _next

2014-07-01 Thread lyn2py
Thanks for clarifying Massimo, I have pulled the latest web2py from trunk 
and it is now working.

Version:
2.9.5-trunk+timestamp.2014.06.30.09.56.25
(Running on Rocket 1.2.6, Python 2.7.1) 

Looking at the dates it was fixed within the 2-week period.
Thank you!!!


On Tuesday, July 1, 2014 9:10:56 PM UTC+8, Massimo Di Pierro wrote:

 It should be fixed. Is it not?

 On Tuesday, 1 July 2014 03:20:30 UTC-5, lyn2py wrote:

 I just saw this post, and it explains the issue I'm facing. I guess will 
 wait for the patch.

 https://groups.google.com/forum/#!topic/web2py/e5eNdZnW4uc

 My version:
 2.9.5-trunk+timestamp.2014.06.14.10.06.38
 (Running on Rocket 1.2.6, Python 2.7.1) 

 On Tuesday, July 1, 2014 11:36:00 AM UTC+8, Anthony wrote:

 The code you have shown would not show up in the HTML page source -- 
 they are calls to the redirect() function, which happens server side. You 
 might need to show more context to indicate where/when those redirect calls 
 happen.

 Anthony

 On Monday, June 30, 2014 9:02:59 PM UTC-4, lyn2py wrote:

 What I did was to have two links generated:

 redirect(URL('default','user',args='login',vars=dict(_next=URL(args=request.args,
  
 vars=request.vars
 redirect(URL('default','user',args='register',vars=dict(_next=URL(args=request.args,
  
 vars=request.vars

 And on the separate pages (login vs register), do a view source, search 
 for _next. The post-login vs post-register redirects are as reflected in 
 the _next in the source code, which, for:

- register - the _next is correctly reflected
- login - the _next is not correctly reflected

 Hope that explained well. Thanks for assisting!

 On Monday, June 30, 2014 9:23:57 PM UTC+8, Anthony wrote:

 Can you show the code or explain how you are adding the _next 
 variable? What does the final URL look like?

 Anthony

 On Monday, June 30, 2014 6:38:29 AM UTC-4, lyn2py wrote:

 Thanks Annet for the reply. 

 I did not use the function you mentioned, auth.login_next(). 

 I specifically only used _next, which is in the URL (as vars). Which, 
 according to your reply, should be the priority/overriding post-login 
 redirect, is that correct?



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: session.connect() on 127.0.0.1 or on domain.

2014-07-01 Thread Annet
Hi Anthony,

Thanks for your reply. I added 

response.cookies[response.session_id_name]['domain'] = '.leonexus.com'


to both apps and now the menus display the correct items.


Best Annet.

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Any one intergrated Indian Payment Systems with web2py app?

2014-07-01 Thread Kiran Subbaraman
I integrated a web2py app with payu (payu.com). Each of these payment 
gateways have their own integration API.
This blog is a useful read: 
http://gaganpreet.in/blog/2013/09/18/how-secure-are-indian-payment-gateways/



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Tue, 01-07-2014 8:24 PM, Sarbjit wrote:

Hi All,

Has any one integrated Indian Payment System with web2py app. In 
India, ccavenue seems to be more popular 
(http://www.ccavenue.com/quick.jsp) but they doesn't appears to 
provide python support.


But apparently, I found few Django app's integarted with ccavenue on 
google, has any one implemented any Indian Payment System with web2py.


I am no-voice to Payment Integration.

-Sarbjit
--
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 received this message because you are subscribed to the Google 
Groups web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
mailto:web2py+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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 received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] jQuery select form items based on name startswith...

2014-07-01 Thread Jordan Ladora
Hi,

I'm trying to make a button that will check some boxes in a form based on 
the checkboxes' name attributes. 

But I can't get this to work-
div id='div2'
  button 
onclick=event.preventDefault();jQuery('input[name^='somecheckbox']').each(function(k){jQuery(this).prop('checked',
 
false);});Deselect All/button
/div

I'm basing it off http://api.jquery.com/attribute-starts-with-selector/

I've tried a few different things but cannot get it to do anything good.. 

Thanks for any pointers,
-jl

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Default value in dict returned by the controller

2014-07-01 Thread Mandar Vaze
Hi,

I have several views which are similar, so I am using common view file 
using response.view =common_view.html rather than separate one per 
controller.

Out of these - 2 or 3 views are slightly different where certain parts of 
the page (layout.html) need to be hidden.

I tried :

return dict(msg=msg, grid=grid, hide_my_div=True)

in the view template I have :

{{if hide_my_div:}}
script
 $(document).ready(function(){
  $(#my_div).hide();
  });
script
{{pass}}

This works for the small number of views where I want to hide my_div
Unfortunately - this also means I need to pass hide_my_div=False from 
large number of controllers.

Is there a way to have hide_my_div=False *as a default* - so that I do not 
need to return it explicitly - and I can override only when needed (2-3 
controllers)
Something like optional params with default values ?

May be the way I am handling this is wrong. Is there a better way ?

(I know that I can create separate view files for these odd ones, but I 
prefer not to, since these are going to be 90% similar to common_view.html 
anyway)

Thanks,
-Mandar

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Default value in dict returned by the controller

2014-07-01 Thread Kiran Subbaraman
globals().get(' hide_my_div',False) should return a False, if this is 
not present.



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Tue, 01-07-2014 10:06 PM, Mandar Vaze wrote:

Hi,

I have several views which are similar, so I am using common view file 
using response.view =common_view.html rather than separate one per 
controller.


Out of these - 2 or 3 views are slightly different where certain parts 
of the page (layout.html) need to be hidden.


I tried :

return dict(msg=msg, grid=grid, hide_my_div=True)

in the view template I have :

{{if hide_my_div:}}
script
 $(document).ready(function(){
  $(#my_div).hide();
  });
script
{{pass}}

This works for the small number of views where I want to hide my_div
Unfortunately - this also means I need to pass hide_my_div=False 
from large number of controllers.


Is there a way to have hide_my_div=False *as a default* - so that I do 
not need to return it explicitly - and I can override only when needed 
(2-3 controllers)

Something like optional params with default values ?

May be the way I am handling this is wrong. Is there a better way ?

(I know that I can create separate view files for these odd ones, 
but I prefer not to, since these are going to be 90% similar to 
common_view.html anyway)


Thanks,
-Mandar
--
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 received this message because you are subscribed to the Google 
Groups web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
mailto:web2py+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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 received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Default value in dict returned by the controller

2014-07-01 Thread Vinicius Assef
I would extend your common view with an empty block to hide the
undesired part and avoid passing this argument to views.

On Tue, Jul 1, 2014 at 1:36 PM, Mandar Vaze mandarv...@gmail.com wrote:
 Hi,

 I have several views which are similar, so I am using common view file using
 response.view =common_view.html rather than separate one per controller.

 Out of these - 2 or 3 views are slightly different where certain parts of
 the page (layout.html) need to be hidden.

 I tried :

 return dict(msg=msg, grid=grid, hide_my_div=True)

 in the view template I have :

 {{if hide_my_div:}}
 script
  $(document).ready(function(){
   $(#my_div).hide();
   });
 script
 {{pass}}

 This works for the small number of views where I want to hide my_div
 Unfortunately - this also means I need to pass hide_my_div=False from
 large number of controllers.

 Is there a way to have hide_my_div=False as a default - so that I do not
 need to return it explicitly - and I can override only when needed (2-3
 controllers)
 Something like optional params with default values ?

 May be the way I am handling this is wrong. Is there a better way ?

 (I know that I can create separate view files for these odd ones, but I
 prefer not to, since these are going to be 90% similar to common_view.html
 anyway)

 Thanks,
 -Mandar

 --
 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 received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] upload progress recipe not working

2014-07-01 Thread cowbert
I'm trying to do a simple manual file upload (without DAL) and display 
progress bar. I would prefer not to use any ajax helpers.
I'm trying to use the upload progress recipe (involving the cache.ram 
tracking in copystream_progress).

Here's my controller default.py:
def index():
if request.extension=='json' and 'X-Progress-ID' in request.get_vars:
cache_key = 'X-Progress-ID:'+request.get_vars['X-Progress-ID']
length = cache.ram(cache_key+':length', lambda: 0, None)
uploaded = cache.ram(cache_key+':uploaded', lambda: 0, None)
from gluon.serializers import json
return json(dict(length=length, uploaded=uploaded))
else:
form = None
patherror = False
#some checking for a valid target path for later use
if not patherror:
#generate uuid
import binascii
myuuid = binascii.hexlify(os.urandom(24))
form=FORM(INPUT(_name='file', 
_type='file'),INPUT(_type='submit', _value='Upload'))
#will do stuff to file upon form accepts
return dict(form=form, myuuid=myuuid)


views/default/index.html:

script type=text/javascript
//Add upload progress for multipart forms
jQuery(function() {
jQuery('form[enctype=multipart/form-data]').submit(function() {
//only submit once per page load
if (jQuery.data(this,'submitted')) return false;
var freq = 1000; //update every n ms
var uuid = '{{=myuuid}}'; //myuuid was generated by the controller 
above
//console.log(uuid);
var progress_url = '{{=URL(extension=json)}}';
//console.log(progress_url)
//Critical construct X-Progress-ID to request
this.action += ((this.action.indexOf('?') == -1) ? '?' : '') + 
'X-Progress-ID=' + uuid;
var progress = jQuery(
'div id=upload-progress 
class=upload-progress/div').insertAfter(
jQuery('input[type=submit]')).append(
'div class=progress-containerspan 
class=progress-infouploading 0%/spandiv 
class=progress-bar/div/div');
jQuery('input[type=submit]').remove()

progress.find('.progress-bar').height('1em').width(0).css(background-color,red);
//func to update progress bar
function update_progress_info() {
progress.show()
jQuery.getJSON(progress_url, {'X-Progress-ID':uuid, 'dummy': 
'xmlhttprequest fix for IE'}, function(data, status) {
if (data) {
var progress_percent = parseInt(data.uploaded) / 
parseInt(data.length);
var width = 
progress.find('.progress-container').width();
var progress_width = width * progress_percent;
progress.find('.progress-bar').width(progress_width);
progress.find('.progress-info').text('uploading ' + 
progress_percent * 100 + '%');
}
window.setTimeout(update_progress_info, freq);
});
};
window.setTimeout(update_progress_info, freq);
jQuery.data(this, 'submitted', true); //finaly mark form as 
submitted
});
});
/script
{{=form}}

I am getting no javascript errors but i get no progress bar and the 
progress-info span doesn't update either. File uploads.

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Using Sphinx to automatically create documentation of an application

2014-07-01 Thread Niphlod
not really. An app is not really structured as a python module/package, so 
what sphinx does with autodoc is not really possible. That being said you 
can play with sphinx going in a file-by-file way.

On Monday, June 30, 2014 6:00:43 PM UTC+2, Luis Garcia wrote:

 Hi all, 

 I am just working in a project that involves to create a large App for 
 web2py and we would like to use Sphinx to read the docstring documentations 
 that we already have in the code. I tried to use the autodoc but some 
 problems arise when I tried to make the build.
 I saw that the web2py documentation is moving to sphinx, so I am assuming 
 that could be possible to document a single app inside web2py with sphinx 
 and autodoc. Is it really possible?

 Thank you.

 Regards,
 Luis 



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Security Problem: appadmin is accessible whithout any authentication

2014-07-01 Thread Niphlod
all the protection logic is in the first 70 lines of the appadmin 
controller. 

On Tuesday, July 1, 2014 8:43:56 AM UTC+2, Detlev Bielz wrote:

 Hello,

 we, a small company, are using web2py for some web services with a couple 
 of different apps we developed ourselves.
 Recently, a collegue of mine pointed me to the fact, that he was able to 
 access *https://ourdomain/our_app/appadmin/index 
 https://ourdomain/our_app/appadmin/index* whithout having to 
 authenticate in any way. Since these services are my concern, I checked 
 instantly, but with three different browsers (firefox, chrome, IE) and 
 different user profiles for firefox and chrome I was not able to reproduce 
 this.

 Now, my collegue observed this phenomenon again, and a third collegue and 
 my own browsers could reproduce this issue. But not only '
 *our_app/appadmin*' is accessible; appadmin of ALL other apps as well:

- *https://ourdomain/our_other_app/appadmin/index 
https://ourdomain/our_other_app/appadmin/index*
- *https://ourdomain/our_third_app/appadmin/index 
https://ourdomain/our_third_app/appadmin/index*, even
 - *https://ourdomain/welcome/appadmin/index 
https://ourdomain/welcome/appadmin/index* 

 is accessible without having to login! The only exception is 
 /admin/appadmin, here we have to login.

 We all cleared caches etc. from our browsers or used browsers and browser 
 profiles we never accessed this web2py instance before.

 I know, Massimo recommends to not expose admin and appadmin on production 
 instances, but this is not a public server (only known to a small circle of 
 customers), and we value the benefit of direct access to appadmin higher 
 than the risk. As long as appadmin is protected, that is. So we would like 
 to keep this option.

 Where can we check why appadmin is not protected any more?

 Thanks for your attention,

 Detlev


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: jQuery select form items based on name startswith...

2014-07-01 Thread Niphlod
1st rule: never, never, never use inline javascript.
2nd rule: start with console.log() and an open debugger (firebug, chrome 
developer tools, etc)
3rd rule: use the quotes! you are terribly wrong with those
3rd rule: simplify the code, then expand.

$('#div2 button').on('click', function() {
   console.log($(input[name^='something'))
})

On Tuesday, July 1, 2014 6:14:41 PM UTC+2, Jordan Ladora wrote:

 Hi,

 I'm trying to make a button that will check some boxes in a form based on 
 the checkboxes' name attributes. 

 But I can't get this to work-
 div id='div2'
   button 
 onclick=event.preventDefault();jQuery('input[name^='somecheckbox']').each(function(k){jQuery(this).prop('checked',
  
 false);});Deselect All/button
 /div

 I'm basing it off http://api.jquery.com/attribute-starts-with-selector/

 I've tried a few different things but cannot get it to do anything good.. 

 Thanks for any pointers,
 -jl



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: jQuery select form items based on name startswith...

2014-07-01 Thread Jordan Ladora
Thanks, Niphlod, that is very helpful.. I think I'm on the right track now!


On Tue, Jul 1, 2014 at 12:02 PM, Niphlod niph...@gmail.com wrote:

 1st rule: never, never, never use inline javascript.
 2nd rule: start with console.log() and an open debugger (firebug, chrome
 developer tools, etc)
 3rd rule: use the quotes! you are terribly wrong with those
 3rd rule: simplify the code, then expand.

 $('#div2 button').on('click', function() {
console.log($(input[name^='something'))
 })


 On Tuesday, July 1, 2014 6:14:41 PM UTC+2, Jordan Ladora wrote:

 Hi,

 I'm trying to make a button that will check some boxes in a form based on
 the checkboxes' name attributes.

 But I can't get this to work-
 div id='div2'
   button onclick=event.preventDefault();jQuery('input[name^='
 somecheckbox']').each(function(k){jQuery(this).prop('checked',
 false);});Deselect All/button
 /div

 I'm basing it off http://api.jquery.com/attribute-starts-with-selector/

 I've tried a few different things but cannot get it to do anything good..

 Thanks for any pointers,
 -jl

  --
 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 received this message because you are subscribed to a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/oZ_u_XPbEys/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] can we make e-commerce web portal in web2py with multiple hits and users.

2014-07-01 Thread Marco Mansilla
El Tue, 1 Jul 2014 02:15:17 -0700 (PDT)
kanchan s.kanchan2...@gmail.com escribió:

 we have to develop a complete E-commerce software with payment
 gateway also . In this software  more than 500 users will use it ,
 hit it simultaneously . So my query is that does web2py can handle
 multiple user easily , or will it decrease the software speed if we
 make it in web2py or any other issue will create in future with
 multiple users.
 

Nice question, for this case i have recently found an intering app by
Massimo that might be a good example to prevent performance decrease,
by handling session vars.

https://github.com/mdipierro/web2py-appliances/tree/master/EStore

take a look.

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Security Problem: appadmin is accessible whithout any authentication

2014-07-01 Thread Massimo Di Pierro
This should not be possible but of course it deserves investigation. 
What web server do you use?
Are you behind any kind of proxy or load balancer?
Those friends who were able to access it, did they ever login into admin?
Can you diff your appadmin.py vs the latest welcome/controllers/appadmin?
When your friends were able to access it, did you see it? What did the page 
show? Do you have a screenshot? 

Massimo

On Tuesday, 1 July 2014 01:43:56 UTC-5, Detlev Bielz wrote:

 Hello,

 we, a small company, are using web2py for some web services with a couple 
 of different apps we developed ourselves.
 Recently, a collegue of mine pointed me to the fact, that he was able to 
 access *https://ourdomain/our_app/appadmin/index 
 https://ourdomain/our_app/appadmin/index* whithout having to 
 authenticate in any way. Since these services are my concern, I checked 
 instantly, but with three different browsers (firefox, chrome, IE) and 
 different user profiles for firefox and chrome I was not able to reproduce 
 this.

 Now, my collegue observed this phenomenon again, and a third collegue and 
 my own browsers could reproduce this issue. But not only '
 *our_app/appadmin*' is accessible; appadmin of ALL other apps as well:

- *https://ourdomain/our_other_app/appadmin/index 
https://ourdomain/our_other_app/appadmin/index*
- *https://ourdomain/our_third_app/appadmin/index 
https://ourdomain/our_third_app/appadmin/index*, even
 - *https://ourdomain/welcome/appadmin/index 
https://ourdomain/welcome/appadmin/index* 

 is accessible without having to login! The only exception is 
 /admin/appadmin, here we have to login.

 We all cleared caches etc. from our browsers or used browsers and browser 
 profiles we never accessed this web2py instance before.

 I know, Massimo recommends to not expose admin and appadmin on production 
 instances, but this is not a public server (only known to a small circle of 
 customers), and we value the benefit of direct access to appadmin higher 
 than the risk. As long as appadmin is protected, that is. So we would like 
 to keep this option.

 Where can we check why appadmin is not protected any more?

 Thanks for your attention,

 Detlev


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Silent dal failure with missing field def. Maybe a bug?

2014-07-01 Thread Cliff Kachinske
I would have thought DAL would raise an exception here, but the failure was 
silent.

The postgres table contains these fields:

 quantity_used | numeric(12,3)   | 
 container_count   | integer | 
 container_id  | integer | 
 restock   | integer | 

An ajax request was attempting to update the quantity_used, container_count 
and restock fields.

The updating code looks like this: All the variables were there.
db.repacks_reruns_container[rrc_id] = dict(
container_count=count,
quantity_used=pounds,
restock=restock,
)

db._lastsql looked like this:

UPDATE repacks_reruns_container SET quantity_used=1.000,container_count=
2 WHERE ((repacks_reruns_container.id = 1) AND 
(repacks_reruns_container.is_active 
= 'T'));

Note restock not updated in the query.

It happened because the model for repacks_reruns_container was missing the 
restock field.


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLEDITABLE plugin

2014-07-01 Thread Simon Ashley
+1. Very nice work. Thanks you for sharing

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Silent dal failure with missing field def. Maybe a bug?

2014-07-01 Thread Anthony
That particular method of updating calls:

.update(**self._filter_fields(value))

So no exception is raised because the fields are filtered to include only 
those in the table definition. If you want to catch such errors, use the 
more explicit .update() method.

Anthony

On Tuesday, July 1, 2014 5:39:36 PM UTC-4, Cliff Kachinske wrote:

 I would have thought DAL would raise an exception here, but the failure 
 was silent.

 The postgres table contains these fields:

  quantity_used | numeric(12,3)   | 
  container_count   | integer | 
  container_id  | integer | 
  restock   | integer | 

 An ajax request was attempting to update the quantity_used, 
 container_count and restock fields.

 The updating code looks like this: All the variables were there.
 db.repacks_reruns_container[rrc_id] = dict(
 container_count=count,
 quantity_used=pounds,
 restock=restock,
 )

 db._lastsql looked like this:

 UPDATE repacks_reruns_container SET quantity_used=1.000,
 container_count=2 WHERE ((repacks_reruns_container.id = 1) AND (
 repacks_reruns_container.is_active = 'T'));

 Note restock not updated in the query.

 It happened because the model for repacks_reruns_container was missing the 
 restock field.




-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: upload progress recipe not working

2014-07-01 Thread cowbert
So I inserted a console.log(data) after calling $.getJSON to see what data 
the ajax call would return as a large file is uploaded. It does return a 
json object containing 'length' and 'uploaded' but the values are always 
zero.

I also set X-Progress-ID and uuid to the same static test value and it 
resulted in the same problem.

I then tried removing this.action += ((this.action.indexOf('?') == -1) ? 
'?' : '') + 'X-Progress-ID=' + uuid; and added a hidden input field named 
X-Progress-ID instead. Made no difference. No errors either, but cache.ram 
calls always return 0 values for both length and uploaded.

Can anybody help with this?

On Tuesday, July 1, 2014 2:00:33 PM UTC-4, cowbert wrote:

 I'm trying to do a simple manual file upload (without DAL) and display 
 progress bar. I would prefer not to use any ajax helpers.
 I'm trying to use the upload progress recipe (involving the cache.ram 
 tracking in copystream_progress).

 Here's my controller default.py:
 def index():
 if request.extension=='json' and 'X-Progress-ID' in request.get_vars:
 cache_key = 'X-Progress-ID:'+request.get_vars['X-Progress-ID']
 length = cache.ram(cache_key+':length', lambda: 0, None)
 uploaded = cache.ram(cache_key+':uploaded', lambda: 0, None)
 from gluon.serializers import json
 return json(dict(length=length, uploaded=uploaded))
 else:
 form = None
 patherror = False
 #some checking for a valid target path for later use
 if not patherror:
 #generate uuid
 import binascii
 myuuid = binascii.hexlify(os.urandom(24))
 form=FORM(INPUT(_name='file', 
 _type='file'),INPUT(_type='submit', _value='Upload'))
 #will do stuff to file upon form accepts
 return dict(form=form, myuuid=myuuid)


 views/default/index.html:

 script type=text/javascript
 //Add upload progress for multipart forms
 jQuery(function() {
 jQuery('form[enctype=multipart/form-data]').submit(function() {
 //only submit once per page load
 if (jQuery.data(this,'submitted')) return false;
 var freq = 1000; //update every n ms
 var uuid = '{{=myuuid}}'; //myuuid was generated by the controller 
 above
 //console.log(uuid);
 var progress_url = '{{=URL(extension=json)}}';
 //console.log(progress_url)
 //Critical construct X-Progress-ID to request
 this.action += ((this.action.indexOf('?') == -1) ? '?' : '') + 
 'X-Progress-ID=' + uuid;
 var progress = jQuery(
 'div id=upload-progress 
 class=upload-progress/div').insertAfter(
 jQuery('input[type=submit]')).append(
 'div class=progress-containerspan 
 class=progress-infouploading 0%/spandiv 
 class=progress-bar/div/div');
 jQuery('input[type=submit]').remove()
 
 progress.find('.progress-bar').height('1em').width(0).css(background-color,red);
 //func to update progress bar
 function update_progress_info() {
 progress.show()
 jQuery.getJSON(progress_url, {'X-Progress-ID':uuid, 'dummy': 
 'xmlhttprequest fix for IE'}, function(data, status) {
 if (data) {
 var progress_percent = parseInt(data.uploaded) / 
 parseInt(data.length);
 var width = 
 progress.find('.progress-container').width();
 var progress_width = width * progress_percent;
 progress.find('.progress-bar').width(progress_width);
 progress.find('.progress-info').text('uploading ' + 
 progress_percent * 100 + '%');
 }
 window.setTimeout(update_progress_info, freq);
 });
 };
 window.setTimeout(update_progress_info, freq);
 jQuery.data(this, 'submitted', true); //finaly mark form as 
 submitted
 });
 });
 /script
 {{=form}}

 I am getting no javascript errors but i get no progress bar and the 
 progress-info span doesn't update either. File uploads.


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] SQLEDITABLE plugin

2014-07-01 Thread Fabiano Almeida
Very Nice!

Thank you very much!


2014-07-01 10:12 GMT-03:00 'kato' via web2py-users web2py@googlegroups.com
:

 Hi.

 I tried to make SQLEDITABLE plugin.

 demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html

 It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
 If you are interested, please try.

 Thanks.

 --
 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 received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Inserting in Register Menu

2014-07-01 Thread Carlos Zenteno


https://lh4.googleusercontent.com/-h5f-aniFicg/U7NDgEwEI2I/Cw0/no-feheh6oU/s1600/web2py_login.png
Trying to insert a new option in the register/login menu (the one on the 
top right of admin).

I searched and read a bunch of threads and concluded that the best way was 
to do it like
this:

{{navbar = auth.navbar(mode=dropdown)
  navbar.append(A('Testing', _href=URL('default')))
}}

ul id=navbar class=nav pull-right{{='auth' in globals() and navbar or 
''}}/ul


This does not work because it inserts the new option outside of the ul 
and the
'Testing' option shows below the 'Login' one, not inside the dropdown menu. 
(see image).

So I went to read the code and tried to do this:

{{auth.navbar.items.append({'name': T('Profile'),
'href': href('profile'),
'icon': 'icon-user'})
}}


But I get a ticket saying that auth.navbar does not have an 'items' list... 
(???)
which appear on line 1372 of tools.py.

What am I doing wrong? (I am a noob in Python and Web2py).



-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Security Problem: appadmin is accessible whithout any authentication

2014-07-01 Thread nick name
 By any chance, do any of you connect to a local vpn/proxy running on the 
server that relays the connection, rather than directly? (through openvpn, 
sshuttle, ssh tunnels, nginx, socks or anything of the sort?)

If you do, then it is possible that the connection arrives to the app from 
127.0.0.1 (localhost), in which case appadmin will accept them.

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Security Problem: appadmin is accessible whithout any authentication

2014-07-01 Thread Anthony
Even in that case, you would still have to be logged into admin for access.

On Tuesday, July 1, 2014 7:33:12 PM UTC-4, nick name wrote:

  By any chance, do any of you connect to a local vpn/proxy running on the 
 server that relays the connection, rather than directly? (through openvpn, 
 sshuttle, ssh tunnels, nginx, socks or anything of the sort?)

 If you do, then it is possible that the connection arrives to the app from 
 127.0.0.1 (localhost), in which case appadmin will accept them.


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLEDITABLE plugin

2014-07-01 Thread JorgeH

Cool!!

Great work

On Tuesday, July 1, 2014 8:12:29 AM UTC-5, kato wrote:

 Hi.

 I tried to make SQLEDITABLE plugin.

 demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html

 It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
 If you are interested, please try.

 Thanks.


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: importing a module that has db

2014-07-01 Thread 黄祥
please spend some time read web2py book.

ref:
http://web2py.com/books/default/chapter/29/04/the-core#Dispatching
http://web2py.com/books/default/chapter/29/04/the-core#request

best regards,
stifan

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] what are the12 core objects

2014-07-01 Thread 'tomt' via web2py-users
The preface says that the API includes just 12 core objects
What are they?

- Thanks in advance 

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Default value in dict returned by the controller

2014-07-01 Thread Mandar Vaze
Kiran,

Thanks.

I came across same solution when I searched this forum a little more (I had 
already searched before posting, obviously not enough)
https://groups.google.com/d/msg/web2py/b1WmPZh6PlI/nMAX-u5Des0J

-Mandar

On Tuesday, July 1, 2014 10:49:23 PM UTC+5:30, Kiran Subbaraman wrote:

  globals().get(' hide_my_div',False) should return a False, if this is 
 not present.

 
 Kiran Subbaramanhttp://subbaraman.wordpress.com/about/

 On Tue, 01-07-2014 10:06 PM, Mandar Vaze wrote:
  
 Hi,

 I have several views which are similar, so I am using common view file 
 using response.view =common_view.html rather than separate one per 
 controller.

 Out of these - 2 or 3 views are slightly different where certain parts of 
 the page (layout.html) need to be hidden.

 I tried :

 return dict(msg=msg, grid=grid, hide_my_div=True)

 in the view template I have :

 {{if hide_my_div:}}
 script
  $(document).ready(function(){
   $(#my_div).hide();
   });
 script
 {{pass}}

 This works for the small number of views where I want to hide my_div
 Unfortunately - this also means I need to pass hide_my_div=False from 
 large number of controllers.

 Is there a way to have hide_my_div=False *as a default* - so that I do 
 not need to return it explicitly - and I can override only when needed (2-3 
 controllers)
 Something like optional params with default values ?

 May be the way I am handling this is wrong. Is there a better way ?

 (I know that I can create separate view files for these odd ones, but I 
 prefer not to, since these are going to be 90% similar to common_view.html 
 anyway)

 Thanks,
 -Mandar
  -- 
 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 received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.


  

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: what are the12 core objects

2014-07-01 Thread Anthony
I'm not sure we can say there are exactly 12 (depends on how you define 
core), but that probably refers to the global objects listed here 
http://web2py.com/books/default/chapter/29/04/the-core#API, minus most of 
the HTML helpers and all the validators. So, minimally: request, response, 
session, cache, T, redirect, HTTP, DAL, and Field; and you would probably 
also include URL, XML, SQLFORM (including .factory, .grid, .smartgrid), and 
LOAD.

Anthony

On Tuesday, July 1, 2014 10:22:01 PM UTC-4, tomt wrote:

 The preface says that the API includes just 12 core objects
 What are they?

 - Thanks in advance 


-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Any one intergrated Indian Payment Systems with web2py app?

2014-07-01 Thread Sarbjit
Thanks Kiran for the reply and sharing the knowledgeable link.

I found zaapakpay.com and payu.in to be promising. zaapakpay has their 
legal terms to accept an application which includes the application to be 
submitted on behalf of company and it is a must that the website should be 
an ecommerce store. 

I am building my application on own and is not affiliated with any company 
as such, I need the payment setup just for receiving the registration fees.

I do not have any experience with integration of payment gateway with 
website, Will it be possible for you to share an example code of payu 
integration, that might be useful for others as well.

Thanks in advance,
Sarbjit

On Tuesday, July 1, 2014 9:41:59 PM UTC+5:30, Kiran Subbaraman wrote:

  I integrated a web2py app with payu (payu.com). Each of these payment 
 gateways have their own integration API. 
 This blog is a useful read: 
 http://gaganpreet.in/blog/2013/09/18/how-secure-are-indian-payment-gateways/

 
 Kiran Subbaramanhttp://subbaraman.wordpress.com/about/

 On Tue, 01-07-2014 8:24 PM, Sarbjit wrote:
  
 Hi All,

 Has any one integrated Indian Payment System with web2py app. In India, 
 ccavenue seems to be more popular (http://www.ccavenue.com/quick.jsp) but 
 they doesn't appears to provide python support. 

 But apparently, I found few Django app's integarted with ccavenue on 
 google, has any one implemented any Indian Payment System with web2py.

 I am no-voice to Payment Integration.

 -Sarbjit
  -- 
 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 received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.


  

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Inserting in Register Menu

2014-07-01 Thread Annet
Hi,

I had the same question and found this answer in the workgroup:


The auth.navbar() produces an HTML helper DOM, so you can manipulate it as 
usual:

navbar = auth.navbar(mode='dropdown')
if auth.user:
navbar.element('ul.dropdown-menu').components.extend([LI('Item 1'), 
LI('Item 
2'), ...])


From my notes I can tell it was Anthony who answered this question.

Regards,

Annet

-- 
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 received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.