[web2py] Re: return all results for a field if no query.
thanks. On Sunday, February 23, 2014 12:34:58 AM UTC+2, Anthony wrote: If you make sure your URL vars have the same names as the associated table fields, you can simplify further as follows: def eco: my_content = db.table.created_by == auth.user.id filter_query = reduce(lambda a, b: a b, [db.table[v] == request.vars[v] for v in request .vars if v in db.table.fields]) filtered_list = db(my_content filter_query).select(,) return dict(filtered_list = filtered_list) or if you prefer loops: def eco: filter_query = db.table.created_by == auth.user.id for var in [v for v in request.vars if v in table.fields]: filter_query = db.table[var] == request.vars[var] filtered_list = db(filter_query).select(,) return dict(filtered_list = filtered_list) Anthony On Saturday, February 22, 2014 3:25:34 PM UTC-5, Avi A wrote: Great, thanks. the moreover idea is what i was missing. Yeah, I'll replace the args with vars url, thanks. On Saturday, February 22, 2014 9:36:58 PM UTC+2, Niphlod wrote: every db.table.column == parameter is something that further reduces the resultset (it's a filter condition) in case parameter is 0, just don't use that condition in the query ^_^ moreover, you can do filter_condition = (db.table.created_by == auth.user_id) if . filter_condition = filter_condition (db.table.field_a == something) filtered_set = db(filter_condition).select() PS: usually filters are more manageable with request.vars than request.args() ... it's a little unconfortable to remember the order of the filter and to specify 0 as the ALL parameter is counterintuitive eco/0/1/0/6/0/0 sounds a lot more ugly than eco?b=1d=6 On Saturday, February 22, 2014 7:28:33 PM UTC+1, Avi A wrote: Hi, Assuming I want to create an ajax query that will filter the results according to some data in fields: for example: ajax url: ... eco/1/6/4/5/3 def eco: my_content = db.table.created_by == auth.user.id query_a = db.table.field_a == request.args(0) query_b = db.table.field_b== request.args(1) query_c = db.table.field_c == request.args(2) query_d = db.table.field_d == request.args(3) query_e = db.table.field_e == request.args(4) filtered_list = db((my_content) (query_a) (query_b) (query_c) (query_d) (query_e)).select(,) return dict(filtered_list = filtered_list) I guess, so far so good. Now if any arg == 0 , (for example: eco/2/0/0/0/3) I want it to skip that specific query. So I want to a chive something like that: if request.args(0) != 0: query_a = db.table.field_a == request.args(0) else: query_a = db.table.field_a == ALL if request.args(01) != 0: etc... with what should I replace the ALL? or the else part? 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/groups/opt_out.
Re: [web2py] Auth with multiple E-mail addresses
I think a new class could do the job. You could modify your db.py Replace auth = Auth(db, hmac_key=Auth.get_or_create_key()) by class MyAuth(Auth): # your code pass auth = MyAuth(db, hmac_key=Auth.get_or_create_key()) Regards, Martin 2014-02-23 0:21 GMT+01:00 Damien bardon.dam...@gmail.com: I would like to associate to my users multiple E-mail addresses and phone numbers. I would like these users to be able to authenticate with any (verified) E-mail address or phone number. I am wondering what would be the best approach to achieve this. One idea would be to modify the existing Auth class. I am willing to do it, but I would like to know if this is something that could then potentially be merged in the main branch of web2py (any one else interested in this feature?). If not, this approach might not work as I don't want to maintain an alternate version of Auth that would diverge from the one integrated in web2py. Thank you for your suggestions. Damien -- 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/groups/opt_out. -- 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/groups/opt_out.
[web2py] Re: Using web2py build-in serwer
yes. On Sunday, 23 February 2014 05:32:49 UTC+11, aslav wrote: Hi there, I'm new to programming, python and web2py. I have a question - Can I use web2py build-in server insted of apache if I'm just running a small ( really small ) website with couple of visits and file downloads per day? -- 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/groups/opt_out.
[web2py] Re: web2py dashboard external data
It sounds like (2) should be done in background. web2py's scheduler handles that. You write some code which does the insert, and then get the scheduler to run it. The scheduler is a separate web2py instance for your application, which doesn't serve web-pages, it just runs jobs. Apart from that, it works like everything else in web2py (so it uses your app's models and the DAL). You can actually develop your code as a controller function as if was to run interactively, and when you're comfortable with it, convert it into a scheduler job. The scheduler functionality is good. The book documents it quite well. The DAL is also quite convenient for updating data. (3) depends on whether the processing can be done on the fly for graphing. On Friday, 21 February 2014 07:35:51 UTC+11, Trent Telfer wrote: I am attempting to create a fairly simple dashboard with data retrieved from external data sources. I have currently written python scripts that retrieve the data (date and volume data) from the external data source as a list. My current conundrum is calling the script and inserting the list into the database (the script will be ran once per day). So to break it down I am attempting to: 1) Retrieve external data (completed). 2) Insert into database using the DAL. 3) Process data in database to be graphed and displayed. I can see how to do this with Flask/SQLAlchemy, but I have used web2py for some simpler form based web projects and would prefer to use it Any ideas, suggested tutorials or other methods would be most welcome. Regards, Trent -- 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/groups/opt_out.
[web2py] Re: flash message timeout
thanks and how elegant and it works saves a lot of time closing -- 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/groups/opt_out.
[web2py] include_files() messing with third-party CSS
In web2py_ajax.html, the following line is screwing up the menu in a third-party CSS template: response.include_files() How can I find out what CSS files are being included in this line so that I can try to identify the offending CSS? 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/groups/opt_out.
[web2py] Re: flash message timeout
Thank you, elegant and effective. Just putting this in a page and voila. Saves a lot of closing. -- 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/groups/opt_out.
[web2py] Re: Allow NULL in form validator with reference Field
Great! It worked perfect! The only thing i am not able to do is to show the name field, instead of the id.. :S Thanks a lot mate! It is like this now. Field('awc_pro_id',legacy_db.project, requires=IS_EMPTY_OR(IS_IN_DB(legacy_db, legacy_db.project, '%(pro_name)s'))), El sábado, 22 de febrero de 2014 21:31:45 UTC-3, brahama von escribió: Thanks Niphlod! Will try that. Yes. Mysql with INNODB. I am loading the courses manually but wanted to do it via the web2py form... El martes, 18 de febrero de 2014 17:24:25 UTC-3, Niphlod escribió: does your backend support a foreign key with a null value ? not all of them can. As an alternative, you can Field('awc_pro_id', 'integer', requires=IS_EMPTY_OR(IS_IN_DB())) On Monday, February 17, 2014 7:21:14 PM UTC+1, brahama von wrote: Hi, dunno why my previous post didn't make it. Here it goes. part of my model legacy_db.define_table('courses', Field('awc_name','string'), Field('awc_version','string'), Field('awc_link','string'), Field('awc_pro_id',legacy_db.project, required=False, default=None), Field('awc_cli_id',legacy_db.client), format='%(awc_name)s', migrate=False) While creating a form for insert new courses i get the validator error; value not in database While this is true, i allow that value to be NULL in DB. How can i allow that in the form and insert the record? controller form=SQLFORM(legacy_db.courses) if form.process().accepted: response.flash = 'Course was added Correctly' return dict(form=form,message=T('Edition for Courses')) 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/groups/opt_out.
Re: [web2py] Virtual Fields not working on print.
Yes, that seems to do it, thanks. :) On Wed, Feb 19, 2014 at 3:58 PM, Anthony abasta...@gmail.com wrote: In virtual field functions, you must refer to the table name and field name within each row object, so: return gi.country_code_by_addr(row.melodigram_play.from_where) should be: return gi.country_code_by_addr(row.from_where) That doesn't explain the problem below, but I wonder if something else is going on there (e.g., is the app compiled, and you didn't re-compile after making the change?). As an aside, if you already have a function, no need to wrap it in a lambda -- just do: Field.Virtual('from_country', get_country) Anthony On Wednesday, February 19, 2014 7:32:41 AM UTC-5, Encompass solutions wrote: To try to triage the bug I did the following... import os import pygeoip #gi = pygeoip.GeoIP(os.path.join(request.folder, 'private', 'GeoIP.dat')) def get_country(row): return what? # -*- coding: utf-8 -*- db.define_table('melodigram_play', Field('melodigram_id', 'reference melodigram'), Field('when_opened', 'datetime', default = request.now), Field('from_where', 'string', default = request.client), Field.Virtual('from_country', lambda row: get_country(row)) ) db.melodigram_play.melodigram_id.requires = IS_NOT_EMPTY() db.melodigram_play.when_opened.requires = IS_NOT_EMPTY() --- Basically I just remove everything and returned a text object. This still gives me the same error. File /home/encompass/Projects/melodigram/web2py/applications/melodigram/views/administration/browser.html, line 101, in module File /home/encompass/Projects/melodigram/web2py/gluon/dal.py, line 7267, in __getitem__ raise ae AttributeError: 'Row' object has no attribute 'from_country' On Wednesday, February 19, 2014 1:47:45 PM UTC+2, Marin Pranjić wrote: most likely get_country is failing for some reason Marin On Wed, Feb 19, 2014 at 9:40 AM, Jason Brower enco...@gmail.com wrote: I have this in the model... import uuid import os import pygeoip gi = pygeoip.GeoIP(os.path.join(request.folder, 'private', 'GeoIP.dat')) def get_country(row): return gi.country_code_by_addr(row.from_where) # -*- coding: utf-8 -*- db.define_table('melodigram_play', Field('melodigram_id', 'reference melodigram'), Field('when_opened', 'datetime', default = request.now), Field('from_where', 'string', default = request.client), Field.Virtual('from_country', lambda row: get_country(row)) ) db.melodigram_play.melodigram_id.requires = IS_NOT_EMPTY() db.melodigram_play.when_opened.requires = IS_NOT_EMPTY() I can insert data... but when I try to retrieve it, it tells me the row doesn't exist: h2From: {{=gram_details.from_where}} : {{=gram_details.from_country}}/h2 gram_details.from_where has always worked. gram_details.from_country doesn't work. -- 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. For more options, visit https://groups.google.com/groups/opt_out. -- 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/2Shkz7T3cvQ/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/groups/opt_out. -- 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/groups/opt_out.
[web2py] Re: include_files() messing with third-party CSS
Whatever is in response.files. If you're using the scaffolding app, the files are added herehttps://github.com/web2py/web2py/blob/master/applications/welcome/views/layout.html#L30and herehttps://github.com/web2py/web2py/blob/master/applications/welcome/views/web2py_ajax.html#L11 . Anthony On Sunday, February 23, 2014 10:15:54 AM UTC-5, horridohobbyist wrote: In web2py_ajax.html, the following line is screwing up the menu in a third-party CSS template: response.include_files() How can I find out what CSS files are being included in this line so that I can try to identify the offending CSS? 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/groups/opt_out.
[web2py] Re: Auth with multiple E-mail addresses
Maybe open a discussion on the developers list. I'm not sure if this is a common enough use case to justify incorporating into the framework. What seems to be more common is allowing users to authenticate the same account with multiple social logins (as well as an email/password option). If you want to allow multiple email addresses, you'll have to decide whether to use a list:string field, a JSON field (better if you want to be able to label email addresses, such as personal, work, etc.), or a separate linked table. You'll also still need to designate a primary email address for communications. Anthony On Saturday, February 22, 2014 6:21:11 PM UTC-5, Damien wrote: I would like to associate to my users multiple E-mail addresses and phone numbers. I would like these users to be able to authenticate with any (verified) E-mail address or phone number. I am wondering what would be the best approach to achieve this. One idea would be to modify the existing Auth class. I am willing to do it, but I would like to know if this is something that could then potentially be merged in the main branch of web2py (any one else interested in this feature?). If not, this approach might not work as I don't want to maintain an alternate version of Auth that would diverge from the one integrated in web2py. Thank you for your suggestions. Damien -- 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/groups/opt_out.
[web2py] Embed web2py form in external page
I have a web2py application that accepts values and calculates a score, and I want partner sites to be able to access the API Originally, I was going to have partner sites write the form and pass a JSON object with their partner identifier, access key, and key/value pairs - and just return a score However, I want to enable partners to use what I have built so they don't have to build anything on their end. Is there a way to embed my web2py form in external sites securely, and still be able to track the partner identifier so I know who is accessing the API? Any help or suggestions appreciated Thanks -Jim -- 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/groups/opt_out.
Re: [web2py] Re: Web2py Integration with Multiple Oauth Logins
Hello again, Thanks for taking your time to engage with me. Hopefully I can get this working sometime soon. Regarding the update, I re-cloned the repository and notied a w2p file there. I used this file to upload to the web2py admin interface, which gives me the same error as before. Are you saying that I need to extract it first, add my keys to it, and then try uploading it? Either way, I did it manually using tar and I get this traceback now, which is similar to the above: Traceback (most recent call last): File /home/james/Development/web2py/gluon/restricted.py, line 217, in restricted exec ccode in environment File /home/james/Development/web2py/applications/oauth/models/plugin_social_auth.py http://127.0.0.1/admin/edit/oauth/models/plugin_social_auth.py, line 7, in module Field('user', 'reference auth_user', writable=False, notnull=True)) File /home/james/Development/web2py/gluon/dal.py, line 8139, in define_table table = self.lazy_define_table(tablename,*fields,**args) File /home/james/Development/web2py/gluon/dal.py, line 8156, in lazy_define_table table = table_class(self, tablename, *fields, **args) File /home/james/Development/web2py/gluon/dal.py, line 8665, in __init__ check_reserved(field_name) File /home/james/Development/web2py/gluon/dal.py, line 7850, in check_reserved_keyword 'invalid table/column name %s is a %s reserved SQL/NOSQL keyword' % (name, backend.upper())) SyntaxError: invalid table/column name user is a ALL reserved SQL/NOSQL keyword Guess that needs to be changed as well :) -- James On Sat, Feb 22, 2014 at 3:41 AM, Quint muijsenbe...@gmail.com wrote: Hi, About the exception: I changed the Field name to oauth_uid. I did not notice this problem because i'm using GAE. About *App does not exist or you are not authorized*: This means that your oauth key/secret is not properly set in your configuration. You are not supplying a valid/authorized oauth client key to the provider. Which provider is giving this message? What does your configuration look like? What is find strange is that that plugin packed/installed by yourself is giving different result than te one installed manually. This should be exactly the same right? Are you sure everything is included in the one packed by yourself? Regards, Quint On Saturday, February 22, 2014 4:15:11 AM UTC+1, James Q wrote: Interesting plugin, thanks for the link. I took that repository, tar'ed and gzip'ed it, and uploaded it as a plugin. Says App does not exist or you are not authorized. No idea what that means, so I did it manually in a new app called oauth. Here is what I get as an exception when trying to open up the new app: Traceback (most recent call last): File /home/james/Development/web2py/gluon/restricted.py, line 217, in restricted exec ccode in environment File /home/james/Development/deemok-web2py/applications/oauth/models/plugin_social_auth.py http://127.0.0.1/admin/edit/oauth/models/plugin_social_auth.py, line 7, in module Field('user', 'reference auth_user', writable=False, notnull=True)) File /home/james/Development/web2py/gluon/dal.py, line 8139, in define_table table = self.lazy_define_table(tablename,*fields,**args) File /home/james/Development/web2py/gluon/dal.py, line 8156, in lazy_define_table table = table_class(self, tablename, *fields, **args) File /home/james/Development/web2py/gluon/dal.py, line 8665, in __init__ check_reserved(field_name) File /home/james/Development/web2py/gluon/dal.py, line 7850, in check_reserved_keyword 'invalid table/column name %s is a %s reserved SQL/NOSQL keyword' % (name, backend.upper())) SyntaxError: invalid table/column name uid is a ALL reserved SQL/NOSQL keyword Can you possibly rename the field: Field('uid', 'string', notnull=True, writable=False, length=255), to: Field('oauth_uid', 'string', notnull=True, writable=False, length=255), Or something along those lines? On Friday, February 21, 2014 3:55:00 AM UTC-5, Quint wrote: Hi, You could have a look at python-social-authhttps://github.com/omab/python-social-auth and if you like it and don't know how to integrate it, have a look at this plugin https://code.google.com/p/w2p-social-auth/ to integrate it in web2py. Quint On Wednesday, February 19, 2014 12:33:29 AM UTC+1, James Q wrote: I have a feeling that this topic comes up often, but I cannot seem to Google a good solution to this. Essentially, I want users to be able to login using either the built in Auth, or login via some Oauth provider, like Twitter and Facebook. I have seen previous solutions using ExtendedLoginForm and custom Twitter classes that inherit from OAuthProvider, but they no longer seem to work. The Twitter code I find no longer supports the newest Twitter API; the linkedin code from the web2py book also does not work. Here is sample code I have now, which only seems to
[web2py] Re: Embed web2py form in external page
if your original design accepted n fields to calculate the score plus 2 values for partner identifier and access key, the same level of security is provided with a fragment that loads the form containing n fields plus the 2 hidden for partner identification. Briefly, it's a question of partner reliability: the partner can publish only the n fields and privatize its own identification in its code (i.e. be sure that him and only him posts data with its access key), then post the values to your api decorating them with its access identification. Of course the partner can be a lame coder and put its own access key in the public, but then it is its own responsibility in the latter case, you're the one providing identification. this means you have to figure out how to restrict the access to your form and provide the identification for the publisher, in a way that for publisher2 it's impossible to forge a request coming from publisher1 I can't really figure out a solution where the access identification stays secured without asking the partner to post-process the submitted values. -- 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/groups/opt_out.
[web2py] Re: When i'm uploading, my website lags
Never mind it, I've resolved my problem by putting all the uploaded files in static folder and insted of having actual file in db, now I just list links for these. -- 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/groups/opt_out.
[web2py] Calling javascript from submenu
Hello, i'm trying to call a javascript function from a submenu item and having some troubles with this. Calling javascript from a level 1 menu works just fine, like this: response.menu = [ (T('File'), False, URL(), [ (T('New'), False, URL('project', 'create'), []) ]), (A('click me',_onclick=alert('hello')),None,None) ] However, if i try moving the second menu item to a level 2 section like this: response.menu = [ (T('File'), False, URL(), [ (T('New'), False, URL('project', 'create'), []) ]), (T('View'), False, URL() , [ (A('click me',_onclick=alert('hello')),None,None) ]) ] The function does work, but after showing the alert box, the browser is redirected to http://localhost:8000/undefined My Firefox console window shows: [11:46:30.410] Empty string passed to getElementById(). @ http://localhost:8000/Isidor/static/js/jquery.js:3 [11:46:30.568] GET http://localhost:8000/undefined [HTTP/1.1 404 NOT FOUND 1ms] Any ideas at what i'm doing wrong? Jaap -- 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/groups/opt_out.
[web2py] accessing web2py FORM from external partner sites
I am creating a web2py application that accepts values and calculates a score Want to make it available for partner sites to access the API, so I was thinking about having the partners pass a JSON object with their access key and other key/value pairs, and return the calculated value. However, I want to make it simple and easy for partners to use. I don't want them to have to develop their own forms, so I was thinking about just having partner sites embed my web2py form in their applications. Then I can control the form and workflow, and they can just use the app. QUESTION: How can I securely embed a web2py form into an external partner website (iframe or pop-up window) and still track which partner is accessing the application? I need to track who is calling the form, and want some type of partner 'authentication' so I can control who is accessing the application. Is there a better way to do this rather than just embedding the form? Any suggestions? -- 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/groups/opt_out.
[web2py] external sites accessing web2py form
I have a web2py application that accepts values and calculates a score, and I want partner sites to be able to access the API Originally, I was going to have partner sites write the form and pass a JSON object with their partner identifier, access key, and key/value pairs - and just return a score However, I want to enable partners to use what I have built so they don't have to build anything on their end. Is there a way to embed my web2py form in external sites securely, and still be able to track the partner identifier so I know who is accessing the API? Any help or suggestions appreciated 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/groups/opt_out.
[web2py] mongodb type 'exceptions.RuntimeError' you must specify a Field(...,uploadfolder
When using upload fields with mongodb and SQLFORM (not factory forms) I get the runtime error type 'exceptions.RuntimeError' you must specify a Field(...,uploadfolder=...) the same code but switching to sqlite works correctly. Adding db.table.field.uploadfolder = os.path.join(request.folder,'uploads') to the controller before processing the form resolves the issue. I believe this might be a bug in the mongodb adapter. -- 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/groups/opt_out.
[web2py] partner sites accessing web2py FORM
I have a web2py application that accepts values and calculates a score, and I want partner sites to be able to access the API Originally, I was going to have partner sites write the form and pass a JSON object with their partner identifier, access key, and key/value pairs - and just return a score However, I want to enable partners to use what I have built so they don't have to build anything on their end. Is there a way to embed my web2py form in external sites securely, and still be able to track the partner identifier so I know who is accessing the API? Any help or suggestions appreciated 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/groups/opt_out.
[web2py] Re: When i'm uploading, my website lags
I am pretty sure you can access it while uploading. You just cannot access it from the same user session because the session is locked. Web2py serializes accesses from the same user session unless you session._unlock(response). Try from different browsers and you will see it is not locked. On Saturday, 22 February 2014 12:25:58 UTC-6, aslav wrote: Hi there, I'm very new to programming, python and web2py and I have a question. I got this app in which I upload some file to db through appadmin ( code is almost the same as the one massimo gave in the book [ chapter about image blog ] ). And when I'm uploading something or downloading something, I ( or anyone else ) can't access my website until uploading/downloading is finished. What may be the problem? Sorry if I described it wrong, but I'm really new to this stuff. Edit: I'm using web2py+mod_wsgi+apache -- 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/groups/opt_out.
[web2py] Re: how login_onaccept works ?
Yes, I'm sure, but Marin wrote why it was wrong. Thank both of You for Your time regards brushek W dniu piątek, 21 lutego 2014 16:57:13 UTC+1 użytkownik Massimo Di Pierro napisał: Are you sure? It should only fire once. On Thursday, 20 February 2014 17:56:13 UTC-6, brushek wrote: Hello web2py users and devs, I have simple question: does auth.settings.login_onaccept should fire only once after login, or it is normal that it is running in every click after login ? I have folowing code in default.py: def check_production(towar=1): if not session.auth: return user_id = str(session.auth.user.id) import datetime db.produkcja.update_or_insert((db.produkcja.id_field == 2) (db. produkcja.id_user == user_id),end_time = datetime.datetime.now(),id_towaru = towar) auth.settings.login_onaccept = check_production(1) As I can see, the end_time field is updated in database every time I click on site (after login). It is correct behavior ? I would like to fire this function only once, after user login. Is there any other way to achive one-time run of function after login ? Regards brushek -- 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/groups/opt_out.
[web2py] Re: web2py mini conference in Chicago
The date is set. May 4 - 10am - 6pm. We have some sponsors already. I am setting up a registration web site. Let me know privately if you are interesting in sponsoring, presenting, or simply helping. Massimo On Tuesday, 18 February 2014 12:26:00 UTC-6, Massimo Di Pierro wrote: Let's try this again I am planning to organize a one day web2py mini conference in Chicago. Would you be interested? If so, please let me know about your availability. http://doodle.com/nrgr3tt45m3vr5bg Massimo P.S. We may stream it. We may allow remote talks. We will definitively allow chats. Only check a box if you can be here in person and possibly interested to talk about something. -- 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/groups/opt_out.
[web2py] Date display i18n internationalization?
I have some dates that I want to display in the proper culture specific format. I want a simple solution so what I want is rather than me having to specify the date format for every possible culture is to use the following default: dd-mm- and then specify a handful of exceptions, e.g. for United States: mm-dd- How can I achieve this in web2py where it's switched based on the Accept-Language header? -- 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/groups/opt_out.
[web2py] Re: mongodb type 'exceptions.RuntimeError' you must specify a Field(...,uploadfolder
Please open a ticket on google code. On Sunday, 23 February 2014 07:06:57 UTC-6, Mr. J.S Jones wrote: When using upload fields with mongodb and SQLFORM (not factory forms) I get the runtime error type 'exceptions.RuntimeError' you must specify a Field(...,uploadfolder=...) the same code but switching to sqlite works correctly. Adding db.table.field.uploadfolder = os.path.join(request.folder,'uploads') to the controller before processing the form resolves the issue. I believe this might be a bug in the mongodb adapter. -- 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/groups/opt_out.
[web2py] Re: accessing web2py FORM from external partner sites
I guess the issue is: how to you plan to authenticate the user? Your partners could register with your app and been issued a token: auth.settings.extra_fields=[Field('token',compute=lambda: str(uuid.uuid4()))] You can embed the token in the URL which generates the form (embedded via iframe) to track where users come from. if you need to authenticate the users the situation would be more complex. On Sunday, 23 February 2014 14:35:30 UTC-6, Jason Burosh wrote: I am creating a web2py application that accepts values and calculates a score Want to make it available for partner sites to access the API, so I was thinking about having the partners pass a JSON object with their access key and other key/value pairs, and return the calculated value. However, I want to make it simple and easy for partners to use. I don't want them to have to develop their own forms, so I was thinking about just having partner sites embed my web2py form in their applications. Then I can control the form and workflow, and they can just use the app. QUESTION: How can I securely embed a web2py form into an external partner website (iframe or pop-up window) and still track which partner is accessing the application? I need to track who is calling the form, and want some type of partner 'authentication' so I can control who is accessing the application. Is there a better way to do this rather than just embedding the form? Any suggestions? -- 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/groups/opt_out.
[web2py] Re: Date display i18n internationalization?
https://groups.google.com/forum/#!msg/web2py/ZxdTaSM1Fpk/hGryHgztlPQJ On Sunday, 23 February 2014 19:06:56 UTC-6, User wrote: I have some dates that I want to display in the proper culture specific format. I want a simple solution so what I want is rather than me having to specify the date format for every possible culture is to use the following default: dd-mm- and then specify a handful of exceptions, e.g. for United States: mm-dd- How can I achieve this in web2py where it's switched based on the Accept-Language header? -- 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/groups/opt_out.
[web2py] limitby syntax error in freshly created app
Hello, I just downloaded the most recent version of web2py and created a new app that I haven't edited at all. If I click on the database administration button in the Models section I am getting the following error: Traceback (most recent call last): File /Users/ajl/Downloads/web2py/gluon/restricted.py, line 216, in restricted ccode = compile2(code, layer) File /Users/ajl/Downloads/web2py/gluon/restricted.py, line 199, in compile2 return compile(code.rstrip().replace('\r\n', '\n') + '\n', layer, 'exec') File /Users/ajl/Downloads/web2py/applications/app1/controllers/appadmin.py http://127.0.0.1:8000/admin/default/edit/app1/controllers/appadmin.py, line 266 *fields, limitby=(start, stop), ^ SyntaxError: invalid syntax Any ideas why that is the case? I am sure that a few weeks ago when I played with web2py the last time the thing worked. 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/groups/opt_out.
[web2py] Re: limitby syntax error in freshly created app
Which version exactly? Which web2py version? I cannot reproduce On Sunday, 23 February 2014 21:15:52 UTC-6, Alberto wrote: Hello, I just downloaded the most recent version of web2py and created a new app that I haven't edited at all. If I click on the database administration button in the Models section I am getting the following error: Traceback (most recent call last): File /Users/ajl/Downloads/web2py/gluon/restricted.py, line 216, in restricted ccode = compile2(code, layer) File /Users/ajl/Downloads/web2py/gluon/restricted.py, line 199, in compile2 return compile(code.rstrip().replace('\r\n', '\n') + '\n', layer, 'exec') File /Users/ajl/Downloads/web2py/applications/app1/controllers/appadmin.py http://127.0.0.1:8000/admin/default/edit/app1/controllers/appadmin.py, line 266 *fields, limitby=(start, stop), ^ SyntaxError: invalid syntax Any ideas why that is the case? I am sure that a few weeks ago when I played with web2py the last time the thing worked. 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/groups/opt_out.
[web2py] HELP with bootstrap 3
Urgent. We need help fixing the bootstrap 3 menu in welcome in trunk. Can it be done without changing any python code, except perhaps the MENU helper? -- 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/groups/opt_out.
[web2py] AJAX component reload problem using .html vs .load
In the following code, when pressing the X link, the row and DIV are deleted and the component is refreshed in the controller function stat_del(). This only works when the loaded component is named .html rather than .load So this code works but the .load naming does not work. *** *** CONTROLLER: user.py *** *** def stats(): user = session.r_cur_user tipuser = session.r_tip_user query = (Stat.crea_id==user.id) rows = db(query).select(orderby=~Stat.time_stamp) return locals() def stat_del(): db(Stat.id==a0).delete() response.js = jQuery('#stats-ajax').get(0).reload(); return locals() * *** LOADED: stats.html *** * {{for row in rows:}} div class='tip-del-div-wrapper' div class='tip-del-div'{{=A('X', _class=tip-del, _style=margin-top: 2px;, callback=URL(TIP_APP+'/user', 'stat_del', str(row.id)))}}/div /div div class='tip-body tpf-body' p class=expand-desc tpf-body style='margin-left: 6px; margin-right: 18px;'{{=Status goes here}}/p p class=expand-desc tpf-body style='margin-left: 6px;'{{=Time stamp goes here}}/p /div {{pass}} script $('.del-div').on('click', function(){ $(this).parent().parent().remove(); }); /script *** MAIN VIEW: home.html *** {{left_sidebar_enabled,right_sidebar_enabled=True,True}} {{extend 'layout.html'}} {{block profile}} {{=LOAD('user','profile',user.id,ajax=True, content='')}} {{end}} {{block follows}} {{=LOAD('user','friends',user.id,ajax=True, content='')}} {{end}} {{block center}} div class=tabbable ul class=nav nav-tabs li class=activea href=#tab3 data-toggle=tabStatus/a/li lia href=#tab2 data-toggle=tabReceived/a/li lia href=#tab1 data-toggle=tabGiven/a/li /ul div class=tab-content style=overflow-x:hidden; {{if user.creator:}} {{block stats}} div class=tab-pane active id=tab3 style=width:100%;height:70%;overflow-y:auto; overflow-x:hidden; {{if mypage:}} {{=LOAD('user','stat', args=[user.id], target='stat-ajax', ajax=True, content='')}} {{pass}} {{=LOAD('user','stats', args=[user.id], target='stats-ajax', ajax=True, content='')}} /div {{end}} {{pass}} /div /div {{end}} -- 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/groups/opt_out.
[web2py] Re: HELP with bootstrap 3
What do we need: 1) testing of the latest welcome 2) the Login menu does not work show the dropdown on mouseover. I do not know why. Massimo On Sunday, 23 February 2014 21:56:56 UTC-6, Massimo Di Pierro wrote: Urgent. We need help fixing the bootstrap 3 menu in welcome in trunk. Can it be done without changing any python code, except perhaps the MENU helper? -- 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/groups/opt_out.
[web2py] Re: Date display i18n internationalization?
Sorry I'm not following the relevance of that forum topic. What I'm trying to do for example is: I have a date in javascript in a view : var dateFormat = {{=T('dd mmm ')}}) Later on this will get expanded to for example 20 January 2014. For the US, I want the date displayed as January 20, 2014. So I created a en-us.py language file with the following content: { '!langcode!': 'en-us', '!langname!': 'English (United States)', 'dd mmm ':'mmm dd, ' } I restarted web2py. However with my browser Accept-Language set to en-us I still see the date as 20 January 2014. My full firefox header is: Accept-Language en-us,en;q=0.5 What am I missing about how T works? On Sunday, February 23, 2014 8:39:56 PM UTC-5, Massimo Di Pierro wrote: https://groups.google.com/forum/#!msg/web2py/ZxdTaSM1Fpk/hGryHgztlPQJ On Sunday, 23 February 2014 19:06:56 UTC-6, User wrote: I have some dates that I want to display in the proper culture specific format. I want a simple solution so what I want is rather than me having to specify the date format for every possible culture is to use the following default: dd-mm- and then specify a handful of exceptions, e.g. for United States: mm-dd- How can I achieve this in web2py where it's switched based on the Accept-Language header? -- 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/groups/opt_out.
Re: [web2py] Re: HELP with bootstrap 3
2014-02-23 23:59 GMT-04:30 Massimo Di Pierro massimo.dipie...@gmail.com: What do we need: 1) testing of the latest welcome 2) the Login menu does not work show the dropdown on mouseover. I do not know why. Just put this in bootstrap.min.css: .dropdown:hover .dropdown-menu { display: block; } Missing files: bootstrap-theme.min.css web2py-bootstrap3.js web2py-bootstrap3.css Massimo On Sunday, 23 February 2014 21:56:56 UTC-6, Massimo Di Pierro wrote: Urgent. We need help fixing the bootstrap 3 menu in welcome in trunk. Can it be done without changing any python code, except perhaps the MENU helper? -- 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/groups/opt_out. -- 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/groups/opt_out.
[web2py] Re: HELP with bootstrap 3
I found this on Stack Overflow http://stackoverflow.com/questions/16214326/bootstrap-dropdown-with-hover ul.nav li.dropdown:hover ul.dropdown-menu { display: block; } and I find this solution using CSS in the .css file under welcome named static/css/web2py_bootstrap_nojs.css but not in any other css file. However this file is not included by another file anywhere in the welcome application. If this is it I just got lucky is all. :-) The Welcome application name header is scrunched up under the menu bar and partially visible lastest Firefox Ubuntu 12.04 LTS The web2py menu item (yellow) doesn't open like in 2.8.2 Ron -- 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/groups/opt_out.
Re: [web2py] Re: HELP with bootstrap 3
Login menu works good, but web2py menu with submenu appears still disordered. 2014-02-24 1:17 GMT-04:30 Roberto Perdomo roberto...@gmail.com: 2014-02-23 23:59 GMT-04:30 Massimo Di Pierro massimo.dipie...@gmail.com: What do we need: 1) testing of the latest welcome 2) the Login menu does not work show the dropdown on mouseover. I do not know why. Just put this in bootstrap.min.css: .dropdown:hover .dropdown-menu { display: block; } Missing files: bootstrap-theme.min.css web2py-bootstrap3.js web2py-bootstrap3.css Massimo On Sunday, 23 February 2014 21:56:56 UTC-6, Massimo Di Pierro wrote: Urgent. We need help fixing the bootstrap 3 menu in welcome in trunk. Can it be done without changing any python code, except perhaps the MENU helper? -- 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/groups/opt_out. -- 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/groups/opt_out.
[web2py] Re: HELP with bootstrap 3
Added some of the missing files. They were created by Paolo but it was my mistake not to post them. They should address most of the issues. On Sunday, 23 February 2014 23:51:04 UTC-6, Ron McOuat wrote: I found this on Stack Overflow http://stackoverflow.com/questions/16214326/bootstrap-dropdown-with-hover ul.nav li.dropdown:hover ul.dropdown-menu { display: block; } and I find this solution using CSS in the .css file under welcome named static/css/web2py_bootstrap_nojs.css but not in any other css file. However this file is not included by another file anywhere in the welcome application. If this is it I just got lucky is all. :-) The Welcome application name header is scrunched up under the menu bar and partially visible lastest Firefox Ubuntu 12.04 LTS The web2py menu item (yellow) doesn't open like in 2.8.2 Ron -- 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/groups/opt_out.
[web2py] Re: HELP with bootstrap 3
Can we get rid of web2py-bootstrap3.js? Do we all these files? web2py.css bootstrap-responsive.min.css bootstrap-theme.min.css web2py-bootstrap3.css web2py_bootstrap.css web2py_bootstrap_nojs.css can we reduce to two: web2py.css web2py-bootstrap3.css On Monday, 24 February 2014 00:09:48 UTC-6, Massimo Di Pierro wrote: Added some of the missing files. They were created by Paolo but it was my mistake not to post them. They should address most of the issues. On Sunday, 23 February 2014 23:51:04 UTC-6, Ron McOuat wrote: I found this on Stack Overflow http://stackoverflow.com/questions/16214326/bootstrap-dropdown-with-hover ul.nav li.dropdown:hover ul.dropdown-menu { display: block; } and I find this solution using CSS in the .css file under welcome named static/css/web2py_bootstrap_nojs.css but not in any other css file. However this file is not included by another file anywhere in the welcome application. If this is it I just got lucky is all. :-) The Welcome application name header is scrunched up under the menu bar and partially visible lastest Firefox Ubuntu 12.04 LTS The web2py menu item (yellow) doesn't open like in 2.8.2 Ron -- 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/groups/opt_out.
[web2py] Re: Date display i18n internationalization?
This should work. I do not think the problem is in T. Anyway, let's rule that out. Where is this, in a HTML file? When you look at the source file, is the string {{=T('dd mmm ')}}) translated? What if you add the following to your model? T.force('en-us') On Sunday, 23 February 2014 23:08:14 UTC-6, User wrote: Sorry I'm not following the relevance of that forum topic. What I'm trying to do for example is: I have a date in javascript in a view : var dateFormat = {{=T('dd mmm ')}}) Later on this will get expanded to for example 20 January 2014. This works and the date display as expected. For the US, I want the date displayed as January 20, 2014. So I created a en-us.py language file with the following content: { '!langcode!': 'en-us', '!langname!': 'English (United States)', 'dd mmm ':'mmm dd, ' } I restarted web2py. However, with my browser Accept-Language set to en-us I still see the date as 20 January 2014. My full firefox header is: Accept-Language en-us,en;q=0.5 What am I missing about how T works? On Sunday, February 23, 2014 8:39:56 PM UTC-5, Massimo Di Pierro wrote: https://groups.google.com/forum/#!msg/web2py/ZxdTaSM1Fpk/hGryHgztlPQJ On Sunday, 23 February 2014 19:06:56 UTC-6, User wrote: I have some dates that I want to display in the proper culture specific format. I want a simple solution so what I want is rather than me having to specify the date format for every possible culture is to use the following default: dd-mm- and then specify a handful of exceptions, e.g. for United States: mm-dd- How can I achieve this in web2py where it's switched based on the Accept-Language header? -- 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/groups/opt_out.
[web2py] Re: Date display i18n internationalization?
This in layout.html. Viewing the rendered source in the browser the output is var dateFormat = dd mmm ; Putting T.force('en-us') at the end of models/models.py didn't not change anything. In fact, to take javascript out of the picture I just put a simple T statement in the footer of my layout.html: {{=T('this-is-a-test')}} And added an entry for it in en-us.py { '!langcode!': 'en-us', '!langname!': 'English (United States)', 'dd mmm ':'mmm dd, ', 'this-is-a-test': 'PASS' } The output remains: this-is-a-test I can easily insert an debug breakpoint: import ipdb; ipdb.set_trace() if that will help examine anything. On Monday, February 24, 2014 1:27:10 AM UTC-5, Massimo Di Pierro wrote: This should work. I do not think the problem is in T. Anyway, let's rule that out. Where is this, in a HTML file? When you look at the source file, is the string {{=T('dd mmm ')}}) translated? What if you add the following to your model? T.force('en-us') On Sunday, 23 February 2014 23:08:14 UTC-6, User wrote: Sorry I'm not following the relevance of that forum topic. What I'm trying to do for example is: I have a date in javascript in a view : var dateFormat = {{=T('dd mmm ')}}) Later on this will get expanded to for example 20 January 2014. This works and the date display as expected. For the US, I want the date displayed as January 20, 2014. So I created a en-us.py language file with the following content: { '!langcode!': 'en-us', '!langname!': 'English (United States)', 'dd mmm ':'mmm dd, ' } I restarted web2py. However, with my browser Accept-Language set to en-us I still see the date as 20 January 2014. My full firefox header is: Accept-Language en-us,en;q=0.5 What am I missing about how T works? On Sunday, February 23, 2014 8:39:56 PM UTC-5, Massimo Di Pierro wrote: https://groups.google.com/forum/#!msg/web2py/ZxdTaSM1Fpk/hGryHgztlPQJ On Sunday, 23 February 2014 19:06:56 UTC-6, User wrote: I have some dates that I want to display in the proper culture specific format. I want a simple solution so what I want is rather than me having to specify the date format for every possible culture is to use the following default: dd-mm- and then specify a handful of exceptions, e.g. for United States: mm-dd- How can I achieve this in web2py where it's switched based on the Accept-Language header? -- 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/groups/opt_out.
[web2py] CSS table width not limited as wished
Hello, The form I designed is not shown as I'd like it to be. I am using the web2py design (web2py.css, web2py_bootstrap.css, bootstrap_min.css,...). I'd like the elements of a row to be entirely seen on screen, without adding scrollbars which are automatically added by the web2py css design. The following code, once copied in a file, shows what I want. style type=text/css table { font-size: 12px; max-width:80%} td {font-weight:bold;vertical-align:top;} fieldset {width:25%; border: groove} /style form action=# enctype=multipart/form-data method=post table id=t1 tr tdfieldsetThis is a test for Field 1: input name=f1 type=text //fieldset/td tdfieldsetThis is a test for Field 2: input name=f2 type=text //fieldset/td tdfieldsetThis is a test for Field 3: input name=f3 type=text //fieldset/td tdfieldsetThis is a test for Field 4: input name=f4 type=text //fieldset/td tdfieldsetThis is a test for Field 3: input name=f5 type=text //fieldset/td /tr trOther rows withdrawn for simplicity /tr /table /form Using this style (added in my view which extends layout.html) gives no results. So I tried to modify layout.html by adding the style (line 60). This results in fonts and borders being correctly taken into account but not the width parameter which is precisely what I'd like to change (I don't want any scrollbars). Can anybody explain to me which line of which web2py css file I need to modify and how ? Additionally, why changing the css directly in the view is not taken into account ? Thanks you so much in advance for your help Dom -- 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/groups/opt_out.
[web2py] Re: Date display i18n internationalization?
Also I tried in web2py shell: str(T('this-is-a-test', language='en-us')) which returns: 'this-is-a-test' Not sure if this makes any sense calling from the shell but figured I try it. On Monday, February 24, 2014 2:02:25 AM UTC-5, User wrote: This in layout.html. Viewing the rendered source in the browser the output is var dateFormat = dd mmm ; Putting T.force('en-us') at the end of models/models.py didn't change anything. In fact, to take javascript out of the picture I just put a simple T statement in the footer of my layout.html: {{=T('this-is-a-test')}} And added an entry for it in en-us.py { '!langcode!': 'en-us', '!langname!': 'English (United States)', 'dd mmm ':'mmm dd, ', 'this-is-a-test': 'PASS' } The output remains: this-is-a-test I can easily insert an debug breakpoint: import ipdb; ipdb.set_trace() if that will help examine anything. On Monday, February 24, 2014 1:27:10 AM UTC-5, Massimo Di Pierro wrote: This should work. I do not think the problem is in T. Anyway, let's rule that out. Where is this, in a HTML file? When you look at the source file, is the string {{=T('dd mmm ')}}) translated? What if you add the following to your model? T.force('en-us') On Sunday, 23 February 2014 23:08:14 UTC-6, User wrote: Sorry I'm not following the relevance of that forum topic. What I'm trying to do for example is: I have a date in javascript in a view : var dateFormat = {{=T('dd mmm ')}}) Later on this will get expanded to for example 20 January 2014. This works and the date display as expected. For the US, I want the date displayed as January 20, 2014. So I created a en-us.py language file with the following content: { '!langcode!': 'en-us', '!langname!': 'English (United States)', 'dd mmm ':'mmm dd, ' } I restarted web2py. However, with my browser Accept-Language set to en-us I still see the date as 20 January 2014. My full firefox header is: Accept-Language en-us,en;q=0.5 What am I missing about how T works? On Sunday, February 23, 2014 8:39:56 PM UTC-5, Massimo Di Pierro wrote: https://groups.google.com/forum/#!msg/web2py/ZxdTaSM1Fpk/hGryHgztlPQJ On Sunday, 23 February 2014 19:06:56 UTC-6, User wrote: I have some dates that I want to display in the proper culture specific format. I want a simple solution so what I want is rather than me having to specify the date format for every possible culture is to use the following default: dd-mm- and then specify a handful of exceptions, e.g. for United States: mm-dd- How can I achieve this in web2py where it's switched based on the Accept-Language header? -- 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/groups/opt_out.
[web2py] Re: Date display i18n internationalization?
To clarify further, I made an entry in languages/es.py and when I set my browser preferred language to es I get the entry I put in the es.py file. So translation is working. However, when I set my browser to en-us it does not seem to pick up the entry in en-us.py file On Monday, February 24, 2014 2:13:04 AM UTC-5, User wrote: Also I tried in web2py shell: str(T('this-is-a-test', language='en-us')) which returns: 'this-is-a-test' Not sure if this makes any sense calling from the shell but figured I try it. On Monday, February 24, 2014 2:02:25 AM UTC-5, User wrote: This in layout.html. Viewing the rendered source in the browser the output is var dateFormat = dd mmm ; Putting T.force('en-us') at the end of models/models.py didn't change anything. In fact, to take javascript out of the picture I just put a simple T statement in the footer of my layout.html: {{=T('this-is-a-test')}} And added an entry for it in en-us.py { '!langcode!': 'en-us', '!langname!': 'English (United States)', 'dd mmm ':'mmm dd, ', 'this-is-a-test': 'PASS' } The output remains: this-is-a-test I can easily insert an debug breakpoint: import ipdb; ipdb.set_trace() if that will help examine anything. On Monday, February 24, 2014 1:27:10 AM UTC-5, Massimo Di Pierro wrote: This should work. I do not think the problem is in T. Anyway, let's rule that out. Where is this, in a HTML file? When you look at the source file, is the string {{=T('dd mmm ')}} ) translated? What if you add the following to your model? T.force('en-us') On Sunday, 23 February 2014 23:08:14 UTC-6, User wrote: Sorry I'm not following the relevance of that forum topic. What I'm trying to do for example is: I have a date in javascript in a view : var dateFormat = {{=T('dd mmm ')}}) Later on this will get expanded to for example 20 January 2014. This works and the date display as expected. For the US, I want the date displayed as January 20, 2014. So I created a en-us.py language file with the following content: { '!langcode!': 'en-us', '!langname!': 'English (United States)', 'dd mmm ':'mmm dd, ' } I restarted web2py. However, with my browser Accept-Language set to en-us I still see the date as 20 January 2014. My full firefox header is: Accept-Language en-us,en;q=0.5 What am I missing about how T works? On Sunday, February 23, 2014 8:39:56 PM UTC-5, Massimo Di Pierro wrote: https://groups.google.com/forum/#!msg/web2py/ZxdTaSM1Fpk/hGryHgztlPQJ On Sunday, 23 February 2014 19:06:56 UTC-6, User wrote: I have some dates that I want to display in the proper culture specific format. I want a simple solution so what I want is rather than me having to specify the date format for every possible culture is to use the following default: dd-mm- and then specify a handful of exceptions, e.g. for United States: mm-dd- How can I achieve this in web2py where it's switched based on the Accept-Language header? -- 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/groups/opt_out.
[web2py] REF: Issue with uploading files with web2py
I am extremely stuck on how to manage uploaded file, I have been working with web2py now for over a year and I like its flexibility, I have been working on an application that is ajax based using my own file. Now i have the following scenario i need help with: DB === db.create_table(person, Field(first_name), Field(photo, upload), ...) Controller: def manage_person(): try: value = db.person.update_or_insert(id == request.vars.id, first_name=request.vars.first_name, photo=request.vars.photo, ...) except ...: return value Now my question is how do i move the upaded image to say the upload folder, i was thinking web2py will put the physical image in upload folder according to documentation but unfortunately folder is empty. The DB hower gets updated with a the following: C:\fakepath\.jpg. Any ideas? Kind regards, -- ... Teddy Lubasi Nyambe Opensource Zambia Lusaka, ZAMBIA Cell: +260 97 7760473 website: http://www.opensource.org.zm ~/ Human Knowledge belongs to the world! - AntiTrust Man is a tool-using animal. Without tools he is nothing, with tools he is all - Thomas Carlyle 1795-1881 /~ -- 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/groups/opt_out.
[web2py] Re: Date display i18n internationalization?
In fact, it put an entry in en-gb.py and set my browser accept to en-gb it will correctly pick up this string, but for some reason it's not picking up the string in en-us (unless I'm doing something wrong). Also interesting to note, is when I view in en-gb or es, web2py seems to automatically modify those files with default entries for every default string, whereas it's not doing that for en-us.py Does this have to with en-us.py being a default or something? -- 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/groups/opt_out.