[web2py] Re: Bootstrap 3 custom checkbox widget

2014-01-24 Thread Annet
Hi Paolo, Thanks for your reply. What about > > return DIV(TAG[''](*opts, **attr), _class="checkbox") > > Yes, that solves the problem. I now have both a radio and check boxes widget the Bootstrap 3 way. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Docume

[web2py] Re: Css cache problem

2014-01-24 Thread Alex
cool, I didn't know about response.static_version. Currently I'm manually doing the versioning (renaming css file and adapting filename in response.files.append). Is it possible to apply response.static_version to specific css files? most of my css files never change and I don't want the brow

[web2py] routes does not working and there is nor file call routes.py in web2py folder (web2py/)!

2014-01-24 Thread Laxmikant Metri
Hi, I created form application in web2py I wanted to make it as default. but I renamed routes.example.py in form folder into routes.py and done chages like this routers = { app: dict( default_language = possible_languages['default'][0], languages = [lang for lang in possi

[web2py] Re: How to change SQLFORM values after submission and then show the form again?

2014-01-24 Thread Horst Horst
Thanks, Anthony, that worked. In fact, I do need to run my validators: The translated form data is actually JSON which is fed into the translation algo of my server-side backend code. Feeding it without my custom validator could be an unlikely, but possible security hole. But I can run my valid

[web2py] Re: forgot password not working anymore

2014-01-24 Thread Bastiaan van der Veen
Op donderdag 23 januari 2014 22:29:04 UTC+1 schreef pa...@cancamusa.net: > > If there's no error message it may be something different. Please copy the > error trace, and tell us your web2py version number. > > El jueves, 23 de enero de 2014 16:09:44 UTC+1, Bastiaan van der Veen > escribió: >>

Re: [web2py] A correction needed in the web2py book

2014-01-24 Thread Tim Richardson
The book has instructions on how to make pull requests that will commit easily; it's in the chapter "helping web2py." The instructions relate to making changes to web2py but you should be able to apply the guidance to the book as well. -- Resources: - http://web2py.com - http://web2py.com/bo

[web2py] Adding a second page to pypdf Template

2014-01-24 Thread Ruud Schroen
Hi, I'm building a pdf using Template from pyfpdf. Whenever i try to add a second page like this: f = Template(format="A4", > > elements = elements, > > title="Sample Invoice", author="Sample Company", > > subject="Sample Customer", keywords="Electronic TAX

[web2py] Re: questions about using xml files in web2py

2014-01-24 Thread greaneym
I found what I needed by reading more about requests, http://docs.python-requests.org/en/latest/index.html and this reading this link, http://stackoverflow.com/questions/2667509/curl-alternative-in-python and by reading more about StringIO. On Saturday, January 11, 2014 4:24:32 PM UTC-6, grean

[web2py] Re: Css cache problem

2014-01-24 Thread Alex
cool, I didn't know about this feature! Currently I'm manually versioning my css files (renaming files). Is it possible to version only specific css files? Usually I'm only changing one or two files and I don't want all users to refetch all css files everytime I change one css file. regards, A

Re: [web2py] routes does not working and there is nor file call routes.py in web2py folder (web2py/)!

2014-01-24 Thread Jonathan Lundell
On 24 Jan 2014, at 12:28 AM, Laxmikant Metri wrote: > I created form application in web2py I wanted to make it as default. but > I renamed routes.example.py in form folder into routes.py and done chages > like this > routers = { > app: dict( > default_language = possible_languag

[web2py] Re: routes does not working and there is nor file call routes.py in web2py folder (web2py/)!

2014-01-24 Thread Alex
Hi, I guess it's not possible to set the default application in the settings for a specific application. You should set it for BASE as shown in the documentation example routers = dict( BASE = dict(default_application='form'), ) Alex Am Freitag, 24. Januar 2014 09:28:43 UTC+1 schrieb Laxmik

Re: [web2py] routes does not working and there is nor file call routes.py in web2py folder (web2py/)!

2014-01-24 Thread Anthony
Also, be mindful of the difference in syntax when creating dictionaries via {} vs. dict(). Should be either: routers = { "BASE": dict( default_application='form', ), "form": dict( default_language = possible_languages['default'][0], languages = [lang for

[web2py] Re: Css cache problem

2014-01-24 Thread LightDot
I saw your original message Don't know why it disappeared, though! I remember there were other similar reports (very seldom, mind you) a while ago, of messages disappearing or not even being posted to the group. I had this happen to me once, perhaps a year ago or so. AFAIK, just a glitch in

[web2py] Re: Web2py License

2014-01-24 Thread Massimo Di Pierro
We have been very careful. Every piece is LGPL or compatible and more liberal. Everything in web2py/gluon is LGPL and written by us. Code in web2py/gluon/contrib/ comes from third parties and we have been careful to include code that is LGPL or more liberal (BSD, MIT, etc.). Each module has it

[web2py] Re: Compare database date with user input

2014-01-24 Thread Dave S
On Monday, January 20, 2014 1:42:58 AM UTC-8, Rohitraj Sharma wrote: > > Hi Web2py Users, > > > *In drop down, I have some values like Due today , Due Tomorrow , This > Year, This Month. When user will select any option from the drop down. I > want to fetch the data from the table according to

[web2py] Re: Importing Data / Force Record ID #s To Remain As Specified in the CSV

2014-01-24 Thread Massimo Di Pierro
Interesting. This is missing from the book. db.export_to_csv_file(open('dump.csv','w')) then later db.import_from_csv_file(open('dump.csv'), map = {}) The map will fix all references from imported data. Works for individual data to but you have to pass the same same dict ({}) to the different

[web2py] SELECT multiple default values

2014-01-24 Thread Johnny
Hi, i believe, i've found a bug.. I've upgraded to 2.8.2-stable and have found out, that when i edit record using SQLFORM the column with multiple widget doesn't update to default values, it is just blank. Here is an example: SELECT('yes', 'no', _name='selector', _multiple= True, value='|no|'

[web2py] Displaying computed data from form submission

2014-01-24 Thread Chris Hepworth
I have played with doing this several different ways, but to no avail. Currently I have a function: def qrret(): rows = db().select(db.geo_item.f_name,db.geo_item.f_qrcode, orderby=db. geo_item.f_name) rows2 = db().select(db.geo_collection.f_name, db.geo_collection.f_qrcode , orderby=db.

[web2py] Re: Css cache problem

2014-01-24 Thread Alex
to answer my own question: for versioning specific files and not all css files I added the version text directly in the url: instead of response.files.append(URL('static','css/base.css')) I now write response.files.append(URL('static','_1.1.1/css/base.css')) this seems to work fine. Alex Am Fre

[web2py] Re: Displaying computed data from form submission

2014-01-24 Thread Jaime Sempere
You are not storing the images. When you do : form=FORM(fields, onvalidation=qrparse) Did you guessed qrparse return values are being stored in form or somewhere? You need to store in a cookie, global variable, or maybe in the form (I don't know where you want to show the images). Could y

[web2py] Re: SELECT multiple default values

2014-01-24 Thread Tim Richardson
Could you open a ticket about this? http://web2py.com/books/default/chapter/29/15/helping-web2py#Filing-a-bug-report-via-Google-Code On Saturday, 25 January 2014 03:59:44 UTC+11, Johnny wrote: > > Hi, > > i believe, i've found a bug.. I've upgraded to 2.8.2-stable and have found > out, that when

[web2py] Re: Displaying computed data from form submission

2014-01-24 Thread Chris Hepworth
I feel ridiculous admitting this, but I didn't realize I had omitted the code saving them into the global variables. The result set doesn't need to be persistent, so storing it to the database would be unnecessary. It will only be displayed to the user once. On Friday, January 24, 2014 1:38:01

[web2py] Re: SELECT multiple default values

2014-01-24 Thread Anthony
You mention SQLFORM but then show code for the SELECT helper. Can you show the exact SQLFORM code you are using, along with the DAL model? Note, with multiple select, you should set multiple=True in the IS_IN_SET validator as well. Anthony On Friday, January 24, 2014 11:59:44 AM UTC-5, Johnny

[web2py] is this the best way of LOAD reloading component's parent (generically)?

2014-01-24 Thread Tim Richardson
I have a form I want to use on a number of controller function views, so I have used LOAD. I want this form to reload its parent page. I still want to keep it modular, so hard-coding the parent URL in the LOADed controller function is not useful. I have done this: {{=LOAD('default','choose_saa

Re: [web2py] is this the best way of LOAD reloading component's parent (generically)?

2014-01-24 Thread Richard Vézina
Nice approach! Seems reliable enough... Richard On Fri, Jan 24, 2014 at 4:55 PM, Tim Richardson wrote: > I have a form I want to use on a number of controller function views, so I > have used LOAD. > I want this form to reload its parent page. > I still want to keep it modular, so hard-coding

[web2py] Variables from url

2014-01-24 Thread Lucas Schreiber
Hi, I have a question: For example, somebody opens this page: .../profile/1 Now, in the def profile(): there shall be a variable: a=1 Or, when this page gets opened: .../profile/12345 I wish this variable: a=12345 Is it possible to do this in web2py? Can you explain me how? -- Resources: -

[web2py] Re: Multiple one-to-many join query help.

2014-01-24 Thread Apple Mason
Is there a way to get all the information returned as one row, with the focus on a particular person? For example, ... Or something similar? This would give me a single row that I can iterate through his things or pets if I need to. For example, to print out people's information: for pe

[web2py] Warning about using web2py URL rewrite?

2014-01-24 Thread User
http://www.web2py.com/AlterEgo/default/show/42 says: "web2py supports URL rerwite although this is not really recommended. You should really use Apache (or lighttpd) + mod_proxy (or mod_rewrite) for this purpose. Moreover rewriting web2py urls can break links in applications. So *do not do

[web2py] Re: Adding a second page to pypdf Template

2014-01-24 Thread Alan Etkin
> > Whenever i try to add a second page like this: > > I get this error: > > (FPDF error: Unsupported image type: ) > > Can you post the traceback if any? Try adding a blank cell before the second add_page call. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:

[web2py] Re: Variables from url

2014-01-24 Thread Alan Etkin
> Hi, > I have a question: > > For example, somebody opens this page: > .../profile/1 > > Now, in the def profile(): there shall be a variable: > > a=1 > > Or, when this page gets opened: > .../profile/12345 > > I wish this variable: > a=12345 > This is discussed in detail in the web2py book: ht

[web2py] Re: Warning about using web2py URL rewrite?

2014-01-24 Thread Jaime Sempere
That link is outdated, check this: http://web2py.com/books/default/chapter/29/04/the-core#URL-rewrite And for www.example.com/someapp/default/index to www.example.com/ you only need to do: routers = dict( BASE = dict(default_application='someapp'), ) -- Resources: - http://web2py.com - h

[web2py] Re: simplejson and datetime

2014-01-24 Thread Alan Etkin
> What I am interested in doing, is have it turned back into a datetime > object when 'decoding' - and THAT is not supported even in the web2py > flavor - and I haven't found a single simple solution for it on the web for > the standard simplejson either. > It seems the only way of decoding i

[web2py] Re: Multiple one-to-many join query help.

2014-01-24 Thread Anthony
When you do a join, the DAL returns rows the same way the SQL database returns them. Sounds like you're looking for more of a nested structure, which would have to be created in Python. web2py doesn't do that out of the box with joins, but you can get similar functionality using recursive selec

[web2py] issue with external cron

2014-01-24 Thread Alex
Hello, I've got a big issue with external cron jobs. In my application I've added tasks to crontab which should be executed every day, e.g. 0 0 * * * myapp *applications/myapp/cron/task_update_vacation_days.py 30 0 * * * myapp *applications/myapp/cron/task_insert_public_holidays.py

[web2py] Re: is this the best way of LOAD reloading component's parent (generically)?

2014-01-24 Thread Anthony
Something like this might work as well: if form.process().accepted: response.js = 'location.reload(true);' return 'Success' # this shouldn't matter, as it won't get displayed That is like hitting the browser refresh, so would attempt to re-post any post data, but I don't think that woul

[web2py] Re: Displaying computed data from form submission

2014-01-24 Thread Jaime Sempere
I still don't see where are you storing them or where you would like to show them... Where should appear them? In the form? El viernes, 24 de enero de 2014 21:53:31 UTC+1, Chris Hepworth escribió: > > I feel ridiculous admitting this, but I didn't realize I had omitted the > code saving them int

Re: [web2py] issue with external cron

2014-01-24 Thread Jonathan Lundell
On 24 Jan 2014, at 3:38 PM, Alex wrote: > I've got a big issue with external cron jobs. In my application I've added > tasks to crontab which should be executed every day, e.g. > 0 0 * * * myapp *applications/myapp/cron/task_update_vacation_days.py > 30 0 * * * myapp *applications/myap

Re: [web2py] issue with external cron

2014-01-24 Thread Alex
could you give more details? why do you start it that way, did you experience any problems with external cron? how does the command for the system cron exactly look like? does it have any disadvantages to external cron? any ideas how I could track down those issues? thanks On Saturday, Januar

[web2py] Re: is this the best way of LOAD reloading component's parent (generically)?

2014-01-24 Thread Tim Richardson
I've just found this in the book: request.env.http_web2py_component_location has the parent URL in this situation > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repo

[web2py] Re: is this the best way of LOAD reloading component's parent (generically)?

2014-01-24 Thread Anthony
So, I think using that will be equivalent to the response.js = 'location.href = location.href;' method. The http_web2py_component_location header is simply extracted from document.location in the browser and sent to the server. Then redirect(..., client_side=True) will simply end up setting win

[web2py] SQLFORM.grid ondelete not working

2014-01-24 Thread horridohobbyist
I'm using Version 2.4.2. I'm finding that the ondelete function is never called when I delete a record in SQLFORM.grid. Is this a bug, or am I doing something wrong? The onupdate function does get called when I update a record. Thanks. -- Resources: - http://web2py.com - http://web2py.com/boo

[web2py] web2py slices plugins: thumbnail images

2014-01-24 Thread Tim Richardson
I just took a screen-shot of the fairly new Download Plugins functionality of the Admin app (integrated browsing of the web2pyslices repository and one-click plugin install). The screen shot is part of PR to enhance the book by referring to this. Too bad that many of the growing collection of plu

[web2py] Re: is this the best way of LOAD reloading component's parent (generically)?

2014-01-24 Thread Tim Richardson
The book gave an example of LOAD redirect after submission, with keyword argument type like so: redirect(url,type='auto') I've couldn't find type='auto' in the redirect documentation, and a quick look at the code wasn't enlightening. Anyway, I've replaced that section with a solution based on

[web2py] Re: is this the best way of LOAD reloading component's parent (generically)?

2014-01-24 Thread Tim Richardson
oh, and my book PR also makes response.js a bit more discoverable. -- 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

[web2py] Unable to acces admin app in production

2014-01-24 Thread Julien Courteau
After I tried to upgrade to version 2.8.2-stable 2013.11.23 13.54.07 from the admin application (the upgrade button), I no longer have access to the admin app: the ticket produced refer to an "import error" concerning gluon.tools.Config from the admin/default.py controller. I tried to upgrade "ma

Re: [web2py] issue with external cron

2014-01-24 Thread Jonathan Lundell
On 24 Jan 2014, at 4:05 PM, Alex wrote: > could you give more details? why do you start it that way, did you experience > any problems with external cron? how does the command for the system cron > exactly look like? does it have any disadvantages to external cron? > > any ideas how I could tra

Re: [web2py] issue with external cron

2014-01-24 Thread Jonathan Lundell
On 24 Jan 2014, at 6:54 PM, Jonathan Lundell wrote: > On 24 Jan 2014, at 4:05 PM, Alex wrote: >> could you give more details? why do you start it that way, did you >> experience any problems with external cron? how does the command for the >> system cron exactly look like? does it have any disa

[web2py] Re: patch for web2py socket timeout

2014-01-24 Thread Dave
I believe I'm having the same issue as described above. Users have slow internet connections, and when they upload files it is causing web2py to lock up completely (can't access any sites or the admin interface). Sometimes it will eventually respond other times I have to restart apache. I'm r

[web2py] URL-based languages for pattern-based routing?

2014-01-24 Thread User
I'm using pattern-based routing to meet some of my routing needs. How can I support URL-based languages (as described in http://www.web2py.com/book/default/chapter/04#Parameter-based-system) but with the pattern-based routing? -- Resources: - http://web2py.com - http://web2py.com/book (Docume

[web2py] Re: is this the best way of LOAD reloading component's parent (generically)?

2014-01-24 Thread Anthony
I believe type='auto' was just a precursor to what eventually turned into client_side=True. Anthony On Friday, January 24, 2014 8:36:44 PM UTC-5, Tim Richardson wrote: > > The book gave an example of LOAD redirect after submission, with keyword > argument type like so: > > redirect(url,type='au

[web2py] Re: SQLFORM.grid ondelete not working

2014-01-24 Thread Anthony
Does the record actually get deleted from the database? If so, ondelete should be getting called right before the delete. You may need to show some code and explain what you're seeing and what you expect. Also, note that the ondelete code in .grid has changed in more recent versions, but should