Re: [web2py] Re: Authentication: form just refreshes, won't validate login

2010-04-10 Thread Keith Edmunds
On Sat, 10 Apr 2010 15:35:05 -0700 (PDT), hamdy.a.fa...@inbox.com said: > This's most likely to happen if you've more than one form in the same > page so the question is , do you've another form inside the page ? Thanks for the suggestion, but I don't have any other forms there. I'm using the aut

Re: [web2py] dynamic mysql columns

2010-04-10 Thread Thadeus Burgess
I have to ask... Why on earth do you have dynamic columns? Can you tell us more as to why you *need* this, maybe there is a better way. You can always dynamically build your db.define_table() statements, the DAL will migrate them as needed. SO first, build your dynamic fields in a python list m

[web2py] Re: dynamic mysql columns

2010-04-10 Thread mdipierro
In web2py you can do something like: # define a table 'meta' that describes another table 'from_meta' db.define_table('meta',Field('colname'),Field('coltype')) # make sure it contains something if not db(db.meta.id>0).count() db.meta.insert(colname='your_name',coltype='string')) # define from_m

[web2py] dynamic mysql columns

2010-04-10 Thread Marc Dojka
I'm thinking of switching a site from php to python on web2py, however I've got a question on its mysql support. I'm trying to figure out how web2py handles tables where the column layout isn't fixed. Meaning that it's possible for columns to be created, used, and deleted by the app while it's run

[web2py] Re: Encoding using as_dict not using UTF-8?

2010-04-10 Thread mdipierro
I am not sure the issue is web2py here. It may be 1) the encoding in the db should be utf8 and it is not, 2) the data has been stored incorrecly. web2py does not convert data to UTF8 when extracting from DB but when inserting only. On Apr 10, 11:17 pm, Tito Garrido wrote: > Hi Folks, > > I'm not

[web2py] Re: bug in dal.py _first() and SQLFORM ._tablename

2010-04-10 Thread mdipierro
First of all thank you for your through tests into the DAL. I worked into this specific issue and I fixed the discrepancy. It deserves an explanation anyway. Here is a minimal example to reproduce the problem: code db.define_table('b', Field('b')) db.define_table('c', Field('d')) print db()

[web2py] Re: more than 1000 records on GAE

2010-04-10 Thread howesc
2 things: 1. i've not observed this limit when running queries on GAE. i've gotten as many as 14,000 records back when running in the production environment. though it runs way too slow, and i end up eating up my 30 seconds. 2. somewhere (i can't remember where) a paging technique was suggested

[web2py] Encoding using as_dict not using UTF-8?

2010-04-10 Thread Tito Garrido
Hi Folks, I'm not sure why but when I'm using as_dict function in a row element it's not returning UTF-8 characters an example: db.define_table('evento', SQLField('dono','reference auth_user',writable=False,readable=False), SQLField('paciente', 'reference paciente', label='Paciente*'),

[web2py] Re: more than 1000 records on GAE

2010-04-10 Thread mdipierro
it requires using cursor. DAL select requires fetching all records. The issue it, can we retrieve more than 1000 records looping over them using cursor instead of using fetch? I have not tried but my impression is that there is a tradeoff. we overcome a limitation (1000 records) by requiring more c

[web2py] Re: more than 1000 records on GAE

2010-04-10 Thread Richard
I've used it via webapp. Can this somehow be used via the DAL? On Apr 10, 2:32 pm, mdipierro wrote: > Here is says more about it > > http://code.google.com/appengine/docs/python/datastore/queriesandinde... > > It looks like you can return more than 1000 but in different requests > (in the exampl

Re: [web2py] Re: csv download: how to do it

2010-04-10 Thread Thadeus Burgess
Hi Johann, Make sure to set the content-disposition header if you would like to set the filename. Also, the filename extension has to match your content-type or the browser might reject it, however that depends on the browser. -- Thadeus On Sat, 2010-04-10 at 23:56 +0200, Johann Spies wrote: >

[web2py] Is this a possible bug?

2010-04-10 Thread Matt
Hi there, I'm attempting validate a multiple select against a set of values. I.e. def test(): form = FORM(INPUT(_name='title', requires=IS_NOT_EMPTY()), SELECT([1,2], _name='locations', _multiple='multiple', requires=IS_IN_SET([1,2], multiple=True, error_message='Please select

Re: [web2py] Re: Flatpages plugin

2010-04-10 Thread Mariano Reingart
On Sat, Apr 10, 2010 at 6:27 PM, Christopher Steel wrote: > WoW! > > Mariano, this totally rocks! Massimo, thanks for pointing this awesome > plugin out to me! > > I am trying to figure out how to get it working with French and > English like on http://www.sistemasagiles.com.ar  with the menu > tr

[web2py] Re: csv download: how to do it

2010-04-10 Thread mdipierro
There are a few issues here. if the browser asks for a download name depends on the browser settings, not the server code. you can only propose a name to the browser response.headers['Content-Disposition''='attachment; filename=myfile.csv' You do not need a view unless you return a dict(). O

Re: [web2py] Re: csv download: how to do it

2010-04-10 Thread Johann Spies
On 11 April 2010 00:38, mdipierro wrote: > One thing I see is that > > > db(request.vars.query).select(db.sarua.All,limitby(1,250)).export_to_csv_file(s) > > should be > > > db(request.vars.query).select(db.sarua.ALL,limitby=(0,250)).export_to_csv_file(s) > Thanks. That was careless typing from

[web2py] Re: csv download: how to do it

2010-04-10 Thread mdipierro
One thing I see is that db(request.vars.query).select(db.sarua.All,limitby(1,250)).export_to_csv_file(s) should be db(request.vars.query).select(db.sarua.ALL,limitby=(0,250)).export_to_csv_file(s) On Apr 10, 4:56 pm, Johann Spies wrote: > I have this in my view: > > >    Download as csv

[web2py] Re: Authentication: form just refreshes, won't validate login

2010-04-10 Thread hamdy.a.farag
Hi Keith Edmunds , This's most likely to happen if you've more than one form in the same page so the question is , do you've another form inside the page ? -- To unsubscribe, reply using "remove me" as the subject.

Re: [web2py] Re: csv download: how to do it

2010-04-10 Thread Johann Spies
I have this in my view: Download as csv-file And this controller: def csv(): import cStringIO s=cStringIO.StringIO() response.headers['Content-Type']='application/vnd.ms-excel' db(request.vars.query).select(db.sarua.All,limitby(1,250)).export_to_csv_file(s) return s.getvalu

[web2py] Re: Flatpages plugin

2010-04-10 Thread Christopher Steel
WoW! Mariano, this totally rocks! Massimo, thanks for pointing this awesome plugin out to me! I am trying to figure out how to get it working with French and English like on http://www.sistemasagiles.com.ar with the menu translations. The flatplugin encapsulated exactly what I was trying to do i

[web2py] Re: Old versions of web2py

2010-04-10 Thread mdipierro
I have to comment Yarko for insisting about this issue. He has raised it before I simply did not understand because of my ignorance in using version control systems. Code examples talk to me more than thousand words. I will start follow the new process by monday. Massimo On Apr 10, 12:01 pm, Andr

Re: [web2py] Re: csv download: how to do it

2010-04-10 Thread Johann Spies
Thanks for the explanation Yarko and Vasile. I will try it out and ask more if I don't succeed. Regards Johann -- "Finally, brethren, whatsoever things are true, whatsoever things are honest, whatsoever things are just, whatsoever things are pure, whatsoever thingsare lovely, whatsoev

[web2py] Authentication: form just refreshes, won't validate login

2010-04-10 Thread Keith Edmunds
I'm having a problem with authentication. This was working, but now when I enter email and password and click Submit, the form refreshes (removing the email and password) but doesn't authenticate. DB tables for user look good. What's the best way to debug this? Thanks for hints... -- To unsub

Re: [web2py] Re: How to by-pass user/login page for authentication

2010-04-10 Thread aure
I get error 404. I have just tried to do it as Thadeus mentioned: my index controller now ends with: return dict(auth_form=auth()) Unfortunately it gives me error 404 when I try to access my index view. Yet I have no problem accessing the login page... Has someone any idea what the problem cou

Re: [web2py] Re: csv download: how to do it

2010-04-10 Thread Vasile Ermicioi
db.export_to_csv_file(s) exports database to a file cStringIO is a in memory file, it is a standard python module/class http://docs.python.org/library/stringio.html and at the end you get the value from it (a big string) -- To unsubscribe, reply using "remove me" as the subject.

[web2py] Re: csv download: how to do it

2010-04-10 Thread Yarko Tymciurak
On Apr 10, 12:40 pm, Johann Spies wrote: > I do not understand the code in the manual and what I have seen on > this list about csv-downloads. > > I don't have a problem to do csv-export from the commandline in a > shell.  I just cannot figure out how the examples I referred to work > in a MVC -en

[web2py] csv download: how to do it

2010-04-10 Thread Johann Spies
I do not understand the code in the manual and what I have seen on this list about csv-downloads. I don't have a problem to do csv-export from the commandline in a shell. I just cannot figure out how the examples I referred to work in a MVC -environment. Take for example this export function (ta

Re: [web2py] Re: Old versions of web2py

2010-04-10 Thread Andrew Thompson
On 4/10/2010 11:26 AM, mdipierro wrote: Yes this is helpful. Now I understand much better what you were saying. I will definitively do that! Thanks you Yarko. massimo I just wanted to comment that I'm happy to see a positive response from a project lead for a process change/improvement re

[web2py] Re: Old versions of web2py

2010-04-10 Thread Yarko Tymciurak
also, be sure to try the command to list the current tags: $ hg tags Notice: it's more than the .hgtags file On Apr 10, 11:08 am, Yarko Tymciurak wrote: > FYI - I have used "INIT" and "INITIAL" interchangeably;  they _should_ > be the same string > (I used the shorter "INIT" in what I really d

[web2py] Re: Old versions of web2py

2010-04-10 Thread Yarko Tymciurak
FYI - I have used "INIT" and "INITIAL" interchangeably; they _should_ be the same string (I used the shorter "INIT" in what I really did on my computer, and sometimes forgot to change when I copied). On Apr 10, 10:58 am, Yarko Tymciurak wrote: > On Apr 10, 10:26 am, mdipierro wrote: > > > Yes t

[web2py] Re: Old versions of web2py

2010-04-10 Thread Yarko Tymciurak
On Apr 10, 10:26 am, mdipierro wrote: > Yes this is helpful. Now I understand much better what you were > saying. I will definitively do that! > Thanks you Yarko. Glad you found this helpful. I'll also add / continue the example a little: If you want to UNDO a re-tag (let's say you change your

[web2py] Re: Old versions of web2py

2010-04-10 Thread Yarko Tymciurak
On Apr 10, 10:26 am, mdipierro wrote: > Yes this is helpful. Now I understand much better what you were > saying. I will definitively do that! > Thanks you Yarko. Glad you found this helpful. I'll also add / continue the example a little: If you want to UNDO a re-tag (let's say you change your

[web2py] Re: Old versions of web2py

2010-04-10 Thread mdipierro
Yes this is helpful. Now I understand much better what you were saying. I will definitively do that! Thanks you Yarko. massimo On Apr 10, 10:15 am, Yarko Tymciurak wrote: > On Apr 9, 11:28 pm, mdipierro wrote: > > > I need to be educated. Here is my problem. > > Ok - this is rather simple...  I

[web2py] Re: Old versions of web2py

2010-04-10 Thread Yarko Tymciurak
On Apr 9, 11:28 pm, mdipierro wrote: > I need to be educated. Here is my problem. Ok - this is rather simple... I can help... > > I gave myself a rule of tagging releases as 1.XX.YY. The fact is that > I commit before I build the binaries. It occasionally happens that I > commit 1.XX.YY, build

[web2py] Re: Self join query missing AS

2010-04-10 Thread mdipierro
I would do db(db.question.id.belongs(db(db.keyword.keyword=='this'))._select(db.keyword.question)) (db.question.id.belongs(db(db.keyword.keyword=='that'))._select(db.keyword.question)).select(db.problem.ALL) It will be faster. On Apr 10, 8:31 am, Paul Wray wrote: > Thanks for your reply > > The

[web2py] Re: more than 1000 records on GAE

2010-04-10 Thread mdipierro
Here is says more about it http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Query_Cursors It looks like you can return more than 1000 but in different requests (in the example they are retrieving 1000, then cache the cursor location and, then fecth another 1000). Mas

[web2py] Re: Self join query missing AS

2010-04-10 Thread Paul Wray
Thanks for your reply The SQL I wish to produce is: 'SELECT question.* FROM question, keyword as k2, keyword as k1 WHERE ((k1.keyword="this") AND (k2.keyword="that") AND (k1.question=k2.question) AND (k1.question=question.id))' That is, find all questions that have both the keyword 'this' and the

[web2py] more than 1000 records on GAE

2010-04-10 Thread Richard
GAE supports accessing beyond 1000 records with the cursor: http://code.google.com/appengine/docs/python/datastore/gqlqueryclass.html#GqlQuery_with_cursor Can this somehow be used via the DAL? -- To unsubscribe, reply using "remove me" as the subject.

Re: [web2py] Re: Our membership is steadily growing!

2010-04-10 Thread Vasile Ermicioi
I would start a cookbook -- To unsubscribe, reply using "remove me" as the subject.

[web2py] Re: Our membership is steadily growing!

2010-04-10 Thread Magnitus
>Project for the summer: manual 3rd edition.< Yes! That would be awesome. Thank you :). -- To unsubscribe, reply using "remove me" as the subject.