[web2py:17622] Re: DAL mssql DSN connection

2009-03-06 Thread DenesL
Using rev775 I get Invalid Query but the command SELECT count(*) FROM person WHERE person.id>0; runs ok, the retrieved value is: [(50, )] if using fetchall() or (50, ) if using fetchone(). --~--~-~--~~~---~--~~ You received this message because you are subscribed

[web2py:17621] Re: Patch complete: adding configurability to EditArea

2009-03-06 Thread mdipierro
In trunk, thanks. On Mar 5, 12:35 am, Jonathan B wrote: > Hi Massimo, > > On Mar 4, 4:53 pm, mdipierro wrote: > > > I do not have access. > > Public access has been granted. The patch (up-to-date to revision 584 > of trunk) is available > here:http://sites.google.com/a/benn.ca/file-locker/file

[web2py:17620] Re: DAL mssql DSN connection

2009-03-06 Thread mdipierro
Uploading to trunk now. Please give it a try. I assuming the FETCH ONLY comes after GROUPBY and ORDERBY. Massimo On Mar 6, 3:42 pm, DenesL wrote: > The previous limitby=(10,30) for mssql: > > rows=cursor.execute('select top 30 * from person').fetchall()[10:] > > The same can be achieved with n

[web2py:17619] Re: Using 'count' as a field

2009-03-06 Thread mdipierro
This two {{=row._extra[db.mytable.id.count()]}} {{=row._extra['COUNT(myvar.id)']}} should be equivalent. Please try again. Massimo On Mar 6, 12:45 pm, Joe Barnhart wrote: > According to the web2py book, we can use 'count' as a field by first > delcaring a variable: > > count=db.mytable.id.co

[web2py:17618] Re: DAL mssql DSN connection

2009-03-06 Thread DenesL
The previous limitby=(10,30) for mssql: rows=cursor.execute('select top 30 * from person').fetchall()[10:] The same can be achieved with nested selects as explained in: http://sqlzoo.net/howto/source/z.dir/tip857849/sqlserverfor --~--~-~--~~~---~--~~ You received

[web2py:17617] Re: DAL mssql DSN connection

2009-03-06 Thread DenesL
On Mar 6, 11:17 am, mdipierro wrote: > Can you print the query (print ._select) and see how it > differs? My guess is the LIMIT BY attribute. SELECT person.id, person.name FROM person WHERE person.id>0 LIMIT 100 OFFSET 0; The problem, as you guessed, is LIMIT. There is no LIMIT in db2 b

[web2py:17616] Re: web2py 1.57

2009-03-06 Thread vince
yes i traced back to some incorrect datatime field. funny things is it works under 1.56.4. i actually only import from the cvs via appadmin. thanks On Mar 6, 9:35 pm, mdipierro wrote: > You have corrupted data in database. My guess you are usingsqliteand > you converted a non 'datetime' field i

[web2py:17615] Using 'count' as a field

2009-03-06 Thread Joe Barnhart
According to the web2py book, we can use 'count' as a field by first delcaring a variable: count=db.mytable.id.count() Then using it in the select statement: db().select(db.mytable.somefield,count,groupby=db.mytable.somefield) Then to access it we use the "_extras" variable: {{=row._extra[cou

[web2py:17614] Re: Distribution with PIL

2009-03-06 Thread AchipA
Including everything is bloat. Making implementing a distribution system is an overkill. The first thing we could do, however is introduce a way for the apps to signal the framework what modules do they need (esp with regard to versions). Sometimes just a note in the admin about these dependencies

[web2py:17613] Re: web2py 1.57

2009-03-06 Thread vince
yes it's on sqlite but the data are from the csv import from appadmin. funny thing is it works under 1.56.4. it seens ti only happens when the db with over certain amount of row like over 1000 let me try again and see if i can sort it out vince On Mar 6, 9:35 pm, mdipierro wrote: > You have co

[web2py:17612] tables with migrate=False can not be dropped

2009-03-06 Thread DenesL
using web2py trunk v772 with sqlite db.define_table('tablex',... ,migrate=False) ... db.tablex.drop() Traceback (most recent call last): File "", line 1, in File "D:\web2py\trunk\gluon\sql.py", line 1263, in drop if self._dbt: File "D:\web2py\trunk\gluon\sql.py", line 1049, in __getatt

[web2py:17611] Re: DAL mssql DSN connection

2009-03-06 Thread mdipierro
Can you print the query (print ._select) and see how it differs? My guess is the LIMIT BY attribute. Massimo On Mar 6, 9:54 am, DenesL wrote: > Using trunk v772 with fixed sql.py for db2 (I sent you the patch) the > problem still happens: Invalid Query. --~--~-~--~~-

[web2py:17610] Re: DAL mssql DSN connection

2009-03-06 Thread DenesL
Using trunk v772 with fixed sql.py for db2 (I sent you the patch) the problem still happens: Invalid Query. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send ema

[web2py:17609] Re: Source repository confusion

2009-03-06 Thread mdipierro
On Mar 6, 9:08 am, Yarko Tymciurak wrote: > On Fri, Mar 6, 2009 at 9:00 AM, mdipierro wrote: > > > the Makefile is only for building binaries. I do not expect users to > > run the Makefile. > > > I am against using a version control system that forces me to change > > the code (put empty files

[web2py:17608] Re: defining tree structure model problem

2009-03-06 Thread mdipierro
There is not a way because I am not convinced this is a good thing to do. You can live the field as integer and use a IS_IN_DB validator to make ure the int is a valid reference. Massimo On Mar 6, 9:03 am, DenesL wrote: > OK, but then how would you define mainctc in the previous example?. --~--

[web2py:17607] Re: Source repository confusion

2009-03-06 Thread Yarko Tymciurak
Oh! I remember how this "bee" got in my hat: On Fri, Mar 6, 2009 at 9:08 AM, Yarko Tymciurak wrote: > On Fri, Mar 6, 2009 at 9:00 AM, mdipierro wrote: > >> >> the Makefile is only for building binaries. I do not expect users to >> run the Makefile. >> >> I am against using a version control s

[web2py:17606] Re: Source repository confusion

2009-03-06 Thread Yarko Tymciurak
On Fri, Mar 6, 2009 at 9:00 AM, mdipierro wrote: > > the Makefile is only for building binaries. I do not expect users to > run the Makefile. > > I am against using a version control system that forces me to change > the code (put empty files in empty folders) because they cannot handle > empty f

[web2py:17605] Re: defining tree structure model problem

2009-03-06 Thread DenesL
OK, but then how would you define mainctc in the previous example?. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubs

[web2py:17604] Re: HTP header P3P policy - how to?

2009-03-06 Thread SergeyPo
Thank you Massimo, however this did not help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group,

[web2py:17603] Re: Source repository confusion

2009-03-06 Thread Yarko Tymciurak
On Fri, Mar 6, 2009 at 8:23 AM, BigBaaadBob wrote: > > On Mar 5, 9:44 am, Yarko Tymciurak wrote: > > The repository (git or otherwise - whoever maintains it) --- should have > a > > placeholder to hold empty directories. > > If the authoritative repository doesn't anchor these directories then >

[web2py:17602] Re: Source repository confusion

2009-03-06 Thread mdipierro
the Makefile is only for building binaries. I do not expect users to run the Makefile. I am against using a version control system that forces me to change the code (put empty files in empty folders) because they cannot handle empty folders. Massimo On Mar 6, 8:23 am, BigBaaadBob wrote: > On M

[web2py:17601] Re: DAL mssql DSN connection

2009-03-06 Thread mdipierro
Make sure you have the latest appadmin.py from trunk. There was a problem with python2.6 and I cannot exclude it is causing this issue for you. On Mar 6, 8:39 am, DenesL wrote: > > Speaking of db2/400, the automatic journaling problem is still sadly > > alive, which means that after the tables a

[web2py:17600] Re: DAL mssql DSN connection

2009-03-06 Thread DenesL
> Speaking of db2/400, the automatic journaling problem is still sadly > alive, which means that after the tables are created you have to > manually start journaling on them before any inserts can be done. as tested on V5R2 and V5R3, does anyone have access to a newer one? > Testing the modified

[web2py:17599] Re: defining tree structure model problem

2009-03-06 Thread mdipierro
DO NOT DO THIS: db.customer.mainctc.type='reference contact' I cannot predict the downsides. Massimo On Mar 6, 8:23 am, DenesL wrote: > I see. But in a case like this: > > db.define_table("customer", >     SQLField("code","string"), >     SQLField("name","string"), >     SQLField("mainctc","i

[web2py:17598] Re: Source repository confusion

2009-03-06 Thread BigBaaadBob
On Mar 5, 9:44 am, Yarko Tymciurak wrote: > The repository (git or otherwise - whoever maintains it) --- should have a > placeholder to hold empty directories. If the authoritative repository doesn't anchor these directories then you force other mirrors to be different to anchor these directorie

[web2py:17597] Re: defining tree structure model problem

2009-03-06 Thread DenesL
I see. But in a case like this: db.define_table("customer", SQLField("code","string"), SQLField("name","string"), SQLField("mainctc","integer")) db.customer.mainctc.type='reference contact' db.define_table("contact", SQLField("number","integer"), SQLField("customer",db.custom

[web2py:17596] Re: Error connecting to Mysql DB !

2009-03-06 Thread Yannick
Thanks for your analysis :) Cheers, Yannick P. On Mar 5, 11:58 pm, mdipierro wrote: > I think I found the source of the problem in case 3 below and I fixed > it in trunk. > Other users should not have your problem any longer. > When you do a migration for your own table, make sure the field has

[web2py:17595] new feature in trunk: services

2009-03-06 Thread mdipierro
Has anybody tried this yet? Please try this and send me comments: from gluon.tools import Service service=Service(globals()) @service.run @service.json @service.jsonrpc @service.xmlrpc @service.amfrpc def f(a,b): return a+b @service.rss def myfeed(): return dict (title='title',link='li

[web2py:17594] Re: HTP header P3P policy - how to?

2009-03-06 Thread mdipierro
Fascinating. I think you are looking for: response.headers['P3P']='CP="CAO PSA OUR"' Massimo On Mar 6, 3:43 am, SergeyPo wrote: > Sorry this is not spamming but I keep trying to fix problem with > sessions and javascript. > My site uses frames and this may lead to problems. For example the > f

[web2py:17593] Re: web2py 1.57

2009-03-06 Thread mdipierro
You have corrupted data in database. My guess you are using sqlite and you converted a non 'datetime' field in a 'datetime' field but the column contained previous data. 'sqlite' is stupid and does the migration without checking for the actual data type. You need to reset the values in that column

[web2py:17592] HTP header P3P policy - how to?

2009-03-06 Thread SergeyPo
Sorry this is not spamming but I keep trying to fix problem with sessions and javascript. My site uses frames and this may lead to problems. For example the following link from 'left' frame works (opens something in right frame): _onclick="javascript:top.frames['right'].location.reload()" But th

[web2py:17591] Re: form pre-population fails if field is shown in 1.56.2

2009-03-06 Thread vince
thanks that works great! it would be nice to have the form.element documented! On Mar 5, 3:15 am, mdipierro wrote: > after accept try > > form.element(_name='password')['_value']='' > > On Mar 4, 10:46 am,vince wrote: > > > oh it was typo. > > > db.define_table('person', > >             db.Fie

[web2py:17590] Re: web2py 1.57

2009-03-06 Thread vince
i got this error on 1.57 but not 1.56.4 it's just a simple select to cresult before the for row in cresult Traceback (most recent call last): File "/private/var/www/web2py/gluon/restricted.py", line 98, in restricted exec ccode in environment File "/private/var/www/web2py/applications/cy