[web2py] mail plain text message wrong charset

2010-02-17 Thread szimszon
Hello! I like to send email with: context=dict(...) message=response.render( 'template.txt', context ) mail.send( to = ['some email'], subject = 'proba', message = message,

[web2py] Re: one cool website

2010-02-17 Thread Benigno
Indeed I have... again, same thing we are about to change it, and a huge list of priorities on top.. thanks though for pointing it out. Benigno. On Feb 15, 11:44 pm, snfctech wrote: > @Benigno: You've probably already noticed, but your Blog is full of > spam. > > On Feb 15, 1:39 am, Benigno wro

[web2py] Re: new GIL bug

2010-02-17 Thread Graham Dumpleton
On Feb 17, 5:24 pm, mdipierro wrote: > You are right this not a reason not to move. The main reason is > backward compatibility. In general 3.x seems to be slower than 2.x for > data intensive processes. Am I wrong? The Python 3.X stream is getting better performance wise and the GIL changes th

Re: [web2py] Re: crud.read()

2010-02-17 Thread Johann Spies
> You get "admin  request  session  response " because you did not > define a view so you have a generic one. You need a view Thanks. I could not understand that my view was ignored by web2py. After your email I checked again and found that I left out the 'default/' when I created it. Regards Jo

[web2py] Bought the book from lulu a while ago, can I get the new version.

2010-02-17 Thread griffgruff
Hi, I bought the web2py book a while ago from lulu ( I got the pdf version ). I would like the new updated version if possible. Does anyone know how I can get the updated version? Do I have to buy it again? thanks for any help -- You received this message because you are subscribed to the G

[web2py] Custom functions in Model

2010-02-17 Thread JAY
Execute functions in Model Hi Guys, first i´ve to say i am n(oob)ew to Python and Database things, so please be patient. Is there any general way to execute custom functions in Model, which not only validate and how to implement them? I´ll try to explain with a few examples: First the simple o

[web2py] Re: An enhanced BEAUTIFY class

2010-02-17 Thread John Heenan
The code I posted does not replace the normal behaviour of BEAUTIFY. There is choice. In the four line example code I posted (which is from a web2py slice) the keys are only changed if the second character is an underscore. I accept there is little enthusiasm. It is ironic because I think there is

[web2py] Re: An enhanced BEAUTIFY class

2010-02-17 Thread John Heenan
Thanks for your comments Thadeus. As mentioned to Massimo, the normal behaviour of BEAUTIFY is not altered by the sample code. John Heenan On Feb 17, 1:08 pm, Thadeus Burgess wrote: > I will say this, it is alot better, because you can hardly even tell > it is a prototyping table, it could in ce

Re: [web2py] Custom functions in Model

2010-02-17 Thread Tiago Almeida
Why does everything need to work from model? Is it some requirement? Can't you do a function that takes the form and implements that logic? you can probably make it so that you pass that function to the onvalidation (or something like that) of the form.accepts.. Regards, Tiago On Wed, Feb 17,

[web2py] Re: Custom functions in Model

2010-02-17 Thread selecta
> I have a table with 2 fields: > db.define_table("table1", >     Field("field1", "string"), >     Field("field2", "string")) > > field1 is required so there should be two options: > 1. the user enters something in field1 and field2 > 2. the user enters something in field1 and leaves field2 blank

[web2py] Re: routes for subdomain

2010-02-17 Thread Wikus van de Merwe
To get what you want you could use this two rules for routes_in: ('.*:https?://domain\.com:get /([a-z]+)/(.*)', r'/init/public/\1/\2') ('.*:https?://([a-z]+)\.domain\.com:get /(.*)', r'/init/\1/\2') See the full doctest example: http://pastebin.com/fe773b3c However, I'm not sure if this is a comp

[web2py] Re: Custom functions in Model

2010-02-17 Thread JAY
Hi, yes i think it is an requirement... because in my scenario the input for the first field is entered either by user via the form or by an script which only inserts this single value and the other field vlaues should be automatic generated by the functions in my Model. But may i be wrong? and t

[web2py] Re: Bought the book from lulu a while ago, can I get the new version.

2010-02-17 Thread mdipierro
The latest published it the 2nd ed. The one that is now online. On Feb 17, 4:01 am, griffgruff wrote: > Hi, > > I bought the web2py book a while ago from lulu ( I got the pdf > version ). > > I would like the new updated version if possible. > > Does anyone know how I can get the updated version?

[web2py] Re: An enhanced BEAUTIFY class

2010-02-17 Thread mdipierro
Let me take a second look... On Feb 17, 5:53 am, John Heenan wrote: > Thanks for your comments Thadeus. As mentioned to Massimo, the normal > behaviour of BEAUTIFY is not altered by the sample code. > > John Heenan > > On Feb 17, 1:08 pm, Thadeus Burgess wrote: > > > I will say this, it is alot

Re: [web2py] Re: routes for subdomain

2010-02-17 Thread Jonathan Lundell
On Feb 17, 2010, at 5:38 AM, Wikus van de Merwe wrote: > To get what you want you could use this two rules for routes_in: > ('.*:https?://domain\.com:get /([a-z]+)/(.*)', r'/init/public/\1/\2') > ('.*:https?://([a-z]+)\.domain\.com:get /(.*)', r'/init/\1/\2') > > See the full doctest example: htt

[web2py] storing a Python list

2010-02-17 Thread Carl
I have a Python list that I want to store and retrieve from the data store. The individual items of the list are of no use unless used with the items of the complete list and there are no use-cases requiring searching for a specified list item. The number of items in the list is between one and fi

Re: [web2py] Re: first gae app

2010-02-17 Thread Wes James
OK. That field is a text field on gae now, how do I change it to gae.StringListProperty type? On Tue, Feb 16, 2010 at 9:50 PM, mdipierro wrote: > You are mixing gae syntax and dal syntax. > > This is only allowed in > > from gluon.contrib.gql import gae > db.define_table('mytable',Field('this_is

[web2py] Re: storing a Python list

2010-02-17 Thread JorgeRpo
On Feb 17, 10:47 am, Carl wrote: > I have a Python list that I want to store and retrieve from the data > store. > > The individual items of the list are of no use unless used with the > items of the complete list and there are no use-cases requiring > searching for a specified list item. The nu

[web2py] Re: optgroup support

2010-02-17 Thread DenesL
Problem is that you can not use TAG.optgroup because it does not work with the SELECT helper. Here is a little example: def index(): OG=TAG.OPTGROUP g1=[ OPTION( r.name, _value=r.id ) for r in db(db.person.age<=30).select() ] g2=[ OPTION( r.name, _value=r.id ) for r in db(db.person.a

[web2py] typos on web2py online introduction page

2010-02-17 Thread Todd
Hi, I found several typos on the introduction page: under Funding Issues: "Alhtought" should be "Although" under "Disclamers" "Disclamers" should be "Disclaimers" "althought" should be "although" "API" could be "APIs" since it's referred to in plural later on in that sentence "amy"

[web2py] Possible to separate app and appadmin files?

2010-02-17 Thread J.R.
Disclaimer: I have never been apart of a mailing list or google group so please excuse me if this is not the right place to post this. I have just started a few web apps with Web2Py and everything is working great. My question is more of organization than anything else. Not anything major at all

[web2py] Re: first gae app

2010-02-17 Thread mdipierro
As far as web2py is concerned you just change the type. As far as GAE is concerned I do not know. Try and see what happens. On Feb 17, 9:56 am, Wes James wrote: > OK.  That field is a text field on gae now, how do I change it to > gae.StringListProperty type? > > On Tue, Feb 16, 2010 at 9:50 PM,

[web2py] Re: optgroup support

2010-02-17 Thread mdipierro
true. Use TAG.select On Feb 17, 10:06 am, DenesL wrote: > Problem is that you can not use TAG.optgroup because it does not work > with the SELECT helper. > > Here is a little example: > > def index(): >     OG=TAG.OPTGROUP >     g1=[ OPTION( r.name, _value=r.id ) for r in > db(db.person.age<=30).

[web2py] Re: Possible to separate app and appadmin files?

2010-02-17 Thread mdipierro
This is perfectly appropriate. admin files are in a separate folder (applications/admin). appadmin files are in you app but there is only two of them (controllers/appadmin.py and views/appadmin.html). The reason they are in your app is because they belong to id and you are welcome to customize th

[web2py] Re: typos on web2py online introduction page

2010-02-17 Thread mdipierro
Please register, email me and I make you editor. If other people want to be editors, please email as well. On Feb 17, 9:55 am, Todd wrote: > Hi, I found several typos on the introduction page: > > under Funding Issues: > >   "Alhtought" should be "Although" > > under "Disclamers" > >   "Disclamer

Re: [web2py] Re: Custom functions in Model

2010-02-17 Thread Thadeus Burgess
You might have to do both, if there is a way to determine if the script is being called, then use compute, and if it is a form submission use the onvalidation of the form. -Thadeus On Wed, Feb 17, 2010 at 6:31 AM, JAY wrote: > Hi, > > yes i think it is an requirement... > because in my scena

Re: [web2py] Re: routes for subdomain

2010-02-17 Thread Jonathan Lundell
On Feb 16, 2010, at 10:38 PM, Thadeus Burgess wrote: > example.com/controllerA/function1 -> /init/controllerA/function1 > example.com/controllerA/function2 -> /init/controllerA/function2 > example.com/controllerB/function1 -> /init/controllerB/function1 > example.com/controllerB/function2 -> /init

Re: [web2py] Re: An enhanced BEAUTIFY class

2010-02-17 Thread Jonathan Lundell
On Feb 17, 2010, at 3:49 AM, John Heenan wrote: > The code I posted does not replace the normal behaviour of BEAUTIFY. > There is choice. In the four line example code I posted (which is from > a web2py slice) the keys are only changed if the second character is > an underscore. > > I accept ther

Re: [web2py] Re: typos on web2py online introduction page

2010-02-17 Thread Jonathan Lundell
On Feb 17, 2010, at 8:19 AM, mdipierro wrote: > Please register, email me and I make you editor. If other people want > to be editors, please email as well. Are we ready to start editing live, then? > > On Feb 17, 9:55 am, Todd wrote: >> Hi, I found several typos on the introduction page: >>

[web2py] Re: optgroup support

2010-02-17 Thread DenesL
So for future reference: you can create OPTGROUPs with TAG.OPTGROUP but do NOT use it with the SELECT helper, you must use TAG.SELECT as in the following example: def index(): OG=TAG.OPTGROUP g1=[ OPTION( r.name, _value=r.id ) for r in db(db.person.age<=30).select() ] g2=[ OPTION(

Re: [web2py] Re: first gae app

2010-02-17 Thread Wes James
After some changes when I try to add an entity on gae through their interface, the StringListProperty field does not even show for me to put data in it. If I edit a record that already has some data, the StringListProperty field has [] in it, but if I leave it blank or add some data like ['a','b']

[web2py] [where to put feature suggestions?] off-line visual DB design tool

2010-02-17 Thread snfctech
Where do we put feature suggestions? I was going to check the wiki but it appears to be down, at the moment. I saw Google had a set-up for feature suggestions that allowed users to vote - not sure if we can do that with the wiki. I wanted to suggest something like a visual schema design tool, ma

[web2py] Re: Possible to separate app and appadmin files?

2010-02-17 Thread J.R.
Now don't I feel silly for not just trying that out. I just assumed those files were needed for appadmin. Thanks, J.R. P.S. - I know this is off-topic but as a recent graduate from DePaul (MBIT) I wish I was more aware of you and this project when I was there. I felt like I was the only Python

Re: [web2py] Re: routes for subdomain

2010-02-17 Thread Thadeus Burgess
Thank you everyone! Finally. Wikus van de Merew your a genius. The following routes does it, and if you try to access example.com/dashboard you get a 404. The only change I needed to make was to wildcard the GET/POST at the end. routes_in = ( ('.*:/favicon.ico', '/init/static/favicon.i

[web2py] Re: storing a Python list

2010-02-17 Thread Carl
thanks Jorge; most helpful in pointing me in the right direction. The python to pickle is simply; for example: import pickle flat_retort = pickle.dumps(retort) and to unpickle; for example: import pickle options = pickle.loads(rows[0].retort) On Feb 17, 3:57 pm, JorgeRpo wrote:

Re: [web2py] Re: first gae app

2010-02-17 Thread Wes James
I removed all the data and tweaked the model a bit so all it looks like is: if request.env.web2py_runtime_gae: db = DAL('gae') session.connect(request, response, db=db) # and store sessions and tickets there else: db = DAL('sqlite://storage.sqlite') from gluon.tools import * crud=Crud

[web2py] Re: storing a Python list

2010-02-17 Thread spiffytech
I'm serializing with Pickle in my app, but it's a hassle to dump/load the data every time I mess with it. Is there a way to make the serializing happen automatically with DB access? -Brian On Feb 17, 1:46 pm, Carl wrote: > thanks Jorge; most helpful in pointing me in the right direction. > > Th

Re: [web2py] Re: storing a Python list

2010-02-17 Thread Thadeus Burgess
Could you write a function that handles the inserts/selects instead? class MY_PICKLE(): @classmethod def get(keyname): pkldump = db(db.pickle_table.keyname == keyname).select().first() return pickle.loads(pkldump.value) @classmethod def save(keyname, value):

Re: [web2py] Re: routes for subdomain

2010-02-17 Thread Jonathan Lundell
On Feb 17, 2010, at 9:57 AM, Thadeus Burgess wrote: > Thank you everyone! Finally. > > Wikus van de Merew your a genius. > > The following routes does it, and if you try to access > example.com/dashboard you get a 404. This is a good solution in your case because it's easy to specify the other

[web2py] Re: An enhanced BEAUTIFY class

2010-02-17 Thread mdipierro
I looked again. You try to achieve two things: 1) As you say if the key starts with a_, this is removed. This is a trick to make sure elements are sorted as you like them. 2) You capitalize the words and replace _ with spaces. I think these are wrong solution to the problem. Look into trunk. The

[web2py] Re: typos on web2py online introduction page

2010-02-17 Thread mdipierro
yes On Feb 17, 10:39 am, Jonathan Lundell wrote: > On Feb 17, 2010, at 8:19 AM, mdipierro wrote: > > > Please register, email me and I make you editor. If other people want > > to be editors, please email as well. > > Are we ready to start editing live, then? > > > > > On Feb 17, 9:55 am, Todd w

[web2py] Re: off-line visual DB design tool

2010-02-17 Thread mdipierro
Please make a new wiki page suggestions, attacked to preface. On Feb 17, 11:00 am, snfctech wrote: > Where do we put feature suggestions?  I was going to check the wiki > but it appears to be down, at the moment. > > I saw Google had a set-up for feature suggestions that allowed users > to vote -

[web2py] Re: Possible to separate app and appadmin files?

2010-02-17 Thread mdipierro
No but everything is there serves a purpose. generic.* for example. Even if you are not using them, you may be using them in the future. On Feb 17, 11:39 am, "J.R." wrote: > Now don't I feel silly for not just trying that out. I just assumed > those files were needed for appadmin. > > Thanks, > >

[web2py] Re: first gae app

2010-02-17 Thread mdipierro
because now db.table.insert(yourlistfield=.) has to be a list. You need to create a validator that takes the input and filters it into a list. I cannot write that for you since it depends on how you insert the data. On Feb 17, 12:57 pm, Wes James wrote: > I removed all the data and tweaked

Re: [web2py] Re: first gae app

2010-02-17 Thread Wes James
I'm noticing now why this is a problem. When I put [] in the field and submit it, it gets processed and comes out '[]' instead of just []. If it is a StringListProperty, shouldn't that come out [] not '[]'? -wes On Wed, Feb 17, 2010 at 1:57 PM, mdipierro wrote: > because now > > db.table.inser

Re: [web2py] Re: first gae app

2010-02-17 Thread Wes James
line 934 in sqlhtml.py On Wed, Feb 17, 2010 at 2:10 PM, Wes James wrote: > I'm noticing now why this is a problem.  When I put [] in the field > and submit it, it gets processed and comes out '[]' instead of just > [].  If it is a StringListProperty, shouldn't that come out [] not > '[]'? > > -we

[web2py] To book editors...

2010-02-17 Thread mdipierro
I made some of you editors (if you are not and want to be just ask) Please follow these few rules: - Try use wiki instead of editing book section - Do not rearrange or edit text in book sections (*) but limit yourself to - Fix errors - Add paragraphs about new features - If you save many times go

[web2py] Re: AutocompleteWidget: experimental, magic, RFC

2010-02-17 Thread ecall
Thanks for this nice feature. How can I make it run with ./dev_appserver.py (development for gae)? So far, I have this: File "/workspace/google_appengine/src/google/appengine/api/ datastore.py", line 2172, in _GetCompleteKeyOrError raise datastore_errors.BadKeyError('Key %r is not c

[web2py] Re: Possible to separate app and appadmin files?

2010-02-17 Thread J.R.
Actually when I restarted the server, after having moved all of the default files out of myapp/views and myapp/static, and tried to access appadmin, the appadmin site would not work. The appadmin controller is trying to load the views (an in turn static files). So I could not simply remove those

Re: [web2py] To book editors...

2010-02-17 Thread Thadeus Burgess
if you delete a intermediate version (say you had a typo) will you still be able to diff with latex correctly? The diff shows with the previous versions that are now deleted. -Thadeus On Wed, Feb 17, 2010 at 3:11 PM, mdipierro wrote: > ou save many times go to the "log" page (bottom of secti

Re: [web2py] Re: Possible to separate app and appadmin files?

2010-02-17 Thread Thadeus Burgess
appadmin.html does not use any static files. appadmin.html does however inherit from layout.html, which layout.html does use static files. -Thadeus On Wed, Feb 17, 2010 at 3:39 PM, J.R. wrote: > Actually when I restarted the server, after having moved all of the > default files out of myapp

[web2py] wiki?

2010-02-17 Thread Jonathan Lundell
Where's the web2py wiki these days? The link on the main page isn't working. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsu

Re: [web2py] Re: first gae app

2010-02-17 Thread Wes James
So I have been working on a validator and trying to simply make a list from a string. a="['a','b']" b=a[1:-1].split(',') returns [ " 'a' "," 'b' " ] Is there a simpler way? On Wed, Feb 17, 2010 at 1:57 PM, mdipierro wrote: > because now > > db.table.insert(yourlistfield=.) > > has to be

[web2py] Re: AutocompleteWidget: experimental, magic, RFC

2010-02-17 Thread mdipierro
I have never seen this error. Can you show the relavant code and the complete traceback? On Feb 17, 3:58 pm, ecall wrote: > Thanks for this nice feature. > > How can I make it run with ./dev_appserver.py (development for gae)? > > So far, I have this: >   File "/workspace/google_appengine

[web2py] Re: To book editors...

2010-02-17 Thread mdipierro
You are correct. The system prevents you from deleting the original. I only need to diff with that. I will write a program for that but I have not done it yet. On Feb 17, 4:06 pm, Thadeus Burgess wrote: > if you delete a intermediate version (say you had a typo) will you > still be able to diff w

[web2py] Re: Possible to separate app and appadmin files?

2010-02-17 Thread mdipierro
I think I misunderstood which files you refer to. You can delete layout.html but you need to provide a layout, or edit appadmin.html and remove {{extend 'layout.html'}} and add and . On Feb 17, 3:39 pm, "J.R." wrote: > Actually when I restarted the server, after having moved all of the > defaul

[web2py] Re: wiki?

2010-02-17 Thread mdipierro
I think I messed up the DNS. I will try fix that although vps.net is doing the dns hosting now and I am not sure they support external ips. On Feb 17, 4:22 pm, Jonathan Lundell wrote: > Where's the web2py wiki these days? The link on the main page isn't working. -- You received this message bec

[web2py] Re: first gae app

2010-02-17 Thread mdipierro
In my todo list On Feb 17, 4:52 pm, Wes James wrote: > So I have been working on a validator and trying to simply make a list > from a string. > > a="['a','b']" > > b=a[1:-1].split(',') > > returns > > [ " 'a' "," 'b' " ] > > Is there a simpler way? > > On Wed, Feb 17, 2010 at 1:57 PM, mdipie

[web2py] Typo in the book?

2010-02-17 Thread Wayne
I wasn't sure if this should be posted to the book as a comment or added here. If this should go in the book I can add it there. In section 3.6 of the online book when editing db.py I believe there is a typo on line 16. When I enter the code shown in my app I receive the following error: Sy

[web2py] Re: Typo in the book?

2010-02-17 Thread mdipierro
There is a % that causes problems in the source and I have replaced it by \%. It works now. I think the latex js plugin is causing the problems. On Feb 17, 7:09 pm, Wayne wrote: > I wasn't sure if this should be posted to the book as a comment or > added here.  If this should go in the book I can

[web2py] Re: first gae app

2010-02-17 Thread Richard
On Feb 18, 9:52 am, Wes James wrote: > So I have been working on a validator and trying to simply make a list > from a string. > > a="['a','b']" > > b=a[1:-1].split(',') > > returns > > [ " 'a' "," 'b' " ] > > Is there a simpler way? eval? -- You received this message because you are subscribe

[web2py] Re: first gae app

2010-02-17 Thread mdipierro
n... class IS_LIST(): def __call__(self,value): return ([x.strip() for x in value.split(',')],None) def formatter(self,value): return ', '.join(value) Field('mylist',gae.StringListProperty(),requires=IS_LIST()) On Feb 17, 8:38 pm, Richard wrote: > On Feb 18, 9:

[web2py] Re: storing a Python list

2010-02-17 Thread spiffytech
That would work, calling MY_PICKLE functions everywhere seems like as much work as calling pickle functions. It would be nice if the pickling could be done transparently behind the scenes, so my controller code could be cleaner and less error-prone. -Brian On Feb 17, 2:34 pm, Thadeus Burgess wr

Re: [web2py] Re: storing a Python list

2010-02-17 Thread Thadeus Burgess
Well basically my idea was to make your own pickle class that would access the DAL and then pickle it. But your wanting to subclass the DAL that can pickle unless you used something like virtualfields ? -Thadeus On Wed, Feb 17, 2010 at 9:20 PM, spiffytech wrote: > nctions. It would be

[web2py] Re: storing a Python list

2010-02-17 Thread mdipierro
You should do: from gluon.sql import SQLCustomType pickle = SQLCustomType( type ='text', native ='text', encoder = (lambda x: cPickle.dumps(s)), decoder = (lambda x: cPikcle.loads(s)) ) Field('mypickle',pickle) SQLCustomField may

[web2py] Re: typos on web2py online introduction page

2010-02-17 Thread coolaid
If anyone needs proofreading on things related to web2py docs, please let me know. I'm offering the web2py community free proofreading services right now through my web2py app http://standardminds.com Just message me for the coupon code. On Feb 17, 12:53 pm, mdipierro wrote: > yes > > On Feb 17,

[web2py] Re: An enhanced BEAUTIFY class

2010-02-17 Thread John Heenan
Thanks Massimo The keyfilter example you provided does not work but this one does with the current BEAUTIFY in the trunk keyfilter=lambda key=' '.join([x.capitalize() for x in key[2:].split('_')]) if key[1]=='_' else key A typical view file is now {{extend 'layout.html'}} {{=BEAUTIFY(response._v