[web2py] Re: Error on fresh startup

2014-05-06 Thread Niphlod
what python version are they running ? On Tuesday, May 6, 2014 12:34:01 AM UTC+2, Kurt Jensen wrote: > > Getting error on start-up of fresh install on Fused.com hosting service > account : > > Traceback (most recent call last): > File "web2py.py", line 18, in ? > import gluon.widget > Fil

[web2py] Re: "Admin is disabled because insecure channel" error Hosting web2py app on Amazon EC2 Linux server

2014-05-06 Thread Martin Lohner
...yes, yes ...ONLY for testing or for "remote" development...(my case) ..but it is possible (for example) to link to a specific IP address for a long term solution ... . Yes, but it's not "bullet-proof" solution ... ml Dne pondělí, 5. května 2014 21:54:28 UTC+2 Dave S napsal(a): > > This shoul

Re: [web2py] how to get all records from sqlform.grid

2014-05-06 Thread Ariya Owam-aram
Dear Johann, Thanks for your sharing. Now I try to use smart_query() function by using keyword from SQLFORM.grid (request.vars.keyword) and return to row. :) เมื่อ วันพุธที่ 30 เมษายน ค.ศ. 2014, 13 นาฬิกา 54 นาที 20 วินาที UTC+7, Johann Spies เขียนว่า: > > On 25 April 2014 00:05, Ariya Owam-ar

Re: [web2py] Pluralization and styles

2014-05-06 Thread Louis Amon
I made a slight modification (**%s** instead of *%s*) and then it worked ! Thanks On Wednesday, April 30, 2014 6:28:40 PM UTC+2, dbdeveloper wrote: > > you can try to use markmin in T for styling. You need to write: > > T.M('*%s* %%{result} %%{found}', symbols=num_offers) > > > 29.04.14 21:28, L

[web2py] Re: Translate inside javascript function with javascript variable

2014-05-06 Thread lula bad
Am Dienstag, 6. Mai 2014 02:48:29 UTC+2 schrieb Anthony: > > var set_info_text = function (txt) { >> $('#info_text').innerHTML = '{{=T(txt)}}'; >> }; >> >> Keep in mind that the web2py template syntax is Python that gets executed > on the sever in order to generate the HTML page.

[web2py] report with a pdflatex template

2014-05-06 Thread Peter Pan
Hi, it is possible to implement a pdflatex template in web2py to generate a pdf-report? tanks for help Peter -- 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 Issue

[web2py] Re: Domain Masking and Internet Explorer

2014-05-06 Thread Vlad K
Hi Anthony, Thanks for your active participation in this group. I am confused about pointing the DNS to another server, which you advise to do: the target URL, where I'm currently forwarding the mask domain (which fails in IE), is a third party site for which I do not know IP address. What woul

[web2py] db.bookings.start_date.default = ('%s-%s-%s') % (start_day, start_month, start_year)

2014-05-06 Thread Stefan van den Eertwegh
Hi all, I have the following code: db.bookings.start_date.default = "%s-%s-%s" % (start_day, start_month, start_year) The problem is that when i uncomment this line above, i get the following error: 'str' object has no attribute 'year' This is de database model: Field('start_date', 'date', de

[web2py] SQL Forms Redirect

2014-05-06 Thread Mark Billion
I have an SQLFORM that accepts certain user data, and then needs to update the record that was just created. My command reads: form = SQLFORM(db.album).process(next=URL('album', args=[request.args(0,cast=int), *myform.vars.id*])) Both myform.vars.id and form.vars.id fail when included a

[web2py] Re: web2py report pdflatex template

2014-05-06 Thread Massimo Di Pierro
Look into this file: https://github.com/web2py/web2py/blob/master/gluon/contrib/markmin/markmin2pdf.py there is a function markmin2pdf that uses markmin2latex and then calls pdflatex. Only a subset of markmin is supported. Formulas go in between $$...$$ in markmin. Massimo On Monday, 5 May 2

[web2py] Re: Translate inside javascript function with javascript variable

2014-05-06 Thread Massimo Di Pierro
var msg1 = {{T('message one')}} should probably be: var msg1 = "{{=T('message one')}}"; On Tuesday, 6 May 2014 00:47:18 UTC-5, lula bad wrote: > > > > Am Dienstag, 6. Mai 2014 02:48:29 UTC+2 schrieb Anthony: >> >> var set_info_text = function (txt) { >>> $('#info_text').innerHTML = '

[web2py] Re: Custom Form Widget Question

2014-05-06 Thread Mark Billion
Great idea. I did that and it works perfectly! On Monday, May 5, 2014 4:00:59 PM UTC-4, Jim S wrote: > > Maybe a dropdown isn't the right control for this situation. Have you > considered an autocomplete widget? How many rows are in your dropdown? > > -Jim > > > On Saturday, May 3, 2014 3:13:4

[web2py] Re: "Admin is disabled because insecure channel" error Hosting web2py app on Amazon EC2 Linux server

2014-05-06 Thread Massimo Di Pierro
yes. you can edit admin/model/access.py and replace this: f request.env.http_x_forwarded_for or request.is_https: session.secure() elif not request.is_local and not DEMO_MODE: raise HTTP(200, T('Admin is disabled because insecure channel')) with: f request.env.http_x_forwarded_for or req

Re: [web2py] string:list truncated all of my values!! PLEASE HELP

2014-05-06 Thread Richard Vézina
Yes Derek that the way to go! I have a different implementation with multiple form and kind of in row create/update and no ajax, it is fully web2py form principle... Richard On Mon, May 5, 2014 at 5:17 PM, Derek wrote: > This may be too late, but in any case, you may want to take a look at my

Re: [web2py] string:list truncated all of my values!! PLEASE HELP

2014-05-06 Thread Richard Vézina
Hey Anthony, I listen your presentation yesterday, it was really nice. Thanks for all the tricks! :) Richard On Mon, May 5, 2014 at 4:36 PM, Anthony wrote: > Internally, when you store a list of items in a list:string field, web2py > converts the list to a single string, with list items sepa

[web2py] Re: db.bookings.start_date.default = ('%s-%s-%s') % (start_day, start_month, start_year)

2014-05-06 Thread Kyle Flanagan
Try the following: import datetime db.bookings.start_date.default = datetime.date(start_year, start_month,start_day ) Since start_date is the 'date' datatype, it's expecting a python datetime object. On Tuesday, May 6, 2014 4:22:46 AM UTC-5, Stefan van den Eertwegh wrote: > > Hi all, > > I hav

Re: [web2py] string:list truncated all of my values!! PLEASE HELP

2014-05-06 Thread Anthony
On Tuesday, May 6, 2014 9:36:54 AM UTC-4, Richard wrote: > > Hey Anthony, > > I listen your presentation yesterday, it was really nice. Thanks for all > the tricks! > > :) > > Richard > > Thank you. Glad it was helpful. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Docume

[web2py] Re: links to specific records in table

2014-05-06 Thread Kyle Flanagan
It's normally a good idea to construct your SQLTABLE in your controller and then pass it to your view, e.g.: default.py def index(): query = db().select() table = SQLTABLE(query,headers='fieldname:capitalize', linkto= 'table_manage') default/index.html {{extend 'layout.html'}} {{=tab

[web2py] Re: SQL Forms Redirect

2014-05-06 Thread Anthony
If you want to include the id in the query string (i.e., ?id=1), then you have to use the "vars" argument to URL() and give it a dictionary: URL('album', args=[request.args(0,cast=int), vars=dict(id=myform.vars.id)]) Anthony On Tuesday, May 6, 2014 9:13:55 AM UTC-4, Mark Billion wrote: > I hav

[web2py] Re: SQL Forms Redirect

2014-05-06 Thread Mark Billion
When I put that in, I get " global name 'myform' is not defined"...thoughts? On Tuesday, May 6, 2014 10:01:13 AM UTC-4, Anthony wrote: > > If you want to include the id in the query string (i.e., ?id=1), then you > have to use the "vars" argument to URL() and give it a dictionary: > > URL('album

[web2py] Re: SQL Forms Redirect

2014-05-06 Thread Anthony
Well, I suppose there is no myform object. If you want to pass the id of the record that was inserted by *this* form, you can do: URL('album', args=request.args(0,cast=int), vars=dict(id='[id]')) You can pass any variable from the form in the "next" URL that way. It will automatically replace

[web2py] Re: report with a pdflatex template

2014-05-06 Thread Massimo Di Pierro
answered here: https://groups.google.com/forum/#!topic/web2py/ufy1_Sy6tsI On Tuesday, 6 May 2014 07:36:22 UTC-5, Peter Pan wrote: > > Hi, > > it is possible to implement a pdflatex template in web2py to generate a > pdf-report? > > tanks for help > > Peter > > > -- Resources: - http://web2py.co

[web2py] routes_onerror doesn't redirect to a custom controller when an "invalid request" error is produced

2014-05-06 Thread Carlos Fillol Sendra
Imagine that I have an application called 'myapp' running in my local web2py server, and I include this in routes.py to manage HTTP errors using a custom controller (/myapp/portal/error_page): routes_onerror = [ ('myapp/*', '/myapp/portal/error_page'), ] Then, when somebody access to myap

[web2py] Re: Upload image using RESTful api

2014-05-06 Thread iw3ijq
Thaks, I will try. I don't think that the iproblem is the request. Using a socket sniffer I saw that request made by browser and my script are the same. The problem could be in restful api. Il giorno martedì 6 maggio 2014 00:33:00 UTC+2, samuel bonill ha scritto: > > i use postman(http://www.get

[web2py] Re: google analytics

2014-05-06 Thread lucas
if we are using the analytics.min.js one, do we include the "UA-" in the response.google_analytics_id string variable under menu.py? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issue

Re: [web2py] SQLFORM.grid search with custom request.vars

2014-05-06 Thread Paolo Valleri
If I change the search form action to POST the whole url is preserved, and the keywords variable is passed as request payload. However the search doesn't work, I guest I have to change sqlform.grid in order to allows vars as post_vars, is there a specific reason for having the search action as GET?

[web2py] Re: routes_onerror doesn't redirect to a custom controller when an "invalid request" error is produced

2014-05-06 Thread Anthony
+1 On Tuesday, May 6, 2014 10:20:53 AM UTC-4, Carlos Fillol Sendra wrote: > > > Imagine that I have an application called 'myapp' running in my local > web2py server, and I include this in routes.py to manage HTTP errors using > a custom controller (/myapp/portal/error_page): > > routes_onerror

Re: [web2py] SQLFORM.grid search with custom request.vars

2014-05-06 Thread Anthony
On Tuesday, May 6, 2014 11:49:06 AM UTC-4, Paolo Valleri wrote: > > If I change the search form action to POST the whole url is preserved, and > the keywords variable is passed as request payload. However the search > doesn't work, I guest I have to change sqlform.grid in order to allows vars >

[web2py] Re: Web2Py Pages module (basic CMS)

2014-05-06 Thread Rene Dohmen
Hi Villas, page is a restricted word in postgres and some other DB's I think. We started development in web2py 1.99.1 with sqlite. it's a valid sqlite tableName. The problem for us is that we can't rename it very easing without breaking a lot of apps. The problem that we had with building a web2

[web2py] Re: SQLFORM.grid search with custom request.vars

2014-05-06 Thread Anthony
I think when the browser makes the request, it strips any existing query string from the form action and replaces it with a query string containing the form data. A workaround would be to include hidden fields in the form that contain the original query string variables. This could be done in th

[web2py] What is a clear procedure to style web2py css files using Bootstrap theme generators/choosers?

2014-05-06 Thread JoeCodeswell
Dear web2py Community, What is a clear procedure [*dare i hope for a python script??*] to style web2py css files using Bootstrap theme generators/choosers, like bootswatch.com or stylebootstrap.info? My motivation is merely to change the background-color of my navbar. I am running 2.9.5-stabl

[web2py] Re: Web2Py Pages module (basic CMS)

2014-05-06 Thread villas
I cannot look at it this week, but many thanks for updating me. On Tuesday, 6 May 2014 18:24:15 UTC+1, Rene Dohmen wrote: > > Hi Villas, > > page is a restricted word in postgres and some other DB's I think. We > started development in web2py 1.99.1 with sqlite. > it's a valid sqlite tableNam

[web2py] Re: Pages that only their author can view

2014-05-06 Thread villas
Hi Sidney, Try looking at 'common_filter'. This often works well for me. On Sunday, 4 May 2014 10:28:57 UTC+1, Sidney Rubidge wrote: > > I am trying to create a site where users can create pages. The user has a > "wall" which lists all the pages that they have created. They can then view >

[web2py] db query with join and left join final SQL not respect the order of the joins declaration

2014-05-06 Thread Richard
Hello, I just struggle more than I would with this : db(...).select(..., left=[left1, left2, ...], join=join) I would expect that the JOIN be after the LEFT JOINS in SQL generated, since one of my left

Re: [web2py] Re: Hide actions in navbar

2014-05-06 Thread Carlos Correia
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Em 06-05-2014 03:31, Anthony escreveu: > I don't object to the patch (maybe submit it as a pull request on Github), but > in the meantime, you can do: > > | > navbar =auth.navbar() > delnavbar[2:4] > | > > Or do: > > | > navbar_dict =auth.navbar(mod

[web2py] Re: How to redirect an error ticket response to the current url

2014-05-06 Thread aleonserra
Ok i finally got it. If you want to bypass the ticket system and display the errors directly on the page you are working on, follow these steps: 1.-Install mechanize which it is a library that automates webforms. 2- Redirect the errors to a custom c

[web2py] Re: Removing all tables filter_out. before_inset and before_update works?

2014-05-06 Thread Diogo Munaro
No answer? Em quarta-feira, 30 de abril de 2014 11h03min48s UTC-3, Diogo Munaro escreveu: > > Hey guys! Nowadays I'm using a some filter_outs but they got update and > insert erros on record versioning. > > I'm solving update issue using before_update like this: > > def remove_filter(s,field

[web2py] Re: Using Date Fields in Compute Field Causes Error on CSV Upload

2014-05-06 Thread Kyle Flanagan
I've found the issue. The function import_from_csv_file in dal.py calls a fix() function which reads the columns of the file and parses the data and gives each value a datatype according to the database table's field data type. Unfortunately, for any 'date' type, it just passes through this fix(

[web2py] Storing Files on the Filesystem

2014-05-06 Thread Kyle Flanagan
Is there an appropriate web2py way to write to the filesystem? My ultimate goal is to have a custom export class for SQLFORM.grid which will allow the user to download a CSV of the data, but also store a copy of that CSV file on the file system for use by other applications on the same web ser

[web2py] Here's how to run Web2Py on IBM BlueMix

2014-05-06 Thread duncan macneil
Hi all, I've been trying out the www.bluemix.net IBM PaaS. It took me a bit of digging to realise there is in fact a Python runtime. But you need a buildpack. The setup is different enough from Heroku to warrant this mini-HowTo: Step 1: Use the source version of Web2Py and copy the entire lo

[web2py] Is this a bug with the datetime widget error with timezone representation?

2014-05-06 Thread Michael Beller
While updating my app to handle timezones, I came across a problem with the datetime widget. Model: db.define_table('sometable', Field('appointment', 'datetime'), auth.signature) Controller Action: def index(): grid = SQLFORM.grid(db.sometable, user_signature=False) return dict(g

[web2py] Timezone handling

2014-05-06 Thread Michael Beller
I found many discussions in the forums on handling timezones. Most paths lead to Niphlod's timezone plugin (thank you!). But most of the comments and documentation surrounding that plugin didn't address standardizing on UTC throughout the app, enabling timezone handling for auth.signatures, an

[web2py] Re: Removing all tables filter_out. before_inset and before_update works?

2014-05-06 Thread Anthony
You're already looping over the tables when you define your functions, so just use the table value from the loop in your lambda function definitions. Not tested, but maybe something like: def remove_filters(table): for field in table: field.filter_out = None for t in db.tables: