[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 act

[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 (R

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

2013-10-09 Thread Mike Veltman
label=T('Frame State record ID')), Field('created_on','datetime',default=request.now, label=T('Created On'),writable=False,readable=False), Field('modified_on','datetime',default=request.now, label=T('Mod

[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 * (1071, 'Sp

[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 * (1071, 'Specified key was too long; max key length is 767 bytes')* *Versio

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. I

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] 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 possib

[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 f

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 : Mongodb error

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 des

[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

[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 err

[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
rec = db(db.lparprofile.lparname == recname).select().first() 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

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 a

[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
worked like 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,.

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

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

2012-03-29 Thread Mike Veltman
isksetup table. So I 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) &

[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, db.lvdisksetup

[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, db.lvdisksetup

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

2011-11-08 Thread Mike Veltman
it is failing - e.g. when you press submit is it actually calling the controller? On Nov 3, 2:16 am, Mike Veltman wrote: Now I think of it, you do not need to do a redirect because it creates its own page based on the called page. Its just that the submit does not do anything

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

2011-11-03 Thread Mike Veltman
e') db.lvstorage.storagemap_id.requires = IS_IN_DB(db, 'storagemap.id', 'storagemap.mapping') ---- > Mike > > If you post some of the details of your app I'm happy to look a

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

2011-11-02 Thread Mike Veltman
led page. > > Its just that the submit does not do anything. > > > SQLFORM.grid does not actually add the records automatically. It just > > calls the grid controller with args action/table. > > > > You have to do something like: > > if

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

2011-11-02 Thread Mike Veltman
gt; 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 wrote: > > > are you able to see the form? or ar

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

2011-11-02 Thread Mike Veltman
roller 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 wrote: > &

Re: [web2py] A SQLFORM.grid question

2011-11-02 Thread Mike Veltman
t; add I > > get the next screen but the record is not added. What do I miss ? > > > > Btw is the same setup with a query possible with SQLFORM.smartgrid ? > > > > With regards, > > Mike Veltman With regards, Mike Veltman

[web2py] A SQLFORM.grid question

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

[web2py] What I do with web2py.

2011-10-24 Thread Mike Veltman
, 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 wiz

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] Re: Hide menu until after authentication.

2011-10-21 Thread Mike Veltman
MENU(response.menu)}} > {{pass}} > > > Kind regards, > > Annet. With regards, Mike Veltman

[web2py] Hide menu until after authentication.

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

Re: [web2py] Re: Threads :-)

2011-10-10 Thread Mike Veltman
se > > File gluon/contrib/pymysql/connections.py", line 184, in > defaulterrorhandler raise errorclass, errorvalue > gluon.contrib.pymysql.err.InterfaceError: (0, '') > > > . > > If pushing data to redis takes too long it defies the purpose of using > > redis. &g

Re: [web2py] Re: Threads :-)

2011-10-09 Thread Mike Veltman
ise errorclass, 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 wrote: > > Ok, I need to

[web2py] Threads :-)

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

[web2py] Web2py is in the Bossie awards

2011-09-08 Thread Mike Veltman
I dont know if someone else already mentioned it. But web2py is in the Bossie awards. ;-) Congrats http://www.infoworld.com/d/open-source-software/bossie-awards-2011-the-best- open-source-software-the-year-171567-1 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/')" > > On Sun, Aug 28, 2011 at 10:05 PM, Mike Veltman wrote: > > Its

[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] Re: What about a few web2py server vm builds

2011-07-20 Thread Mike Veltman
fe cd 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 Velt

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

2011-07-20 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 wrote: > > Firs

[web2py] What about a few web2py server vm builds

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

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

2011-07-13 Thread Mike Veltman
; this: > >> > >> Field('setup', requires=IS_IN_DB(db(db.setup.ready==True), db.setup.id, > >> '%(setupname)s')) > >> > >> > >> Anthony > >> > >> On Wednesday, July 13, 2011 9:06:03 PM UT

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

2011-07-13 Thread Mike Veltman
se), Field('modified_on','datetime',default=request.now, label=T('Modified On'),writable=False,readable=False, update=request.now), format='%(setupname)s', migrate=settings.migrate) What I try to get is that the form only shows the setupname of the records where setup.read==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] 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 wrote: > > When I dump a table from a SQLite3 db and import it in a mysql database > > some of the integers do not load. > >

[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: SyntaxError: Object exists and cannot be redefined: lunid

2011-06-07 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

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

2011-06-06 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/chap

[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 wrote: > > I try to pre populate a form and I think I do something

[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 "/home/mv1965/D

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

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

2011-04-06 Thread Mike Veltman
> > for this case. > > Thinking cap on... > > > > On Apr 6, 4:17 am, Mike Veltman wrote: > > > Database field is: > > > > > > Field('lunid', type='integer', > > > default=0, > > > lab

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

2011-04-06 Thread Mike Veltman
gt; It is a bug, e.g. sqlhtml.py uses > > if default ... > > 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 wrote: > > Database field is: > > >

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

2011-04-06 Thread Mike Veltman
default is 1 and it works fine. 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 : w

[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 > > > 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 DI