[web2py:18722] Re: Possible bug: cron doesn't work when deploy in a directory name with space inside

2009-03-29 Thread Iceberg
Hi Achipa, Sorry for delay in response. I managed to upgrade my Python2.4.4 to Python2.6.1 just now, so finally I can play web2py from source. Then I try your patch. The result is, mm, very strange. 1. First I am using Windows XP Home edition, Python 2.6.1, web2py source 1.59, ORIGINAL cron.

[web2py:18723] Re: How to hide the console window?

2009-03-29 Thread Iceberg
Hi Massimo, I spend some time on py2exe and web2py then have some proof-of-concept conclusion here. 1. web2py is using py2exe now, so it is easy for web2py to have an official "no-console" edition of web2py.exe. 2. Even better, we can build a traditional web2py.exe and a new web2py- no-console.

[web2py:18724] DAL feature request - index

2009-03-29 Thread Michal Jursa
Hi, last night i found there is no possibility to force DAL to create an index on some column. Sometimes it is necessary to select records not only by primary key and in that case index built on some other column should do the work better than full scans on database. So I suggest to implement

[web2py:18725] select tables in GAE

2009-03-29 Thread murray3
I have a wiki app which has problems when I try and run it in GAE SDK. Essentially it is a modifies version of the standard example wiki app from the web2py book. The GAE SDK throws an error when I try index view with the following model, controller, and error output from GAE model: db.define_ta

[web2py:18726] Re: select tables in GAE

2009-03-29 Thread murray3
I posted this when I got up - must have been still asleep as problem is withcreat function as it is not working there probably is nothing in db table to select? Here is code for create controller and subsequent error output from GAE. Controller: def create(): "creates a new empty wiki page"

[web2py:18727] Re: jyte vote

2009-03-29 Thread Yarko Tymciurak
:--) Glad you are enjoying it... On Sun, Mar 29, 2009 at 1:30 AM, Michael wrote: > > I put that up! :) > > I am in love with web2py! I've been a web designer for years, always > wanting to develop app ideas etc. I just never found the time to learn > php, or sql, etc. Once all these new framewo

[web2py:18728] unsubscriptable?

2009-03-29 Thread zeng leo
Hello all, I'm a new guy whit web2py, I have some problem when I Learn web2py! my controller code: def basic(): response.menu[['civilized',False,URL(r=request,f='civilized')], ['slick',False,URL(r=request,f='slick')], ['basic',True,URL(r=request,f='basic')

[web2py:18729] Re: Retrieve JSON message send to Server

2009-03-29 Thread mdipierro
Is it the same. URL is smart enough On Mar 28, 5:02 pm, Fran wrote: > On Mar 28, 9:38 pm, Yannick wrote: > > > URL(r=request,c='static/js',f='jquery-1.3.2.js') > > Should this not be: > URL(r=request,c='static',f='js',args=['jquery-1.3.2.js']) > > F --~--~-~--~~~---~

[web2py:18730] Re: Including files?

2009-03-29 Thread mdipierro
If I understand your issue... One way to do this is 1) put your master.css in applications/yourapp/private/ 2) create a controller action in default.py like def mastercss(): text=open(os.path.join(request.folder,'private/master.css') # replace the $(...) in text response.headers[

[web2py:18731] Re: select tables in GAE

2009-03-29 Thread mdipierro
Can I see the model for db.page On Mar 29, 6:37 am, murray3 wrote: > I posted this when I got up - must have been still asleep as problem > is withcreat function > as it is not working there probably is nothing in db table to select? > Here is code for create controller and subsequent error outp

[web2py:18732] Re: jyte vote

2009-03-29 Thread mdipierro
Thank Michael On Mar 29, 1:30 am, Michael wrote: > I put that up! :) > > I am in love with web2py! I've been a web designer for years, always > wanting to develop app ideas etc. I just never found the time to learn > php, or sql, etc. Once all these new frameworks popped out, i spend > tons of t

[web2py:18733] Re: unsubscriptable?

2009-03-29 Thread mdipierro
response.menu[['civilized',False,URL(r=request,f='civilized')], ['slick',False,URL(r=request,f='slick')], ['basic',True,URL(r=request,f='basic')]] should be response.menu=[['civilized',False,URL(r=request,f='civilized')], ['slick',

[web2py:18734] Re: Retrieve JSON message send to Server

2009-03-29 Thread Yannick
Thanks a lot for the note and helps I appreciate it... I added the callback on my ajax function... But I still have problem retrieving JSON data...Here is the sample example of the JSON converted to string that i pass to the Action class: { "Name": [ { "Key1": "value1", "key2":

[web2py:18735] Re: Retrieve JSON message send to Server

2009-03-29 Thread mdipierro
I think in the action you should do import gluon.contrib.simplejson as sj data=sj.loads(request.body.read()) # then data["Name"][0]["Key1"]=="value1" On Mar 29, 10:00 am, Yannick wrote: > Thanks a lot for the note and helps I appreciate it... I added the > callback on my ajax function... But I

[web2py:18736] Re: Auth via xml-rpc

2009-03-29 Thread Tito Garrido
Please let me know what approach you've used... On Fri, Mar 27, 2009 at 11:35 PM, mdipierro wrote: > > There is no standard mechanism for this. One would have to be created. > > On Mar 27, 9:48 am, Oliver Heyme wrote: > > If that's the case I will probably create my own auto mechanism! > > It w

[web2py:18737] Re: Including files?

2009-03-29 Thread Michael
Yes i think that is what I am looking for! :) Again, I am a newb programmer! But I wanted to develop a css/design toolkit for web2py, that I can plugin to my projects everytime so I don't have to add tons of static files, etc. I'm compiling a css file with a reset, blueprint grids, and tons of e

[web2py:18738] Re: Including files?

2009-03-29 Thread mdipierro
On Mar 29, 1:22 pm, Michael wrote: > Yes i think that is what I am looking for! :) > > Again, I am a newb programmer! But I wanted to develop a css/design > toolkit for web2py, that I can plugin to my projects everytime so I > don't have to add tons of static files, etc. > > I'm compiling a css

[web2py:18739] Need help with SQLFORMs

2009-03-29 Thread TheDude
Here's the code: http://pastie.org/private/wmow1xkoaov5ium6cgf8w Here's the problem: ok now a new problem let's say im building a mailbox application (not like email like a private messaging system) and int he table mailbox I have account_id (which account its tied to) On the SQLFORM it shows Acc

[web2py:18740] Re: Can't display certain fields, and baffled as to why... And one other little question...

2009-03-29 Thread Jason (spot) Brower
Gees, it was right in front of me. Thanks! Regards, Jason On Sat, Mar 28, 2009 at 3:24 PM, Vidul Petrov wrote: > > Hi Jason, > >    tags = db().select(db.tag.ALL,orderby=db.tag.name) >    users = db().select(db.users.ALL,orderby=db.users.nickname) >    tags = db.tag >    users = db.users > > sh

[web2py:18741] What is the latest book and when is the next one coming?

2009-03-29 Thread Jason Brower
I want to buy the book now that I want to make a business with this product. I couldn't find a link to the book on the website. Best Regards, Jason Brower --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web

[web2py:18742] Re: Need help with SQLFORMs

2009-03-29 Thread TheDude
I also would like to avoid running a query within the controller/ function of db(db.account.name==request.post.account_id) because I need this function in several places. :) On Mar 29, 3:19 pm, TheDude wrote: > Here's the code:http://pastie.org/private/wmow1xkoaov5ium6cgf8w > > Here's the proble

[web2py:18743] I want to make my website live now...

2009-03-29 Thread Jason Brower
I can't seem to connect to my site from other computers. Only from my localhost addresss (127.0.0.1:8000). I am using ubuntu linux 8.10. If I try from my wifes computer and browse to 192.168.0.30:8000 it doesn't work. But if I go to port 80 I get my apache webserver. If I try to connect to my si

[web2py:18744] Getting last item in a query?

2009-03-29 Thread Michael
I wasn't sure if when you do query = db().select(db.table.ALL) returns as an array of items? I am trying to get the last item added into the TABLE. I thought i could do: query = db().select(db.table.ALL) last = query[-1] return dict(last=last) but I am getting the following error: Traceback

[web2py:18745] Re: I want to make my website live now...

2009-03-29 Thread Vidul Petrov
Hi Jason, The startup script should be told to listen on all network interfaces: python web2py.py -i 0.0.0.0 On Mar 29, 10:36 pm, Jason Brower wrote: > I can't seem to connect to my site from other computers.  Only from my > localhost addresss (127.0.0.1:8000). > I am using ubuntu linux 8.10

[web2py:18746] Re: What is the latest book and when is the next one coming?

2009-03-29 Thread mdipierro
Happy to know you like it. http://www.lulu.com/content/4968879 Massimo On Mar 29, 2:25 pm, Jason Brower wrote: > I want to buy the book now that I want to make a business with this > product.  I couldn't find a link to the book on the website. > Best Regards, > Jason Brower --~--~-~--~

[web2py:18747] Re: Need help with SQLFORMs

2009-03-29 Thread mdipierro
You can use class NameValidator: def __init__(self,error_message='not in db'): self.error_message=error_message def __call__(self,name): users=db(db.users.name==name).select() if not users: return (name, self.error_message) return (users[0].id,None) def

[web2py:18748] Re: Getting last item in a query?

2009-03-29 Thread mdipierro
last = db().select(db.table.ALL).as_list()[-1] On Mar 29, 3:42 pm, Michael wrote: > I wasn't sure if when you do > > query = db().select(db.table.ALL) > > returns as an array of items? > > I am trying to get the last item added into the TABLE. I thought i > could do: > > query = db().select(db.t

[web2py:18749] Re: Can't display certain fields, and baffled as to why... And one other little question...

2009-03-29 Thread Yarko Tymciurak
2009/3/29 Jason (spot) Brower > > Gees, it was right in front of me. Thanks! > Regards, > Jason > > On Sat, Mar 28, 2009 at 3:24 PM, Vidul Petrov > wrote: > > > > Hi Jason, > > > >tags = db().select(db.tag.ALL,orderby=db.tag.name) > >users = db().select(db.users.ALL,orderby=db.users.nic

[web2py:18750] Re: Need help with SQLFORMs

2009-03-29 Thread TheDude
Worked like a charm thanks. :) Also taught me a few things heh ;) Btw, how was PyCon? On Mar 29, 5:25 pm, mdipierro wrote: > You can use > > class NameValidator: >     def __init__(self,error_message='not in db'): >         self.error_message=error_message >     def __call__(self,name): >      

[web2py:18751] Re: Pycon 2009 - Important

2009-03-29 Thread Baron
I am so jealous - wish I could be there too! On Mar 29, 12:45 am, TheDude wrote: > Let us know how it goes! :) Will there be a summary follow up? :D > > On Mar 28, 9:27 am, mdipierro wrote: > > > See you at the web2py booth after Guido's talk today. (free hats) > > > Please attend the web2py D

[web2py:18752] Re: select tables in GAE

2009-03-29 Thread murray3
Here it is I have commented much whilst testing for mistake thanks for any help chrism -- model: import uuid try: from gluon.contrib.gql import * # if running on Google App Engine except: db = SQLDB('sqlite://storage.db') # if not, use SQLite or other DB else: db = GQLD

[web2py:18753] Re: Getting last item in a query?

2009-03-29 Thread TheDude
Wouldn't last = db().select(db.table.ALL, orderby=~db.table.id, limit= (1,))[0] be better? Since this way only one row is being retrieved and less overhead? On Mar 29, 5:26 pm, mdipierro wrote: > last = db().select(db.table.ALL).as_list()[-1] > > On Mar 29, 3:42 pm, Michael wrote: > > > I wasn'

[web2py:18754] Re: Getting last item in a query?

2009-03-29 Thread Vidul Petrov
If you don't need a list, but just the last record, use the return value from insert: last_id =db.table.insert(item="some item") On Mar 30, 2:00 am, TheDude wrote: > Wouldn't last = db().select(db.table.ALL, orderby=~db.table.id, limit= > (1,))[0] be better? Since this way only one row is bein

[web2py:18755] Re: Need help with SQLFORMs

2009-03-29 Thread mdipierro
PyCon was great! I will post some more info soon. Massimo On Mar 29, 5:44 pm, TheDude wrote: > Worked like a charm thanks. :) Also taught me a few things heh ;) Btw, > how was PyCon? > > On Mar 29, 5:25 pm, mdipierro wrote: > > > You can use > > > class NameValidator: > >     def __init__(self

[web2py:18756] Re: Pycon 2009 - Important

2009-03-29 Thread mdipierro
yes. soon On Mar 28, 8:45 am, TheDude wrote: > Let us know how it goes! :) Will there be a summary follow up? :D > > On Mar 28, 9:27 am, mdipierro wrote: > > > See you at the web2py booth after Guido's talk today. (free hats) > > > Please attend the web2py Dojo tonight at 6pm in the Open Space.

[web2py:18757] Re: Getting last item in a query?

2009-03-29 Thread mdipierro
Yes much better! On Mar 29, 6:00 pm, TheDude wrote: > Wouldn't last = db().select(db.table.ALL, orderby=~db.table.id, limit= > (1,))[0] be better? Since this way only one row is being retrieved and > less overhead? > > On Mar 29, 5:26 pm, mdipierro wrote: > > > last = db().select(db.table.ALL).

[web2py:18758] Re: Getting last item in a query?

2009-03-29 Thread Michael
I don't get this? I am just trying to display the item added last to a table. For instance, i have a table of quotes. I would like to pass variables from that table, and the LAST record to my view. such as, return dict(author=author, quote=quote) But author, and quote should be from the last

[web2py:18759] Re: Getting last item in a query?

2009-03-29 Thread TheDude
last_id =db.table.insert(item="some item") this method is the best for you then (all cred to Vidul). Just change last_id to comment and then pass comment to the view and write down the variables that you need. :) Also, this is draginx from IRC, ask your questions there man I'll help you out aga

[web2py:18760] Re: Retrieve JSON message send to Server

2009-03-29 Thread Yannick
Thanks Massimo it works fine... you made my day :)... It was fine...Thanks this is all fun working on web2py. On Mar 29, 11:45 am, mdipierro wrote: > I think in the action you should do > > import gluon.contrib.simplejson as sj > data=sj.loads(request.body.read()) > # then data["Name"][0]["Key1

[web2py:18761] Would this patch be useful?

2009-03-29 Thread mr.freeze
It's basically a new global list, response.scripts, that is rendered in the jQuery(document).ready function so you can inject javascript from the controller. Massimo mentioned that it may go against MVC separation standards and wanted me to put it out here to get a few opinions. Sample usage: d

[web2py:18762] pycon 2009

2009-03-29 Thread mdipierro
Hi everybody, this is a very short summary of what happened at PyCon concerning web2py. I have a lightening talk on Saturday morning. 5 minutes only but I managed to give a demo. There was this panel discussion http://www.b-list.org/weblog/2009/mar/28/pycon-orm-panel/ and I think web2py looked

[web2py:18763] Re: Would this patch be useful?

2009-03-29 Thread Jason Brower
Good question. I like the idea as it gives us a nice place to put scripts and make them apply to the views we want very easily. so +1 on that! Regards, Jason Brower On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: > It's basically a new global list, response.scripts, that is rendered > in the j

[web2py:18764] Re: Would this patch be useful?

2009-03-29 Thread mdipierro
Some clarifications. Right now one can already do this in views by inserting somewhere: $(document).ready(function() { do_something(); }); Mr. Freeze's suggestions has pros and cons. In my opinion: Pros: - it is more compact Cons: - moves into the controller something that (usually) belo

[web2py:18765] Re: Would this patch be useful?

2009-03-29 Thread TheDude
This certainly breaks the MVC architecture, but it is valuable. I think web2py should be about being able to expand as much as possible without interfering the people who just want a small and easy framework (it can be a small plant or a big tree). I do like the idea of everything going into the s

[web2py:18766] Re: pycon 2009

2009-03-29 Thread Yarko Tymciurak
I personally want to thank Massimo for preparing the slides, and Wingware.com for providing a 3-O/S WingIDE-Pro liscense (Jon B. was the winner). The code sprints for PyCon2009 run this week - I'm going to participate after work (since I'm in the Chicago area)... there is a cherrypy sprint, and an

[web2py:18767] Re: Would this patch be useful?

2009-03-29 Thread Vidul Petrov
I find this object (response.scripts) very useful, especially if it's able to manipulate different HTML elements, not only after page load (__call__ modification?): response.scripts("$('#post')", "onclick", "$('#post .comments').css ({'value', 'sm.th.'})") Probably this breaks the MVC views' rul

[web2py:18769] Re: Would this patch be useful?

2009-03-29 Thread Yarko Tymciurak
I may be missing something here, but I do not see any compelling reason for this... but I do see compelling reasons against this... maybe someone can explain the rationale they see that lead to this suggestion. -y On Mon, Mar 30, 2009 at 1:22 AM, Vidul Petrov wrote: > > I find this object (resp

[web2py:18770] Re: pycon 2009

2009-03-29 Thread Yarko Tymciurak
On Mon, Mar 30, 2009 at 1:28 AM, TheDude wrote: > > Excellent! I wish there was a video, but I'm sure someone has it > somewhere on the internet. Good work on the dojo, the only thing I was > worried about is.. > > item = db.news_item[request.args[0]] Yes! - this was a quick introduction to the

[web2py:18771] Re: pycon 2009

2009-03-29 Thread Yarko Tymciurak
On Mon, Mar 30, 2009 at 1:38 AM, Yarko Tymciurak wrote: > On Mon, Mar 30, 2009 at 1:28 AM, TheDude wrote: > >> >> Excellent! I wish there was a video, but I'm sure someone has it >> somewhere on the internet. Good work on the dojo, the only thing I was >> worried about is.. >> >> item = db.news_

[web2py:18768] Re: pycon 2009

2009-03-29 Thread TheDude
Excellent! I wish there was a video, but I'm sure someone has it somewhere on the internet. Good work on the dojo, the only thing I was worried about is.. item = db.news_item[request.args[0]] If the request.args[0] tries to call from a non existant SQLRow then it'll throw an error :) Best to app

[web2py:18772] Re: Would this patch be useful?

2009-03-29 Thread notabene
Thumbs up. Very good idea! We have had the discussion around MVC. And the conclusion were, that there is no clear-cut border between MVC. No perfect or true division. (Java-) scripting functionality in controllers can ease the way for AJAX forms and functionality in views. On 30 Mar., 06:15, md