[web2py] Best way to use a standalone DAL

2014-03-03 Thread Gwayne aka Mike Veltman
I will actually call dal from within some scripts and from the webgui. What would be the best and cleanest way to do that ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Best way to use a standalone DAL

2014-03-03 Thread Gwayne aka Mike Veltman
UTC+8, Anthony wrote: In a script, you can just import it like any other Python module. Not sure what you mean by calling it from the webgui. Anthony On Monday, March 3, 2014 3:58:39 AM UTC-5, Gwayne aka Mike Veltman wrote: I will actually call dal from within some scripts and from

Re: [web2py] 1071, 'Specified key was too long; max key length is 767 bytes'

2013-10-09 Thread Mike Veltman
=request.now), format='%(framename)s', migrate=True) On Tuesday 08 October 2013 13:41:31 Mike Veltman wrote: Ok, I am now fighting with it for two days and it drives me crazy. My gut feeling says mysql 5.1 -- mysql 5.5 upgrade is the cause. Am I right ? And how do I solve it. :-) *Error

[web2py] 1071, 'Specified key was too long; max key length is 767 bytes

2013-10-07 Thread Mike Veltman
My gut feeling says mysql 5.1 -- mysql 5.5 upgrade is the cause. Am I right ? And how do I solve it. :-) *Error ticket for adeploy* *Ticket ID* 192.168.2.106.2013-10-08.12-46-19.24f3f1a5-d637-4522-965b-fed4958115ed *class '_mysql_exceptions.OperationalError' (1071, 'Specified key was too

[web2py] 1071, 'Specified key was too long; max key length is 767 bytes'

2013-10-07 Thread Mike Veltman
Ok, I am now fighting with it for two days and it drives me crazy. My gut feeling says mysql 5.1 -- mysql 5.5 upgrade is the cause. Am I right ? And how do I solve it. :-) *Error ticket for adeploy* *Ticket ID* 192.168.2.106.2013-10-08.12-46-19.24f3f1a5-d637-4522-965b-fed4958115ed *class

Re: [web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-25 Thread Mike Veltman
On Wednesday 24 July 2013 18:34:08 Alan Etkin wrote: Note: If you are restoring data with the DAL method import_from_csv_file (not the Table class method) using id_map={}, which is the method that should be used to keep references in sync, you should not have issues keeping reference values.

[web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Mike Veltman
On Monday 22 July 2013 05:16:56 Alan Etkin wrote: I am just playing around with mongodb and web2py I noticed that when I just make a web2py dump of my mysql db and then upload it to mongodb some of the joins now just rec id's are right and some are newly generated. Also would it be

Re: [web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Mike Veltman
On Wednesday 24 July 2013 11:52:36 Alan Etkin wrote: Also I concluded that because all the references are replaced by mongodb id's it is not possible to say dump a table with references in one database and then restore it on mongodb. Neither you can (or should) with other adapters, for

[web2py] [web2pyy] Mysql 2 Mongodb

2013-07-21 Thread Mike Veltman
I am just playing around with mongodb and web2py I noticed that when I just make a web2py dump of my mysql db and then upload it to mongodb some of the joins now just rec id's are right and some are newly generated. Also would it be possible to keep id to be web2py specific and to use _id

[web2py] Mongodb error in appadmin

2013-03-21 Thread Mike Veltman
The action I have a table/collection with 3 objects In the table this is reverenced as Field('host_id', mdb.hoststable, comment=Like nim or hmc server., label=T('Destination Host ID')), But when in appadmin I select a other object to change then it throws a error. The

[web2py] Mongodb error in appadmin

2013-03-21 Thread Mike Veltman
Created the following table mdb.define_table('syscommands', Field('commandname', type='string', unique=True, label=T('Commandname')), Field('commandline', type='string', label=T('Command')), Field('host_id', mdb.hoststable, comment=Like nim or

Re: [web2py] Mongodb error in appadmin

2013-03-21 Thread Mike Veltman
Op 21-03-13 17:50, Niphlod schreef: seems to me that a lot of people are interested in using mongodb but really few are contributing back with tests and patches. BTW: you DO know that Mongo generally doesn't play well with joins, right ? Using references in mongodb is not a smart design.

Re: [web2py] Mongodb error in appadmin

2013-03-21 Thread Mike Veltman
On 03/21/2013 08:06 PM, Alan Etkin wrote: I would love to have some pointers about how though define mongo in db.py in a proper nosql way. Could you open an issue at the project page? Done :-) Issue 1401 https://code.google.com/p/web2py/issues/detail?id=1401: Mongodb error in

[web2py] Mongodb and db.py

2012-12-17 Thread Mike Veltman
Hello People, I am looking into converting my mysql database setup into a mongodb and I was wondering about how at the moment db.py does translate the tables. Because I would like to have some control/understanding about it. --

Re: [web2py] Adding a copy option to a SQLFORM.grid

2012-04-12 Thread Mike Veltman
On 04/12/2012 01:08 PM, Mike Veltman wrote: Well I would like to have besides edit delete etc in my SQLFORM.grid also a copy option that copies the record and then gives me the edit so I can modify it. Anyone a idea how to do that ? Mike Aha I have to use links (RTFM) Does anybody have

Re: [web2py] Adding a copy option to a SQLFORM.grid

2012-04-12 Thread Mike Veltman
() rec_id = rec.id redirect(URL(r=request, f='manage_profile',args=str(rec_id))) return Problem solved :-) On 04/12/2012 03:19 PM, Mike Veltman wrote: On 04/12/2012 01:08 PM, Mike Veltman wrote: Well I would like to have besides edit delete etc in my SQLFORM.grid also a copy option

[web2py] Adding a copy option to a SQLFORM.grid

2012-04-11 Thread Mike Veltman
Well I would like to have besides edit delete etc in my SQLFORM.grid also a copy option that copies the record and then gives me the edit so I can modify it. Anyone a idea how to do that ? Mike

Re: [web2py] SQLFORM.grid not doing what I want :)

2012-03-30 Thread Mike Veltman
aka Mike Veltman wrote: On 03/30/2012 12:01 AM, Massimo Di Pierro wrote: When you say I want to manipulate db.lvdisksetup but in stead it manipulates db.lvdisk what do you mean by manipulates? That when I delete a record or do add a record it gives me the db.lvdisk table

Re: [web2py] SQLFORM.grid not doing what I want :)

2012-03-30 Thread Mike Veltman
a charm, its really great Massimo. Thanks On 03/30/2012 03:55 PM, Mike Veltman wrote: I guessed it was something like that :-) Thanks Massimo I am going to test it. On 03/30/2012 10:51 AM, Massimo Di Pierro wrote: You have to pass it SQLFORM.grid(...,field_id=db.lvdisksetup.id,) else

Re: [web2py] SQLFORM.grid not doing what I want :)

2012-03-29 Thread Mike Veltman
delete or add a record that is supposed to be a reverence. On Wednesday, 28 March 2012 22:58:31 UTC-5, Gwayne aka Mike Veltman wrote: Gentle people, I have the following grid: query = ( (db.lvdisksetup.lvgroupname_id == usedlvdisksetup) (db.lvgroupname.id http

[web2py] SQLFORM.grid not doing what I expect

2012-03-28 Thread Mike Veltman
Gentle people, I have the following grid: query = ( (db.lvdisksetup.lvgroupname_id == usedlvdisksetup) (db.lvgroupname.id == usedlvdisksetup) (db.lvdisksetup.lvdisk_id == db.lvdisk.id) ) fields = [db.lvdisksetup.id, db.lvgroupname.lvgroupnamedesc , db.lvdisk.lvdiskdesc,

[web2py] SQLFORM.grid not doing what I want :)

2012-03-28 Thread Mike Veltman
Gentle people, I have the following grid: query = ( (db.lvdisksetup.lvgroupname_id == usedlvdisksetup) (db.lvgroupname.id == usedlvdisksetup) (db.lvdisksetup.lvdisk_id == db.lvdisk.id) ) fields = [db.lvdisksetup.id, db.lvgroupname.lvgroupnamedesc , db.lvdisk.lvdiskdesc,

Re: [web2py] Re: A SQLFORM.grid question

2011-11-08 Thread Mike Veltman
I miss ? Btw is the same setup with a query possible with SQLFORM.smartgrid ? With regards, Mike Veltman With regards, Mike Veltman With regards, Mike Veltman

Re: [web2py] Re: A SQLFORM.grid question

2011-11-03 Thread Mike Veltman
SQLFORM.smartgrid extensively and it is working really well for me. -Jim On 11/2/2011 10:47 PM, Mike Veltman wrote: Now I am even more confused :) Sorry for being a nagging person. Why does SQLFORM.grid display the name (as I want) in the setupid column, but not display the name

[web2py] A SQLFORM.grid question

2011-11-02 Thread Mike Veltman
possible with SQLFORM.smartgrid ? With regards, Mike Veltman

Re: [web2py] A SQLFORM.grid question

2011-11-02 Thread Mike Veltman
are you able to see the form? or are you getting the not authorized message? you can set user_signature=False or ensure that user is logged in. Thanks for the reaction. But no the form is generated perfectly. And the user is logged in. On Wed, Nov 2, 2011 at 6:50 AM, Mike Veltman

Re: [web2py] Re: A SQLFORM.grid question

2011-11-02 Thread Mike Veltman
with args action/table. You have to do something like: if request.args(0) in (edit, new): redirect(URL(edit.html, args=[request.args(1), request.args(2)]) On Nov 2, 9:15 am, Mike Veltman mike.velt...@gmail.com wrote: are you able to see the form? or are you getting

Re: [web2py] Re: A SQLFORM.grid question

2011-11-02 Thread Mike Veltman
to do something like: if request.args(0) in (edit, new): redirect(URL(edit.html, args=[request.args(1), request.args(2)]) On Nov 2, 9:15 am, Mike Veltman mike.velt...@gmail.com wrote: are you able to see the form? or are you getting the not authorized message? you can set

Re: [web2py] Re: A SQLFORM.grid question

2011-11-02 Thread Mike Veltman
: if request.args(0) in (edit, new): redirect(URL(edit.html, args=[request.args(1), request.args(2)]) On Nov 2, 9:15 am, Mike Veltman mike.velt...@gmail.com wrote: are you able to see the form? or are you getting the not authorized message? you can set user_signature

Re: [web2py] Re: Hide menu until after authentication.

2011-10-24 Thread Mike Veltman
I actually totally overlooked that it was placed in layout.html Thanks everybody for the information. I learned a lot again. With regards, Mike Veltman

Re: [web2py] Hide menu until after authentication.

2011-10-24 Thread Mike Veltman
On Friday, October 21, 2011 2:05:29 AM UTC-4, Gwayne aka Mike Veltman wrote: Gentle people, First a remark I started playing with SQLFORM.grid and it was very ugly, until I did throw away my application and recreated it with the wizard, and then it was fine. ;-) Along

[web2py] What I do with web2py.

2011-10-24 Thread Mike Veltman
, Mike Veltman

[web2py] Hide menu until after authentication.

2011-10-21 Thread Mike Veltman
of doing that ? Thanks in advance. With regards, Mike Veltman

Re: [web2py] Re: Hide menu until after authentication.

2011-10-21 Thread Mike Veltman
)}} {{pass}} Kind regards, Annet. With regards, Mike Veltman

Re: [web2py] Re: Threads :-)

2011-10-10 Thread Mike Veltman
, errorvalue gluon.contrib.pymysql.err.InterfaceError: (0, '') . If pushing data to redis takes too long it defies the purpose of using redis. Well its collecting the data and combining it in redis that takes time. On Oct 9, 11:22 pm, Mike Veltman mike.velt...@gmail.com wrote: Ok, I

[web2py] Threads :-)

2011-10-09 Thread Mike Veltman
(database) errors in the functions. Any idea's or is there a better/ more elegant solution to this problem ? With regards, Mike Veltman

Re: [web2py] Re: Threads :-)

2011-10-09 Thread Mike Veltman
, '') . If pushing data to redis takes too long it defies the purpose of using redis. Well its collecting the data and combining it in redis that takes time. On Oct 9, 11:22 pm, Mike Veltman mike.velt...@gmail.com wrote: Ok, I need to push data in a redis database. And my problem

[web2py] Compile from command line

2011-08-28 Thread Mike Veltman
Its pretty annoying because I did know it before. Does anybody know what the command is to compile from the command line ? Also is there are website or part of the book that will collect this so I can add it ? Thanks in advance. With regards, Mike Veltman

Re: [web2py] Compile from command line

2011-08-28 Thread Mike Veltman
here: http://thadeusb.com/weblog/2010/4/21/compile_web2py_apps_externally python -c import gluon.compileapp; gluon.compileapp.compile_application('applications/appname') On Sun, Aug 28, 2011 at 10:05 PM, Mike Veltman mike.velt...@gmail.comwrote: Its pretty annoying because I did know

Re: [web2py] Re: What about a few web2py server vm builds

2011-07-21 Thread Mike Veltman
Thanks, :-) I probably make it anyway just to play around with it. But then I do not share by default. There was discussion http://www.turnkeylinux.org/forum/general/20110107/tklpatch-web2py-framewor k On Jul 20, 8:04 pm, Mike Veltman mike.velt...@gmail.com wrote: First I dont know

Re: [web2py] Re: What about a few web2py server vm builds

2011-07-21 Thread Mike Veltman
or installation cd/dvd that automaticly deploys a web2py environment. Mmmm, it does show that I am a OS man and not a developer ;-) There was discussion http://www.turnkeylinux.org/forum/general/20110107/tklpatch-web2py-framewor k On Jul 20, 8:04 pm, Mike Veltman mike.velt...@gmail.com

[web2py] What about a few web2py server vm builds

2011-07-20 Thread Mike Veltman
. With regards, Mike Veltman

[web2py] How to to get SQLFORM.factory to show only a subset of records ?

2011-07-13 Thread Mike Veltman
==True and then returns setup.id so I can use that. A addtional would be that the first selection is the first record and not empty. Thanks in advance. With regards, Mike Veltman

Re: [web2py] How to to get SQLFORM.factory to show only a subset of records ?

2011-07-13 Thread Mike Veltman
, '%(setupname)s')) Anthony On Wednesday, July 13, 2011 9:06:03 PM UTC-4, Gwayne aka Mike Veltman wrote: This will probably a facepalm moment but I can not figure it out. My present used form function form = SQLFORM.factory( Field('setup', requires=IS_IN_DB(db

[web2py] Strange behaviour with import.

2011-06-20 Thread Mike Veltman
When I dump a table from a SQLite3 db and import it in a mysql database some of the integers do not load. Interesting enough the .id do show up fine. With regards, Mike Veltman

Re: [web2py] Re: Strange behaviour with import.

2011-06-20 Thread Mike Veltman
This is fixed in trunk. Thanks :-) I noticed that I never added version and stuff, sorry for that. On Jun 20, 3:38 am, Mike Veltman mike.velt...@gmail.com wrote: When I dump a table from a SQLite3 db and import it in a mysql database some of the integers do not load. Interesting

Re: [web2py] Re: SyntaxError: Object exists and cannot be redefined: lunid

2011-06-08 Thread Mike Veltman
On Tuesday, June 7, 2011 2:26:45 AM UTC-4, Gwayne aka Mike Veltman wrote: On Monday, June 6, 2011 9:15:27 PM UTC-4, Gwayne aka Mike Veltman wrote: And that was it... Thank you very much. Mmmm, this should go in the book.. There's also this method of pre-populating a form

[web2py] Re: SyntaxError: Object exists and cannot be redefined: lunid

2011-06-07 Thread Mike Veltman
On Monday, June 6, 2011 9:15:27 PM UTC-4, Gwayne aka Mike Veltman wrote: And that was it... Thank you very much. Mmmm, this should go in the book.. There's also this method of pre-populating a form field: http://web2py.com/book/default/chapter/07#Pre-populating-the-form Yes I know

[web2py] SyntaxError: Object exists and cannot be redefined: lunid

2011-06-06 Thread Mike Veltman
I try to pre populate a form and I think I do something wrong but I stare at it for a long time and what I do wrong still does not show up. So maybe some people can make my day better. Error: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File

[web2py] Re: SyntaxError: Object exists and cannot be redefined: lunid

2011-06-06 Thread Mike Veltman
And that was it... Thank you very much. Mmmm, this should go in the book.. db.lvstorage.lunid = 4 should be (I guess) db.lvstorage.lunid.default = 4 On Jun 6, 4:12 am, Mike Veltman mike.velt...@gmail.com wrote: I try to pre populate a form and I think I do something wrong but I

Re: [web2py] CRYPT validator outlawed in France?

2011-04-07 Thread Mike Veltman
http://www.reddit.com/r/programming/comments/gkl77/hashed_passwords_outlawe d_in_france/ I thought that by definition all encryption keys should be given to the government in France. So a source that can not be decrypted by the government is automatically illegal. With regards, Mike Veltman

[web2py] Possible bug relating creating records in appadmin with IS_IN_SET([0,1])

2011-04-06 Thread Mike Veltman
. With regards, Mike Veltman Trainer and Senior Consultant, Linux and AIX Phone : +65 96212448 Phone NL : +31 878702983 DID : +65 6464 0432 Fax : +65 6464 0349 Email : mike.velt...@gmail.com Skype : m.veltman Profile : www.linkedin.com/in/mikeveltman

Re: [web2py] Re: Possible bug relating creating records in appadmin with IS_IN_SET([0,1])

2011-04-06 Thread Mike Veltman
... to check for the existence of a field default, and that does not work for this case. Thinking cap on... On Apr 6, 4:17 am, Mike Veltman mike.velt...@gmail.com wrote: Database field is: Field('lunid', type='integer', default=0, label=T('Lun ID

Re: [web2py] Re: Possible bug relating creating records in appadmin with IS_IN_SET([0,1])

2011-04-06 Thread Mike Veltman
on... On Apr 6, 4:17 am, Mike Veltman mike.velt...@gmail.com wrote: Database field is: Field('lunid', type='integer', default=0, label=T('Lun ID')), Database rule is db.viostorage.lunid.requires = IS_IN_SET([0,1]) Problem: In stead

[web2py] Create a new window.

2011-04-05 Thread Mike Veltman
. Would it be possible to spawn a separate window and let the original form go on ? Thanks in advance. Mike Veltman

Re: [web2py] Japan

2011-03-14 Thread Mike Veltman
+888 +1 2011/3/11 Massimo Di Pierro massimo.dipie...@gmail.com We all feel very close to our friends in Japan, and we are saddened by what has happened. With regards, Mike Veltman Trainer and Senior Consultant, Linux and AIX Phone : +65 96212448 Phone NL : +31 878702983 DID