[web2py] revers SELECT_OR_ADD_OPTION

2016-07-17 Thread narges Rezaei
in SELECT_OR_ADD_OPTION we create category when product form is called . but now i have a category and i want create a product for it . for example i have a phone book and i want add number with small widget on my page . -- Resources: - http://web2py.com - http://web2py.com/book (Documentati

[web2py] Get image from url and save in uploads folder - AttributeError

2016-07-17 Thread Daniel
Hi all, I am trying to retrieve a picture from a url and save it in the uploads folder and then reference the file in the auth_user table, however I am getting AttributeError (folder) and I'm not sure why. def save_facebook_image(fbid): if auth.user: import urll

[web2py] Re: session error

2016-07-17 Thread Massimo Di Pierro
Are you using trunk? I just fixed this in trunk but I do not believe this is an error in trunk. On Saturday, 16 July 2016 13:54:18 UTC-5, Dmitri Ermolaev wrote: > > I use > > if not request.env.web2py_runtime_gae: > migrate = 0 > fake_migrate = myconf.take('db.fake_migrate') and True or

[web2py] Get image from url and save in uploads folder - AttributeError

2016-07-17 Thread Nico de Groot
In your function you overwrite the web2py request object. So when you use request.folder later it's no longer available. You can save the attribute to a local var request _location before the overwrite, and use it later. Nico de Groot -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Angularjs calls to web2py rest api

2016-07-17 Thread dlypka
I got angular to call web2py controller methods passing data both ways by using the older web2py approach not using '@... restful' decorators. So in the $http.get I pass the full URL such as 'http://127.0.0.1:8000/ welcome/default/api/auth_user/1' On Tuesday, July 12, 2016 at 6:45:40 AM UTC-4, bo

Re: [web2py] Re: Google App Engine Launcher 1.9.34 breaks web2py?

2016-07-17 Thread dlypka
I found the fix here (it is a true Google App Engine SDK issue): https://code.google.com/p/googleappengine/issues/detail?id=12852 The key step is this: You can add a appengine_config.py python file to the root directory of your application with the following contents: import sys sys.pla

[web2py] Re: Problem running GAE SDK with web2py 2.14.5

2016-07-17 Thread dlypka
I found the fix here: https://code.google.com/p/googleappengine/issues/detail?id=12852 The key step is: You can add a appengine_config.py python file to the root directory of your application with the following contents: import sys sys.platform = 'linux3' On Friday, April 15, 2016 at 1

[web2py] Re: Get image from url and save in uploads folder - AttributeError

2016-07-17 Thread Anthony
Also, do not handle uploads by manually creating the file and filename, as that will result in problems when retrieving (the DAL assumes the original filename is encoded in the new filename, but you have not done that). Instead, see http://web2py.com/books/default/chapter/29/06/the-database-abs

[web2py] Re: How to export sqlform.grid with the labeled column names

2016-07-17 Thread Jordan Myers
I figured out how to do it by extending the ExporterClass and adapting the TSV exporter to handle csv with the field labels. Perhaps this should be an option for the default ExporterCSV? Here it is for posterity: class ExporterCSVlabel(ExportClass): label = 'CSV (real labels)' file_ext =

[web2py] Re: auth.settings.auth_two_factor_enabled = True gives me setting key 'auth_two_factor_enabled' does not

2016-07-17 Thread Bernardo Leon
Thank you for yor reply my web2py version is: Version 2.12.3-stable+timestamp.2015.08.19.00.18.03 I am defining one extra field auth.settings.extra_fields['auth_user'] = [Field('motp_secret', 'password', length=512, default='', label='MOTP Secret')] What I am trying to do is implementing googl

[web2py] Re: auth.settings.auth_two_factor_enabled = True gives me setting key 'auth_two_factor_enabled' does not

2016-07-17 Thread Anthony
On Sunday, July 17, 2016 at 12:53:40 PM UTC-4, Bernardo Leon wrote: > > Thank you for your reply > > my web2py version is: Version 2.12.3-stable+timestamp.2015.08.19.00.18.03 > The settings and functionality you are attempting to use were not released until version 2.13.1 (there was prior support

[web2py] Re: auth.settings.auth_two_factor_enabled = True gives me setting key 'auth_two_factor_enabled' does not

2016-07-17 Thread Bernardo Leon
Thanks, with the last version 2.14.6-stable+timestamp.2016.05.10.00.21.47 I don't have any errors but I have noticed that my extra_field is not being created in my database even if I leave my DAL like this: db = DAL('sqlite://database.db') so I can not set the value of my extra_field Another t

[web2py] env vars in appconfig.ini

2016-07-17 Thread LMK
Hello, Can I use OS Environment variables in appconfig.ini? If so, how can I apply it? I just tried the following snippet and it didn't work. [db] uri=%(MY_DB_URL)s I got the error below: Bad value substitution: section: [db] option : uri key : my_db_url rawval : .sqlite Thanks. -- Resourc

[web2py] Re: auth.settings.auth_two_factor_enabled = True gives me setting key 'auth_two_factor_enabled' does not

2016-07-17 Thread 黄祥
pls try : *models/db.py* from gluon.tools import Auth, Service, PluginManager auth = Auth(db, host_names=myconf.get('host.names')) service = Service() plugins = PluginManager() auth.settings.extra_fields['auth_user'] = [Field('motp_secret', 'password', length=512, default='', label='MOTP Secret'

[web2py] how to know which users are currently logged in?

2016-07-17 Thread Jordan Myers
Hello everyone, I was wondering if there's a way to return a list of all users who are currently logged in or to check whether a particular user is logged in. The closest function I could find is auth.is_logged_in() but that seems to only check for the computer sending the request. Any ideas?

[web2py] Re: how to know which users are currently logged in?

2016-07-17 Thread Anthony
Not a trivial task. See http://stackoverflow.com/a/12224157/440323 for some ideas. Anthony On Sunday, July 17, 2016 at 6:47:01 PM UTC-4, Jordan Myers wrote: > > Hello everyone, > > I was wondering if there's a way to return a list of all users who are > currently logged in or to check whether a

[web2py] Re: env vars in appconfig.ini

2016-07-17 Thread Anthony
I don't think appconfig supports environment variables in .ini files, though I think it could be made to if it used SafeConfigParser(os.environ) in place of SafeConfigParser(). Maybe open a Github issue with this suggestion. Anthony On Sunday, July 17, 2016 at 3:35:50 PM UTC-4, LMK wrote: > >

[web2py] Re: how to know which users are currently logged in?

2016-07-17 Thread Jordan Myers
Thank you. The approximation given in the link is good enough. On Sunday, July 17, 2016 at 9:53:07 PM UTC-5, Anthony wrote: > > Not a trivial task. See http://stackoverflow.com/a/12224157/440323 for > some ideas. > > Anthony > > On Sunday, July 17, 2016 at 6:47:01 PM UTC-4, Jordan Myers wrote: >>

[web2py] Re: env vars in appconfig.ini

2016-07-17 Thread LMK
Thanks. I will open an issue on GitHub. -- 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