[web2py] Re: Dumb Question - from a real beginner
glad to see people using web2py for raspberry projects ;) maybe future features of web2py could focus a bit more on that niche On Thursday, April 9, 2015 at 8:32:21 AM UTC-5, DXX wrote: So im just starting with Python / Web2py i want to do a simple test page to have a button to turn on a led on a RPi... the default.py looks like this import RPi.GPIO as GPIO def index(): return dict(message=this is a test) def btnon(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) GPIO.output(22,GPIO.HIGH) What i would like to do is call that btnon on an event, like a click on something to make it exectute the commands if this something i can do on a simple way, if you can guide me, i will be greatly appreciated -- 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: [Request] LDAP/FreeIpa Schema support
If you can make your addition more generic, then you can issue a pull request from Github. On Thursday, April 9, 2015 at 6:32:21 AM UTC-7, Vicente Carro wrote: Hi, We had a hard time configuring web2py to authorise using our LDAP/FreeIPa schema. More precisely getting the groups of the user. At the end we had to do a few changes directly in ldap_auth.py, that's not ideal but at least it's working. Could be possible for you to add one mode in LDAP even more flexible than the current custom mode? Or perhaps to extend the custom mode with more options? Thanks Vicente -- 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: Thread safety and importing db, response, session
Sure, that's how Auth and Crud work. Anthony -- 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: How to implement Gmail Authentication
First of all you need to get the *google_auth.json file to use OAuth* To get that you need to register your Google account as a webdeveloper You can find how get the information on Google :) Then u can change ur auth table in this way In the model.py from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db,secure=True) crud, service, plugins = Crud(db), Service(), PluginManager() ## TABELLE USER --- ## ## create all tables needed by auth if not custom tables auth.settings.extra_fields['auth_user']= [ Field('phone', type='string', label='Telefono'), Field('country',type='string', label='Nazione'), Field('city',type='string', label='Città'), Field('address',type='string', label='Indirizzo'), Field('auth_login', type='string', default='basic', label='Tipo Login',readable=False, writable=False), Field('url_img', requires=IS_EMPTY_OR(IS_URL()), label='Link Immagine Profile',readable=False, writable=False), Field('nickname', type='string', label='Nickname'), Field('birthdate', type='date', label='Data Di nascita'), Field('gender', type = 'string', label='Genere' ,requires = IS_IN_SET(['M','F']), default = 'M'), Field('facebook_id', type='string', label='Username di Facebook',readable=False, writable=False), Field('twitter_id', type='string', label='Username di Twitter',readable=False, writable=False), Field('google_id', type='string', label='Username di Google',readable=False, writable=False ), Field('linkedin_id', type='string', label='Username di Linkedin',readable=False, writable=False), ] auth.define_tables(username=False, signature=True) *In The Controller* Import AccountAccess def google(): if auth.is_logged_in(): redirect(URL(r=request, c='default', f='index')) folder = request.folder google_access = AccountAccess.GoogleAccount(folder) auth.settings.login_form=google_access return auth.login(next=URL(r=request, c='default', f='index')) In the Module section Create the *AccountAccess* module import oauth2 as oauth from gluon.contrib.login_methods.oauth10a_account import OAuthAccount as OAuthAccount10a from gluon.contrib.login_methods.oauth20_account import OAuthAccount from oauthtwitter_account import OAuthAccount as OauthAccountTwitter import os import storage import urllib2 from oauth2 import Client, Consumer, Token class GoogleAccount(OAuthAccount): OAuth 2.0 for Google def __init__(self,db,session,request,response,folder): with open(os.path.join(folder, *'private/google_auth.json'*), 'rb') as f: gai = storage.Storage(json.load(f)['web']) self.db = db self.request = request self.response = response self.session = session g = dict( request=request, response=response, session=session, ) OAuthAccount.__init__(self,g, gai.client_id, gai.client_secret, gai.auth_uri, gai.token_uri, scope='https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/plus.login', approval_prompt='auto', access_type = 'offline', state=auth_provider=google) def get_user(self): token = self.accessToken() if not token: return None uinfo_url = 'https://www.googleapis.com/oauth2/v1/userinfo?access_token=%s' % urllib2.quote(token, safe='') uinfo = None try: uinfo_stream = urllib2.urlopen(uinfo_url) except: session.token = None return None data = uinfo_stream.read() uinfo = json.loads(data) username = uinfo['id'] if uinfo: gender = 'M' if uinfo['gender'][0].lower() == 'f': gender = 'F' existent = self.db(self.db.auth_user.email == uinfo[email]).select(self.db.auth_user.id,self.db.auth_user.auth_login).first() if existent: if existent.auth_login 'Google': diz_account = dict( username = uinfo['email'], gender = gender, auth_login = 'Google', url_img = uinfo.get('picture', ''), google_id = uinfo['id'], registration_id = uinfo['id'] ) existent.update_record(**diz_account) return dict(first_name = uinfo.get('given_name', uinfo[name].split()[0]), last_name = uinfo.get('family_name', uinfo[name].split()[-1]), username = uinfo['email'], email = uinfo['email'], gender = gender,
[web2py] Need help with web2pyslices plugin administration
I have added plugin_MANAGE_GROUPS to web2pyslices, but the download link is broken. Proper one is zvolsky.github.io/plugin_manage_groups/web2py.plugin.manage_groups.w2p I see the plugin in web2py admin application, Download plugins from repository, i.e. at the url localhost:8000/admin/default/plugins/app At web2pyslices I have absolutely no idea how to find the published plugin and how to edit info about it. In slices and through interactive controls I cannot find it at all. In admin/default/plugins/app I can see the URL, but both links http://www.web2pyslices.com/slice/show/2018/ http://www.web2pyslices.com/slice/show/2018/plugin-manage-groups redirects to www.web2pyslices.com/home So what can I do to correct the links? Thank you. - I think it is nice idea to have plugins at some central place. But current state of web2pyslices is not suitable for this goal very much :( I think this is the main reason why the list of plugins looks so strange at now. -- 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: Dumb Question - from a real beginner
Yes, I use button back in time, but with bootstrap I usually do A(I(_class='icon-something', CAT(' '), T('some text'), _href=URL('btnon'), _class='btn btn-small') Now you have an A with the look of a button. Richard On Thu, Apr 9, 2015 at 12:45 PM, Derek sp1d...@gmail.com wrote: Richard's answer should work, but I just wanted to add, if you put an 'a' link to /btnon it will also call your function. On Thursday, April 9, 2015 at 6:32:21 AM UTC-7, DXX wrote: So im just starting with Python / Web2py i want to do a simple test page to have a button to turn on a led on a RPi... the default.py looks like this import RPi.GPIO as GPIO def index(): return dict(message=this is a test) def btnon(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) GPIO.output(22,GPIO.HIGH) What i would like to do is call that btnon on an event, like a click on something to make it exectute the commands if this something i can do on a simple way, if you can guide me, i will be greatly appreciated -- 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.
Re: [web2py] Dumb Question - from a real beginner
In default/index.html view try something like this : button onclick=ajax('btnon',[],null); {{=T('Name of your button')}} /button Richard On Wed, Apr 8, 2015 at 8:39 PM, DXX dxxpub...@gmail.com wrote: So im just starting with Python / Web2py i want to do a simple test page to have a button to turn on a led on a RPi... the default.py looks like this import RPi.GPIO as GPIO def index(): return dict(message=this is a test) def btnon(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) GPIO.output(22,GPIO.HIGH) What i would like to do is call that btnon on an event, like a click on something to make it exectute the commands if this something i can do on a simple way, if you can guide me, i will be greatly appreciated -- 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] Re: web2py 2.10.3 si OUT
did you take AT LEAST time to inspect why it's failing ? On Thursday, April 9, 2015 at 6:37:19 AM UTC+2, 黄祥 wrote: functional test is not work in newest version, in old version work. *error* C:\web2py\applications\test\modulespython funcional_test.py No handlers could be found for logger web2py Changed session ID test Traceback (most recent call last): File funcional_test.py, line 32, in module assert('Homer' in client.text) AssertionError *code taken from the book* import sys; sys.path.append('../../../') from gluon.contrib.webclient import WebClient client = WebClient('https://127.0.0.1/test/default/', postbacks=True) client.get('index') # register data = dict(first_name='Homer', last_name='Simpson', email='ho...@web2py.com javascript:', password='test', password_two='test', _formname='register') client.post('user/register', data=data) print data # logout client.get('user/logout') # login again data = dict(email='ho...@web2py.com javascript:', password='test', _formname='login') client.post('user/login', data=data) print data # check registration and login were successful client.get('index') #print client.text #assert('Homer' in client.text) 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.
Re: [web2py] request table name
thank you so much anthony. it seems need _before_delete callback, with some condition (auth.signature disable or create custom auth.signature). ref: https://groups.google.com/forum/#!searchin/web2py/_before_delete$20callback$20/web2py/didLpxEKT38/mRzmEgHCQeEJ 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.
Re: [web2py] Re: Thread safety and importing db, response, session
Thanks Anthony, Sorry, I was a bit delirious writing that =) -Mark On Thu, Apr 9, 2015 at 6:47 AM, Anthony abasta...@gmail.com wrote: Sure, that's how Auth and Crud work. Anthony -- 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/aNDf1SgPVso/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.
[web2py] Re: How to implement Gmail Authentication
Thanks a lot. I will surely give it a try. -- 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: Dumb Question - from a real beginner
Derek, I didn't understand what you meant by 'a' link to /btnon it will also call your function? Do you mean, if I click on that button it executes a python function for example and redirect the page or display someone in index.html (where the button is displayed)? What will be the syntax for that? On Thursday, April 9, 2015 at 12:45:08 PM UTC-4, Derek wrote: Richard's answer should work, but I just wanted to add, if you put an 'a' link to /btnon it will also call your function. On Thursday, April 9, 2015 at 6:32:21 AM UTC-7, DXX wrote: So im just starting with Python / Web2py i want to do a simple test page to have a button to turn on a led on a RPi... the default.py looks like this import RPi.GPIO as GPIO def index(): return dict(message=this is a test) def btnon(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) GPIO.output(22,GPIO.HIGH) What i would like to do is call that btnon on an event, like a click on something to make it exectute the commands if this something i can do on a simple way, if you can guide me, i will be greatly appreciated -- 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: Triggering a one-time migration when schema changes
another caveat circumvented, another step in the good direction now the problem is only IF you have conditional models. On Thursday, April 9, 2015 at 10:01:17 AM UTC+2, Pablo Angulo wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 El 08/04/15 a las 20:58, Niphlod escribió: good too, but NEEDS to happen without lazy_tables ^_^ This is what I do: db = DAL('mysql://web2pyuser:pass@localhost/database', migrate=migrate, lazy_tables=(not migrate)) -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBAgAGBQJVJjHBAAoJEATsOw+FDrzI1NoP/3QsGdBNKTDZT14MHzyW1UL1 x625V/FwVQ9Fnd3s06IghvochXgGZhZ6TkA4Paztk6H0NtrZiUirKNKyDV9fC6z8 9j5nNutRaHFRSkLCl47Z7wGKg3cMTxT4hQoK5tq2UlXfHeFtDmUmAT+gC6ITqyaz loovKP33J3lMSyk+0eWdIuCq02rU4hb1JOIpIm9OeJg3lnENmQn88B4MvIynI+PO GyQh/yV0U9GdLuYwkU0sqnaMduCCgUpoDqM7o+hlKh1OHq/0GyfsDMcwHGYIEs57 TbaEvr/Rqd0AD3NDFaemJl/z1MlYr+mmmRE8u3LLToVQ60npUlazaz8jPFwIT0M7 y8RkwHDa2qdOC7mDwUMz9gPcXlHpYD4mIJakpJOQTroPlTcHco3/Bvam4Z+mWN0s HsdIBtAnCZC7/YPkk3RsCzdj1zaxcqmqQIPRlhrGLzdLsFQ9l9fMeYUGOpu+yKQ0 ercAa6MtGEdHexE00ZZ90hj8tjkxlWZ8Al27yh0UkVCe33QtXfWj7mQGRkSlC1yR W5ho1+F0JIO+R49MCPTR9bRxRNOCN79PDM6ai6sxV8HEjselDBlMNQd7zIc7pLnr wlxXkYQ3BkiUjxU3eVE1gLeRVpyLkwxAM9bRvQgUMIXvxcTNkOk6o4uv6Ah1sBNl RniOrtMhhfO7kYm6Y3KG =m8+M -END PGP SIGNATURE- -- 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] Need help with web2pyslices plugin administration
Same problem here, I can´t publish my plugins in web2pyslices, some months ago I post the problem, but I don´t get any answer. El 09/04/15 a las 08:00, Mirek Zvolský escribió: I have added plugin_MANAGE_GROUPS to web2pyslices, but the download link is broken. Proper one is zvolsky.github.io/plugin_manage_groups/web2py.plugin.manage_groups.w2p I see the plugin in web2py admin application, Download plugins from repository, i.e. at the url localhost:8000/admin/default/plugins/app At web2pyslices I have absolutely no idea how to find the published plugin and how to edit info about it. In slices and through interactive controls I cannot find it at all. In admin/default/plugins/app I can see the URL, but both links http://www.web2pyslices.com/slice/show/2018/ http://www.web2pyslices.com/slice/show/2018/plugin-manage-groups redirects to www.web2pyslices.com/home So what can I do to correct the links? Thank you. - I think it is nice idea to have plugins at some central place. But current state of web2pyslices is not suitable for this goal very much :( I think this is the main reason why the list of plugins looks so strange at now. -- 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. -- Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas Infomed: http://www.sld.cu/ -- 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] Update a session variable from a module
I've got some code (currently in a file in models) where default session settings are set from a db record- def init_settings(db_record): session.timezone = db_record.timezone etc. The problem is that I want to move this code into a module for production, but don't know how to update 'session' from a module. The modularized code is- def init_settings(db_record): current.session.timezone = db_record.timezone ...but indeed, that does not update the session variable! Is there any way 'session' can be updated from a module? TIA, -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] Re: Dumb Question - from a real beginner
Richard's answer should work, but I just wanted to add, if you put an 'a' link to /btnon it will also call your function. On Thursday, April 9, 2015 at 6:32:21 AM UTC-7, DXX wrote: So im just starting with Python / Web2py i want to do a simple test page to have a button to turn on a led on a RPi... the default.py looks like this import RPi.GPIO as GPIO def index(): return dict(message=this is a test) def btnon(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) GPIO.output(22,GPIO.HIGH) What i would like to do is call that btnon on an event, like a click on something to make it exectute the commands if this something i can do on a simple way, if you can guide me, i will be greatly appreciated -- 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] request table name
The _before_delete callback should work with auth.signature and record versioning. Note, however, that with record versioning, a special _before_delete callback is added that does an update with is_active=False. So, in addition to adding your own _before_delete callback, your _before_update callback should detect cases where is_active=False is being set, and suppress the update event log in that case (since your _before_delete callback will already be adding to the log). Anthony On Thursday, April 9, 2015 at 9:45:42 AM UTC-4, 黄祥 wrote: thank you so much anthony. it seems need _before_delete callback, with some condition (auth.signature disable or create custom auth.signature). ref: https://groups.google.com/forum/#!searchin/web2py/_before_delete$20callback$20/web2py/didLpxEKT38/mRzmEgHCQeEJ 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.
Re: [web2py] Need help with web2pyslices plugin administration
uhm. usually I just: - login to web2pyslices - click on wrote n slices button (redirects to something like http://www.web2pyslices.com/slice/list?author=*some_integer*) - click on my slice title (redirects to something like http://www.web2pyslices.com/slice/show/*an_integer/title_slug*) - click on the edit link (redirects to something like http://www.web2pyslices.com/article/edit/*an_integer/title_slug*) - update the slice accordingly - push publish what issues are you facing ? On Thursday, April 9, 2015 at 2:34:21 PM UTC+2, Carlos Cesar Caballero Díaz wrote: Same problem here, I can´t publish my plugins in web2pyslices, some months ago I post the problem, but I don´t get any answer. El 09/04/15 a las 08:00, Mirek Zvolský escribió: I have added plugin_MANAGE_GROUPS to web2pyslices, but the download link is broken. Proper one is zvolsky.github.io/plugin_manage_groups/web2py.plugin.manage_groups.w2p I see the plugin in web2py admin application, Download plugins from repository, i.e. at the url localhost:8000/admin/default/plugins/app At web2pyslices I have absolutely no idea how to find the published plugin and how to edit info about it. In slices and through interactive controls I cannot find it at all. In admin/default/plugins/app I can see the URL, but both links http://www.web2pyslices.com/slice/show/2018/ http://www.web2pyslices.com/slice/show/2018/plugin-manage-groups redirects to www.web2pyslices.com/home So what can I do to correct the links? Thank you. - I think it is nice idea to have plugins at some central place. But current state of web2pyslices is not suitable for this goal very much :( I think this is the main reason why the list of plugins looks so strange at now. -- 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: web2py 2.10.3 si OUT
1. create new test app 2. print the value, as you can see the print syntax. 3. for client.text it return a html, i copas it to the new editor and save it as html file, and search 'Homer' using web browser, the result is it's not found. 4. checked on auth_user table, the homer user is there (can register user) 5. trying to comment #assert('Homer' in client.text), it no errors occured anymore.so imho i think it's because the login is not successful so that it can't get 'Homer'. 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] Re: model file not behaving correctly
i think it related with your db configuration. e.g. db = DAL(myconf.take('db.uri'), pool_size = myconf.take('db.pool_size', cast = int), check_reserved = ['all'], migrate = True, fake_migrate_all = False, lazy_tables = True) 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] Re: Dumb Question - from a real beginner
On Thursday, April 9, 2015 at 2:47:12 PM UTC-4, Ron Chatterjee wrote: Derek, I didn't understand what you meant by 'a' link to /btnon it will also call your function? Do you mean, if I click on that button it executes a python function for example and redirect the page or display the function output to someone in index.html (where the button is displayed)? What will be the syntax for that? I usually follow this from the tutorial: form action=form_name input type=submit / /form And then in the controller I can simply do: if form.process().accepted: redirect(URL('to_the_page')) And for the link, I believe the type will change. I guess someone can also do ajax('butnon',[],null); and change butnon to 'link'. And then process once clicked. On Thursday, April 9, 2015 at 12:45:08 PM UTC-4, Derek wrote: Richard's answer should work, but I just wanted to add, if you put an 'a' link to /btnon it will also call your function. On Thursday, April 9, 2015 at 6:32:21 AM UTC-7, DXX wrote: So im just starting with Python / Web2py i want to do a simple test page to have a button to turn on a led on a RPi... the default.py looks like this import RPi.GPIO as GPIO def index(): return dict(message=this is a test) def btnon(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) GPIO.output(22,GPIO.HIGH) What i would like to do is call that btnon on an event, like a click on something to make it exectute the commands if this something i can do on a simple way, if you can guide me, i will be greatly appreciated -- 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] Log db operation to file
Hello List, I'm debugging an application not written by me running in production. I'm looking for a way to log all db operations to file for a certain controller. I'm not looking for a global logging of all operations, but only on controllers of interest. Is there such a nice feature in web2py? Thank you! -- Profile: http://it.linkedin.com/in/compagnucciangelo -- 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: Dumb Question - from a real beginner
ajax was because in my case I only block/unblock access by updating registry_id in auth_user... So I wouldn't leave the page and no further page update were required... If you click on an A link of course you will be redirected, except if you set ajax stuff with onclick... You can also not redirecting and update some component with onclick and web2py.component(...) (web2py ajax call for web2py component system) Richard On Thu, Apr 9, 2015 at 2:56 PM, Ron Chatterjee achatterjee...@gmail.com wrote: On Thursday, April 9, 2015 at 2:47:12 PM UTC-4, Ron Chatterjee wrote: Derek, I didn't understand what you meant by 'a' link to /btnon it will also call your function? Do you mean, if I click on that button it executes a python function for example and redirect the page or display the function output to someone in index.html (where the button is displayed)? What will be the syntax for that? I usually follow this from the tutorial: form action=form_name input type=submit / /form And then in the controller I can simply do: if form.process().accepted: redirect(URL('to_the_page')) And for the link, I believe the type will change. I guess someone can also do ajax('butnon',[],null); and change butnon to 'link'. And then process once clicked. On Thursday, April 9, 2015 at 12:45:08 PM UTC-4, Derek wrote: Richard's answer should work, but I just wanted to add, if you put an 'a' link to /btnon it will also call your function. On Thursday, April 9, 2015 at 6:32:21 AM UTC-7, DXX wrote: So im just starting with Python / Web2py i want to do a simple test page to have a button to turn on a led on a RPi... the default.py looks like this import RPi.GPIO as GPIO def index(): return dict(message=this is a test) def btnon(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) GPIO.output(22,GPIO.HIGH) What i would like to do is call that btnon on an event, like a click on something to make it exectute the commands if this something i can do on a simple way, if you can guide me, i will be greatly appreciated -- 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.
Re: [web2py] Re: Triggering a one-time migration when schema changes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 El 08/04/15 a las 20:58, Niphlod escribió: good too, but NEEDS to happen without lazy_tables ^_^ This is what I do: db = DAL('mysql://web2pyuser:pass@localhost/database', migrate=migrate, lazy_tables=(not migrate)) -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBAgAGBQJVJjHBAAoJEATsOw+FDrzI1NoP/3QsGdBNKTDZT14MHzyW1UL1 x625V/FwVQ9Fnd3s06IghvochXgGZhZ6TkA4Paztk6H0NtrZiUirKNKyDV9fC6z8 9j5nNutRaHFRSkLCl47Z7wGKg3cMTxT4hQoK5tq2UlXfHeFtDmUmAT+gC6ITqyaz loovKP33J3lMSyk+0eWdIuCq02rU4hb1JOIpIm9OeJg3lnENmQn88B4MvIynI+PO GyQh/yV0U9GdLuYwkU0sqnaMduCCgUpoDqM7o+hlKh1OHq/0GyfsDMcwHGYIEs57 TbaEvr/Rqd0AD3NDFaemJl/z1MlYr+mmmRE8u3LLToVQ60npUlazaz8jPFwIT0M7 y8RkwHDa2qdOC7mDwUMz9gPcXlHpYD4mIJakpJOQTroPlTcHco3/Bvam4Z+mWN0s HsdIBtAnCZC7/YPkk3RsCzdj1zaxcqmqQIPRlhrGLzdLsFQ9l9fMeYUGOpu+yKQ0 ercAa6MtGEdHexE00ZZ90hj8tjkxlWZ8Al27yh0UkVCe33QtXfWj7mQGRkSlC1yR W5ho1+F0JIO+R49MCPTR9bRxRNOCN79PDM6ai6sxV8HEjselDBlMNQd7zIc7pLnr wlxXkYQ3BkiUjxU3eVE1gLeRVpyLkwxAM9bRvQgUMIXvxcTNkOk6o4uv6Ah1sBNl RniOrtMhhfO7kYm6Y3KG =m8+M -END PGP SIGNATURE- -- 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: web2py 2.10.3 si OUT
the error is in webclient, i use https, while test using http://127.0.0.1:8000 is work. perhaps, i lack in the webclient parameters to have it support https. 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] Re: web2py 2.10.3 si OUT
Why do you even care copy/pasting around snippets? you're registering *ho...* instead of a valid email address! READ the code, UNDERSTAND what the test does, and act accordingly, BEFORE calling it a bug. On Thursday, April 9, 2015 at 8:25:36 AM UTC+2, 黄祥 wrote: 1. create new test app 2. print the value, as you can see the print syntax. 3. for client.text it return a html, i copas it to the new editor and save it as html file, and search 'Homer' using web browser, the result is it's not found. 4. checked on auth_user table, the homer user is there (can register user) 5. trying to comment #assert('Homer' in client.text), it no errors occured anymore.so imho i think it's because the login is not successful so that it can't get 'Homer'. 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] Dumb Question - from a real beginner
So im just starting with Python / Web2py i want to do a simple test page to have a button to turn on a led on a RPi... the default.py looks like this import RPi.GPIO as GPIO def index(): return dict(message=this is a test) def btnon(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) GPIO.output(22,GPIO.HIGH) What i would like to do is call that btnon on an event, like a click on something to make it exectute the commands if this something i can do on a simple way, if you can guide me, i will be greatly appreciated -- 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] [Request] LDAP/FreeIpa Schema support
Hi, We had a hard time configuring web2py to authorise using our LDAP/FreeIPa schema. More precisely getting the groups of the user. At the end we had to do a few changes directly in ldap_auth.py, that's not ideal but at least it's working. Could be possible for you to add one mode in LDAP even more flexible than the current custom mode? Or perhaps to extend the custom mode with more options? Thanks Vicente -- 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] Set Content-Type for Uploadfs S3FS
Hello, I am using fs.s3fs to upload image files directly to s3. It works great, but users can't visit the image link and view directly in their browser, because the content-type is defaulting to application/octet-stream. From my recent searching, I found that fs.s3fs does not support setting the content-type of a file as of June 2014 https://groups.google.com/forum/#!topic/pyfilesystem-discussion/LUAVHACd88M What would be the best way to have the content-type set on or shortly after a successful upload to s3? Use a different library to set uploadfs? - I know you can set meta-data with boto, but it says here that uploadfs doesn't work with boto https://groups.google.com/forum/#!msg/web2py-developers/yeCG3OW93nM/pwxQooBj3ecJ Trigger something to run whenever a record containing an upload field is added to the db that checks my s3 bucket and sets the content-type right after upload? -If this is the way to go, what would be the best way to do this? Edit fs.s3fs so that it accepts meta-data? -I can't find good documentation for fs and would probably not know how to do this even if I could find some. Thank you for your time. -James. -- 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: Possible bug report - unicode strings in list:string field generating encode errors
In the interest of making info available - I submitted a patch but it hasn't been picked up due to a couple of concerns about future revisions On the off chance that you need to fix this issue and can't wait for the future here is what I have changed - it has been working for me very well. BUT note that any update to pydal will break your changes! Don't do this unless you are really really ready to move off the reservation… in pydal/adapters/base.py inside the represent method of the BaseAdapter class change: if field_is_type('list:string'): obj = map(str,obj) TO: if field_is_type('list:string'): try: obj = map(str,obj) except UnicodeEncodeError: obj = map(lambda x:unicode(x).encode(self.db_codec),obj) No warranty offered! On Thursday, April 2, 2015 at 10:57:41 PM UTC-7, Tom Stratton wrote: Update - I found the bug reported here: https://github.com/web2py/web2py/issues/697 I have also suggested a fix but I am not deep enough into the code to know if it might break other behaviors. See the bug tracker for my suggested fix and let me know here if you have any thoughts about what else might need to be changed. -- 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] model file not behaving correctly
I have been building an application with the model in a sqlite db. I received an error stating that the .table file was corrupted, while trying to resolve one .table file, revealed that all were corrupted. This forced me to backup all tables in the db, delete the db and started with a empty db and use the backups to refill the db to the state before the corruption. An issue came up that was very strange. I had to reinitialise all db tables, with all require/default/references commented out as the model was crashing with the error shown below. I solved the issue by bringing the tables back sequentially added the extra Field variables i.e. requires. I added the traceback below: Regards, James Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. Traceback (most recent call last): File C:\web2py_projects\spie\web2py\gluon\restricted.py, line 217, in restricted exec ccode in environment File C:/web2py_projects/spie/web2py/applications/spie/models/db1.py http://127.0.0.1:8000/admin/edit/spie/models/db1.py, line 27, in module label='Project', File C:\web2py_projects\spie\web2py\gluon\dal.py, line 8139, in define_table table = self.lazy_define_table(tablename,*fields,**args) File C:\web2py_projects\spie\web2py\gluon\dal.py, line 8176, in lazy_define_table polymodel=polymodel) File C:\web2py_projects\spie\web2py\gluon\dal.py, line 1086, in create_table fake_migrate=fake_migrate File C:\web2py_projects\spie\web2py\gluon\dal.py, line 1194, in migrate_table self.execute(sub_query) File C:\web2py_projects\spie\web2py\gluon\dal.py, line 1916, in execute return self.log_execute(*a, **b) File C:\web2py_projects\spie\web2py\gluon\dal.py, line 1910, in log_execute ret = self.cursor.execute(command, *a[1:], **b) ProgrammingError: schema db does not exist -- 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.