[web2py] Re: Best practice for a development environment together with a live environment

2014-02-12 Thread 黄祥
hi carlos, in production and staging environment, which is passed the development and testing stage, pushed the web2py application folder to the path and set ownership and permission using puppet. for development and testing not using puppet, because it is use by developer and system analyst

[web2py] SQLCustomType bug with grids?

2014-02-12 Thread mcamel
Hi everybody, I've tried to use SQLCustomType with grids but always get this error (2.8.2 version): type 'exceptions.AttributeError' 'SQLCustomType' object has no attribute 'endswith' It works fine with SQLTABLE (as exposed below) but not with 'grid' neither 'smartgrid'. It also fails with

[web2py] Re: pre-populate form using selected record in SQLFORM.grid

2014-02-12 Thread John Philip
Hi Jim, thanks for you reply. Sorry I guess I should be more specific. I have a SQLGRID form (displaying contents of table db.nextpasses) , In the SQLFORM.grid I have inserted a button called addpass so for every record in the SQLgrid I have a button addpass. When clicking addpass another form

Re: [web2py] Re: pre-populate form using selected record in SQLFORM.grid

2014-02-12 Thread Jim Steil
So, with this statement: addpass = [lambda project: A('add pass', _class=btn, _href=URL(default,addpass))] You're creating a link to an entirely different controller, right? If that is correct then I would pass the parameters for that 'project' as vars on the URL command as such: addpass =

Re: [web2py] Re: pre-populate form using selected record in SQLFORM.grid

2014-02-12 Thread Anthony
Do you want to actually update the record in question, or simply insert a completely new record that is prepopulated with the values from this record? If the former, then just pass the record ID in the URL and pass that ID to SQLFORM in order to create an update form. Anthony On Wednesday,

Re: [web2py] Re: IS_IN_DB validator dropdown formatting

2014-02-12 Thread Anthony
{{=XML(customerList)}} On Tuesday, February 11, 2014 12:52:28 PM UTC-5, Jim S wrote: Thanks Anthony. Trying this but running into a problem generating the json to use for the data. Keep getting a javascript error: SyntaxError: invalid property id data: [{quot;textquot;: quot;Skygsslo

Re: [web2py] Re: IS_IN_DB validator dropdown formatting

2014-02-12 Thread Jim Steil
I've since abandoned working with ddslick for this function. Decided just to go low tech and put the data into a single line in the IS_IN_DB dropdown. I couldn't find a control that worked the way I'd had it working in my previous TurboGears app utilizing dojo. I really like the ddslick widget

Re: [web2py] datetime column with milliseconds precision

2014-02-12 Thread Manuele Pesenti
Il 10/02/14 12:06, Alex ha scritto: Is it possible to update a datetime column with milliseconds precision? e.g. I have a field Field('invoice_date', 'datetime') and I'm updating the field: now = datetime.datetime.now() db(db.invoice.id == 743).update(invoice_date=now) the currren time

Re: [web2py] datetime column with milliseconds precision

2014-02-12 Thread Alex
IS_DATETIME validator doesn't change anything. I doubt that validators are used by the DAL. I guess I have to use native sql to set milliseconds? Alex On Wednesday, February 12, 2014 3:56:41 PM UTC+1, Manuele wrote: Il 10/02/14 12:06, Alex ha scritto: Is it possible to update a datetime

Re: [web2py] Re: IS_IN_DB validator dropdown formatting

2014-02-12 Thread Anthony
Note, there are many alternatives to ddslick -- that's just one I found with a quick search. On Wednesday, February 12, 2014 9:45:40 AM UTC-5, Jim S wrote: I've since abandoned working with ddslick for this function. Decided just to go low tech and put the data into a single line in the

[web2py] Re: SQLCustomType bug with grids?

2014-02-12 Thread Anthony
Looks like a bug (SQLCustomType actually has a startswith method, but we should add an endswith method as well). Anthony On Wednesday, February 12, 2014 3:56:53 AM UTC-5, mcamel wrote: Hi everybody, I've tried to use SQLCustomType with grids but always get this error (2.8.2 version):

Re: [web2py] Re: IS_IN_DB validator dropdown formatting

2014-02-12 Thread Jim S
Yes, I looked at many others as well. But, the requirement didn't deserve that much of my time on this project. We'll be just fine with the low-tech solution. But, opened my eyes for possibilities on other projects. Thanks again... --Jim On Wednesday, February 12, 2014 9:14:26 AM UTC-6,

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-12 Thread thiago_pnobre
There is no way to check if the user has entered incorrect credentials (login was rejected) and treat it my way? Em domingo, 9 de fevereiro de 2014 16h51min04s UTC-2, thiago...@comp.ufla.br escreveu: The problem is that I have a page for the login form, that only can redirect to the home

[web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-12 Thread Michael Ellis
I'm doing some embedded development with Web2py 2.8.2 on a BeagleBone Black (specs here) running a no-gui ubuntu. Mostly it's going very well so far, but I need some help reducing cpu usage for an ajax call that one of my pages is running every 2 seconds. A typical sample of the data returned is

[web2py] Standard way to access a referenced table?

2014-02-12 Thread Ian W. Scott
I've been working for a while on a very flexible (and so increasingly complex) multiple-select widget that can be re-populated from the db via ajax (without submitting the form). One think I had to do was figure out how to get the name of the table referenced by the field using my widget. With

[web2py] Re: Best practice for a development environment together with a live environment

2014-02-12 Thread Dave S
On Monday, February 10, 2014 6:30:47 PM UTC-8, 黄祥 wrote: please use version control (git, mercury for your code) and then backup it up to another media as well (nas, tape) or you could store it in online backup like (dropbox, google drive) if it's your own project, i don't think so in

[web2py] Re: how to embed an image (or another solution) ?

2014-02-12 Thread Stef Mientki
found a solution, but it needs ugly code in the view. And I'm not sure if this is an unsafe action. {{import os}} {{import base64}} {{fh = open ( os.path.join ( 'applications', request.application, 'uploads', 'images', 'pic_%s.png' %

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-12 Thread Michele Comitini
run the profiler on the board: python web2py.py -F profiles dir make your app operate as usual. Do so for a limited amount of time since the directory is going to be filled with profiling files. move the profiling files to your desktop machine and analyze them all together with runsnake (pip

Re: [web2py] web2py on BeagleBone Black: optimizing ajax

2014-02-12 Thread Michael Ellis
I'll give that a try! Thanks you. On Wednesday, February 12, 2014 5:17:02 PM UTC-5, Michele Comitini wrote: run the profiler on the board: python web2py.py -F profiles dir make your app operate as usual. Do so for a limited amount of time since the directory is going to be filled with

[web2py] Re: Standard way to access a referenced table?

2014-02-12 Thread Anthony
A reference field has type reference tablename, so you can do: db.mytable.myfield.type.split(' ')[-1] Anthony On Wednesday, February 12, 2014 3:58:58 PM UTC-5, Ian W. Scott wrote: I've been working for a while on a very flexible (and so increasingly complex) multiple-select widget that can

[web2py] Re: Standard way to access a referenced table?

2014-02-12 Thread Anthony
To get the actual ID field of the referenced table, you can also do: db.mytable.myfield.referent and to get the table: db.mytable.myfield.referent.table and to get the table name: db.mytable.myfield.referent.tablename Anthony On Wednesday, February 12, 2014 5:40:00 PM UTC-5, Anthony wrote:

[web2py] Re: how to embed an image (or another solution) ?

2014-02-12 Thread Anthony
If you use the built-in upload mechanism (i.e., an upload type field in a db table), then files uploaded via that method can be downloaded via response.download. The welcome app includes a /default/download function to do just that. Check out

[web2py] Re: Standard way to access a referenced table?

2014-02-12 Thread Ian W. Scott
Fantastic! Thanks. When I asked a couple of years ago that wasn't pointed out, so I assumed that there wasn't a standard way. This is perfect. Ian On Wednesday, February 12, 2014 5:43:40 PM UTC-5, Anthony wrote: To get the actual ID field of the referenced table, you can also do:

[web2py] track_changes is Broken? I keep having to restart web2py

2014-02-12 Thread Brando
I've put the following in my model: from gluon.custom_import import track_changes track_changes(True) and all modules i am working with are in the modules folder within the app. The last thread I read on here says that this functionality isn't working. Is that the case? Development is

Re: [web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-12 Thread Anthony
If you change the Auth controller from 'default', you must specify that: auth = Auth(db, controller='autenticacao') Anthony On Monday, February 10, 2014 5:27:40 PM UTC-5, Thiago Nobre wrote: Yeah, it's exactly what's going on and I don't know why. I attached the db.py file and the

Re: [web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-12 Thread Thiago Nobre
It's just that simple? I didn't imagine that was the reason of the strange login behavior. When I get home, I'll test it and tell you if it worked. 2014-02-12 22:26 GMT-02:00 Anthony abasta...@gmail.com: If you change the Auth controller from 'default', you must specify that: auth = Auth(db,

[web2py] Re: Grid in component edit twice issue

2014-02-12 Thread Jim Karsten
Anyone have any ideas? Is it possible somehow to force an ajax reload of the grid after the edit form is submitted? -- 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

[web2py] Re: How to prevent web2py redirect if login is not valid?

2014-02-12 Thread thiago_pnobre
It worked! Thank you! -- 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] Re: track_changes is Broken? I keep having to restart web2py

2014-02-12 Thread Brando
I consolidated all of my different modules to 1 module file and it is now working. On Wednesday, February 12, 2014 4:08:04 PM UTC-8, Brando wrote: I've put the following in my model: from gluon.custom_import import track_changes track_changes(True) and all modules i am working

Re: [web2py] How can I show response.flash messages with different styles?

2014-02-12 Thread Richard Vézina
It too bad, I am sure there were an example of that in the book, but I just can find it back... :( Richard On Wed, Feb 12, 2014 at 8:54 PM, User sourci...@gmail.com wrote: I am using bootstrap 2.3.2 and I would like to use Bootstrap css alert classes to style response.flash. These include:

Re: [web2py] Re: track_changes is Broken? I keep having to restart web2py

2014-02-12 Thread Richard Vézina
Brando, which version of web2py you experiment this issue? Richard On Wed, Feb 12, 2014 at 9:06 PM, Brando bhe...@trustcc.com wrote: I consolidated all of my different modules to 1 module file and it is now working. On Wednesday, February 12, 2014 4:08:04 PM UTC-8, Brando wrote:

Re: [web2py] How can I show response.flash messages with different styles?

2014-02-12 Thread Richard Vézina
At least you can better understand how it works here : http://web2py.com/books/default/chapter/29/11/jquery-and-ajax?search=error#web2py_ajax-html Maybe what I was searching for is web2py slice... If I find it will post the pointer here... Richard On Wed, Feb 12, 2014 at 9:09 PM, Richard

[web2py] Re: How can I show response.flash messages with different styles?

2014-02-12 Thread Anthony
Does your solution below not work? On Wednesday, February 12, 2014 8:54:46 PM UTC-5, User wrote: I am using bootstrap 2.3.2 and I would like to use Bootstrap css alert classes to style response.flash. These include: alert alert-error alert-success alert-info Is there an easy way to

[web2py] Re: How can I show response.flash messages with different styles?

2014-02-12 Thread User
It works, just looking for best practices. Curious if anyone had anything really slick. Not too crazy about adding on the fly attribute to response object, but perhaps a slightly more mangled name would make me more comfortable with that (Although chance of collision seems pretty small and

[web2py] Re: How can I show response.flash messages with different styles?

2014-02-12 Thread Cliff Kachinske
response.flash = SPAN('flash message goes here', _class='whatever') On Wednesday, February 12, 2014 8:54:46 PM UTC-5, User wrote: I am using bootstrap 2.3.2 and I would like to use Bootstrap css alert classes to style response.flash. These include: alert alert-error alert-success

[web2py] Re: How can I show response.flash messages with different styles?

2014-02-12 Thread Anthony
On Wednesday, February 12, 2014 9:48:34 PM UTC-5, Cliff Kachinske wrote: response.flash = SPAN('flash message goes here', _class='whatever') And since this case involves a div and a button, to avoid having to repeat all that every time, just write a function that takes a message and a flash

[web2py] An easy way to change action in user login form?

2014-02-12 Thread Wei Wang
My web2py powered app is behind a reverse proxy (namely, NetIQ Access Manager) for single sign-on. User authentication to my app is done through a form-fill to the form that /default/user/login renders as redirected by the @auth.require_login() decorator. Long story short, this setup stopped

Re: [web2py] Re: pre-populate form using selected record in SQLFORM.grid

2014-02-12 Thread John Philip
Hi Anthony and Jim, thanks very much for your help. I got it working with Jim suggestion since I only wanted to insert a completely new record with the prepopulated values from the previous sqlgrid form. thanks again! regards, John On Wednesday, February 12, 2014 3:40:27 PM UTC+1, Anthony