Re: [web2py] How to use XML data

2012-03-10 Thread Praveen Bhat
Hello Bruno, Thanks a lot, that worked for me. You have been very helpful. Regards, Praveen On Saturday, March 10, 2012 1:35:51 PM UTC+5:30, rochacbruno wrote: > > > https://gist.github.com/2010791 > > > -- > > Bruno Rocha > [http://rochacbruno.com.br] > >

[web2py] Re: YASQ 3: smartgrid and auth.accessible_query

2012-03-10 Thread Martin Weissenboeck
I have found a solution, but I don't know whether this solution is efficient: def has_membership(i): return db.auth_user.id.belongs([k['user_id']\ for k in db(db.auth_membership.group_id==i).select()]) grid = SQLFORM.smartgrid(db.auth_user, user_signature=False,

Re: [web2py] How to use XML data

2012-03-10 Thread Praveen Bhat
Hello, How can i make the data in "temp" be available in every controller so that it can be rendered in every page in the site? Regards Praveen On Saturday, March 10, 2012 1:47:20 PM UTC+5:30, Praveen Bhat wrote: > > Hello Bruno, > > Thanks a lot, that worked for me. You have been very helpful.

Re: [web2py] How to use XML data

2012-03-10 Thread Bruno Rocha
put the code in models, /models/temp.py >>> def get_temp(): ... temp = None ... from xml.dom import minidom ... source = urllib2.urlopen(' http://free.worldweatheronline.com/feed/weather.ashx?q=udupi&format=xml&num_of_days=2&key=b019cd7d6a135850110711 ') ... source_text = source.re

[web2py] Re: web2py site and disabling browser right clicks

2012-03-10 Thread Rahul
Thank you all of you, I am thinking of linking pyjamas with my web2py project. Though I it does not restrict users from viewing the page source, it does not show parameters in the source to the public openly. This way if there is someone with malicious intentions, we can prevent one from inspect

[web2py] Re: web2py site and disabling browser right clicks

2012-03-10 Thread Rahul
...And I do agree that Pyjamas does have a learning curve aswell .. :) It seems there is no escape but to learn new a technology :) Sincerely, Rahul D (www.flockbird.com) On Mar 10, 3:06 pm, Rahul wrote: > Thank you all of you, >    I am thinking of linking pyjamas with my web2py project. Though

[web2py] Re: Pycon Streaming

2012-03-10 Thread Alan Etkin
Great! Thank you On 9 mar, 19:42, Bruno Rocha wrote: > Watch Pycon Talks here:http://streamti.me/ > > -- > > Bruno Rocha > [http://rochacbruno.com.br]

[web2py] Re: web2py site and disabling browser right clicks

2012-03-10 Thread Alan Etkin
SSL is a protocol used to encrypt the data as it is sent between machines, but it does not prevent the source to be read by a user. I think that Chris has pointed out very well the problem: if you have info that you won't expose publicly, that information should be stored and processed server-side

[web2py] Re: Pycon Streaming

2012-03-10 Thread Alan Etkin
Something else: web2py: ideas we stole and ideas we had Massimo Di Pierro Scheduled talk Sunday, 1:30 PM (Santa Clara I suppose) Track 4 (E4)

[web2py] Re: installing as a window service

2012-03-10 Thread Alan Etkin
Do you get any error output or feedback from the operating system? Does web2py start with the built-in rocket server? On 9 mar, 13:28, Muscillo Luigi wrote: > i'm trying to install web2py as a window server; I followed all > instructions issued about the argument but id doesnt'work; > i tried bot

[web2py] how to set a default user group

2012-03-10 Thread Vasile Ermicioi
hi, currently a new user group is created for each new user after registration, I disabled new groups to be created auth.settings.create_user_groups = False but actually I need to set all new users to a default user group I know I will get a response, :) thank you in advance

[web2py] Re: how to set a default user group

2012-03-10 Thread Alan Etkin
This is one way of solving it (by binding a function to an auth.settings attribute): # model code def post_register(form): # the new user id is stored in auth.user_id pass auth.settings.register_onaccept = give_create_permission On registration, you can perform auth management by access

Re: [web2py] How to use XML data

2012-03-10 Thread Praveen Bhat
Hello, How can i get the CDATA values? I am trying this and its outputting 'None': def get_weather_condition(): weathercondition = None from xml.dom import minidom import urllib2 source = urllib2.urlopen('http://free.worldweatheronline.com/feed/weather.ashx?q=udupi&format=xml&num_of_days=2&key

Re: [web2py] iframe and pdf

2012-03-10 Thread Martin Weissenboeck
Nice solution - thank you! Martin 2012/3/10 Bruno Rocha > > def k(): > if 'showpdf' in request.args: > return person2pdf(session.ids) > else: > return dict(ifr=IFRAME(_src=URL('default','k', args='showpdf'))) > > > > -- > > Bruno Rocha > [http://rochacbruno.com.br] > >

[web2py] Re: web2py site and disabling browser right clicks

2012-03-10 Thread pbreit
Disabling the right-click is incredibly user-hostile and ultimately does not prevent your pages from exposure. Silverlight and Flash are on their way out and are not usable by many devices (ie iPhones, iPads and some Macs). There really should not be any good reasons to hide your HTML. If it ha

[web2py] Latest version unable to connect to DB

2012-03-10 Thread Bruce Wade
db_users = DAL('postgres://warplyde_fto:password@localhost/warplyde_fto') Has something been changed in how we need to make database connections to postgres? Traceback (most recent call last): File "/home/bruce/Development/wct_dev/web2py_dev/projects/fto/gluon/restricted.py", line 205, in rest

[web2py] Differentiating between URLs in web2py controllers

2012-03-10 Thread Saurabh Kumar
Hi, I am writing a web2py application wherein I want my controller to behave differently to following URLs /user/login /user/login#_=_ Please suggest a way to differentiate between these two. Would it ask for make a modification in routes.py? Thanks Saurabh

[web2py] Greetings

2012-03-10 Thread hugoGee
I just came across web2py, looking forward to working with the framework and getting to know some of the folks here. -cheers

Re: [web2py] Re: How to call other web2py applications from within a web2py application

2012-03-10 Thread bussiere bussiere
Bruno : Thanks for your devoting. Bussiere "Les nouvelles technologies offrent pleins de nouvelles possibilités, pleins de possibilités d'erreurs surtout en fait." insurance.aes256 : http://goo.gl/gHyAY On Sat, Mar 10, 2012 at 4:11 AM, Bruno Rocha wrote: > I have a working website using tw

[web2py] Re: web2py site and disabling browser right clicks

2012-03-10 Thread Rahul
I think it makes sense to process sensitive data server side. I'll think over my options and proceed to achieve my goal. I don't want to loose out on user experience either. Thank you all for your valuable feedback. I hope HTML5+ / (WWW) would consider adding secure parameter to faciliate such thin

[web2py] Re: web2py site and disabling browser right clicks

2012-03-10 Thread Anthony
> > I think it makes sense to process sensitive data server side. I'll > think over my options and proceed to achieve my goal. I don't want to > loose out on user experience either. What exactly is it that you are trying to hide? Can you give an example? > Thank you all for your valuable >

[web2py] Re: Greetings

2012-03-10 Thread Anthony
Welcome, and enjoy. :-) On Saturday, March 10, 2012 12:37:49 PM UTC-5, hugoGee wrote: > > I just came across web2py, looking forward to working with the > framework and getting to know some of the folks here. > > -cheers

[web2py] Re: Differentiating between URLs in web2py controllers

2012-03-10 Thread Anthony
> > I am writing a web2py application wherein I want my controller to behave > differently to following URLs > > /user/login > > /user/login#_=_ > The "_=_" after the # is a fragment identifier, and the browser does not send fragment identifiers to the server, so web2py has no way to different

[web2py] Re: Differentiating between URLs in web2py controllers

2012-03-10 Thread pbreit
As Anthony noted, what you are showing won't work. What are you trying to do? You can include any code you want in the user() function.

[web2py] Re: looking for tutorial extends user and related to an other app

2012-03-10 Thread Alan Etkin
If you are sharing models, there is a way of using one for all apps stored in the applications folder, that is to make symbolic links on each app specific folder to a single archive. I don't like using this technique, but it's a choice anyway. Another way of extending an application is to use plugi

[web2py] Re: web2py site and disabling browser right clicks

2012-03-10 Thread Cliff
Silverlight locks your users into Internet Explorer. With the Explorer usage below 50%, why would you do that? On Mar 10, 2:33 pm, Anthony wrote: > > I think it makes sense to process sensitive data server side. I'll > > think over my options and proceed to achieve my goal. I don't want to > > l

[web2py] Website doesn't show up.

2012-03-10 Thread george3825
Hello, I edited the following setting in tools.py in gluon: From: auth.settings.login_next = URL('index') To: auth.settings.login_next = URL('account') Saved the file and restarted Apache2 I am able to successfully log in it does take me to http://www.site.com/Main/default/account But all the

[web2py] Re: Website doesn't show up.

2012-03-10 Thread Alan Etkin
It appears that your controller sent a None object response. For using the view's template, the return statement of the function should return a dict object: def mycontroller(): ... return dict(name=value) On Mar 10, 7:28 pm, george3825 wrote: > Hello, > > I edited the following setting

[web2py] Stand alone example using DAL

2012-03-10 Thread Bruce Wade
For anyone who is interested attached is a standalone class using DAL. It using a singleton for the database connection not sure if this is good or bad for all applications. However I am working on classes that will remain in memory. As long as gluon is in your python path you can test this file w

[web2py] Re: Latest version unable to connect to DB

2012-03-10 Thread Alan Etkin
If something changed (as now pg adapter supports pg8000 driver), old uri strings would have to be accepted also. I'd say it's is a bug. There seems to be a list/dict conflict in dal. On Mar 10, 2:16 pm, Bruce Wade wrote: > db_users = DAL('postgres://warplyde_fto:password@localhost/warplyde_fto')

[web2py] Re: Latest version unable to connect to DB

2012-03-10 Thread Alan Etkin
Line 1999 in trunk: self.driver = drivers.get('pg8000') Should be: self.driver = self.drivers.get('pg8000') On Mar 10, 8:07 pm, Alan Etkin wrote: > If something changed (as now pg adapter supports pg8000 driver), old > uri strings would have to be accepted also. I'

[web2py] Re: Stand alone example using DAL

2012-03-10 Thread Alan Etkin
Cool, something similar without passing the db instance to a class constructor is done by gui2py. It also converts the helper objects to wxPython http://code.google.com/p/gui2py gui2py aims to give a complete interface to run web2py applications on wxPython desktop environment. I am using it in a

[web2py] Re: web2py site and disabling browser right clicks

2012-03-10 Thread pbreit
Sliverlight works on all browsers as far as I know. But I still don't think it's a very smart platform to target for the vast majority of apps.

[web2py] Errors creating/reading tickets

2012-03-10 Thread Brian M
This has actually been plaguing me for a while but finally annoyed me enough to ask. I have several web2py (1.99.4) apps running under Apache/2.2.17 (Win32) , mod_wsgi/3.3 and Python/2.6.4. More often than not when an error happens and a ticket is generated, the ticket seems to be corrupt. A

[web2py] How to list:reference users ?

2012-03-10 Thread bussiere adrien
maybe Field('Auth','list:reference Auth'), or ('Auth','list:reference User'), Regards Bussiere

[web2py] Re: How to list:reference users ?

2012-03-10 Thread pbreit
Field('user_id', db.auth_user)

[web2py] Translations in custom classes

2012-03-10 Thread Bruce Wade
Hi, I was looking at the Auth class, why are settings like the following not showing in the language translations files by default? # ## these are messages that can be customized messages = self.messages = Messages(current.T) messages.password_reset_button = 'Request reset

Re: [web2py] Re: Website doesn't show up.

2012-03-10 Thread George
Putting in return dict() made it work. Thanks. What exactly does that do? Where does it get sent to? On Sat, Mar 10, 2012 at 4:53 PM, Alan Etkin wrote: > It appears that your controller sent a None object response. For using > the view's template, the return statement of the function should > r

Re: [web2py] Database trigger like django save ?

2012-03-10 Thread nick name
Le vendredi 9 mars 2012 23:48:30 UTC+1, rochacbruno a écrit : > > To do what Django does we need to have some "hooks' for that 3 events >> (dbset.insert, dbsert.update and Row.update_record) >> >> I can see that if you extend DAL it is possible to redefine via monkey >> patching the .insert metho