[web2py:20486] forms in web2py

2009-04-25 Thread Nazgi
Hi, I hav written a form in controller of my application. The form has a select option which based on its input uses ajax and calls a function. This function sends a json list object. How do I access that variable in order to incorporate the contents of that list as another select option m

[web2py:20487] Re: What does request.vars and session mean?

2009-04-25 Thread Pynthon Pynthon
So its for that not two people can has the same session_ID and cannot send the form? 2009/4/24 mdipierro > > It is optional. If it is there is associate a unique ID to each form > to prevent double form submission. > > Massimo > > On Apr 24, 2:02 pm, Pynthon wrote: > > Hahaha, sorry for my bad

[web2py:20488] Orderby

2009-04-25 Thread Pynthon
Hello I searched in the book but I can't find it. Im creating a blog with the small knowledge I have about W2P. Just for fun and to learn. I want to order it like this: 3 2 1 and not 1 2 3 The latest posts ion the head :P. How can I do this? Thanks, Pynthon --~--~-~--~~--

[web2py:20489] Re: Orderby

2009-04-25 Thread Mladen Milankovic
Hi. I'm assuming you have some query from where you take the posts. In the select part there's a parameter orderby. To give it to sort it in reverse order just write the sign ~ in front of the orderby parameter. example db(some_query).select(db.table.ALL, orderby = ~db.table.field) regards mml

[web2py:20490] Re: Orderby

2009-04-25 Thread Pynthon
Thanks man! Works perfect! Maybe I want this blog for my public site. But I also want to make an admin panel. How need I to make that? I know how to work with sessions. But can it also be safe? On Apr 25, 12:27 pm, Mladen Milankovic wrote: > Hi. > > I'm assuming you have some query from where yo

[web2py:20491] Re: Auth works on local host, doesn't work on remote server

2009-04-25 Thread Alexei Vinidiktov
On Sat, Apr 25, 2009 at 2:30 PM, Alexei Vinidiktov wrote: > Hello, > > I'm beginning to learn user authentication. I've implemented a very > basic authentication using the Auth module that works fine on my local > machine: I can register a user, a confirmation email is sent out, the > user can co

[web2py:20492] Re: Orderby

2009-04-25 Thread Mladen Milankovic
Hi. You can do something with the auth class. Here some tutorial about it. http://mdp.cti.depaul.edu/examples/default/tools You can expose only functions for login/logout. Create a user by hand, through web2py admin. Then create controllers/functions that requires authorization. For the safety

[web2py:20493] Re: Orderby

2009-04-25 Thread Pynthon
But I see that there is also with profiles etc. On Apr 25, 12:45 pm, Mladen Milankovic wrote: > Hi. > > You can do something with the auth class. > Here some tutorial about it.http://mdp.cti.depaul.edu/examples/default/tools > > You can expose only functions for login/logout. Create a user by ha

[web2py:20494] Re: Orderby

2009-04-25 Thread Pynthon
BTW, is there also something like a editor for my blog. Because HTML gets escaped and when I do enter it does not work :(. On Apr 25, 12:53 pm, Pynthon wrote: > But I see that there is also with profiles etc. > > On Apr 25, 12:45 pm, Mladen Milankovic wrote: > > > Hi. > > > You can do something

[web2py:20495] Re: Orderby

2009-04-25 Thread Mladen Milankovic
Hi. Yes there are. If you need more from the authorization you can expose those too, or all of them if you want to allow registration on the blog. Usually I work on things where registration isn't good thing, and I need only login and logout. If you want all the functions: def user(): return d

[web2py:20496] Re: Orderby

2009-04-25 Thread Pynthon
Hmm my posts were deleted. However, this is with profiles right? I just want a plain login/logout system :$. And is there also something like an editor. Because when I type my posts now I can't use enters because everything is escaped. And the for loop does not work: {{for post in posts:}} {{

[web2py:20497] Re: Orderby

2009-04-25 Thread Mladen Milankovic
Hi. For the html editor, wouldn't know to recommend. When you got the post for the blog, just put it into XML() helper. Like: XML(post) This way it won't be escaped. regards mmlado On Saturday 25 April 2009 12:54:44 Pynthon wrote: > BTW, is there also something like a editor for my blog. Becau

[web2py:20498] Re: Orderby

2009-04-25 Thread Mladen Milankovic
Hi. You'll need to add html for formating in the view. You can also add the XML helper if you want to have html code in the post. Like: {{for post in posts:}} {{=post.titel}} {{=post.time}} {{=XML(post.post)}} {{pass}} regards mmlado On Saturday 25 April 2009 13:0

[web2py:20499] Re: Orderby

2009-04-25 Thread Pynthon
Thanks, but I meant more something like the wiki markup language. On Apr 25, 1:07 pm, Mladen Milankovic wrote: > Hi. > > You'll need to add html for formating in the view. You can also add the XML > helper if you want to have html code in the post. Like: > > {{for post in posts:}} >       >    

[web2py:20500] Re: Documentation

2009-04-25 Thread Vidul Petrov
Yes the book is wonderful, the only problem I met is the format - pdf, it would be very useful if the book is in chm format, so that search and index tabs are available. I tried with different psd2chm converters, but they didn't work as expected. On Apr 24, 11:11 pm, JohnMc wrote: > I note that

[web2py:20501] Re: What does request.vars and session mean?

2009-04-25 Thread mdipierro
No. It is to avoid that the same person clicks twice by mistake (perhaps because the page is slow to load) and the form is processed twice. Think of [add chart] and when you click twice you add twice to chart by mistake. Massimo On Apr 25, 4:52 am, Pynthon Pynthon wrote: > So its for that not t

[web2py:20502] Re: Orderby

2009-04-25 Thread mdipierro
from gluon.contrib.markdown import WIKI {{=WIKI(text)}} On Apr 25, 6:17 am, Pynthon wrote: > Thanks, but I meant more something like the wiki markup language. > > On Apr 25, 1:07 pm, Mladen Milankovic wrote: > > > Hi. > > > You'll need to add html for formating in the view. You can also add th

[web2py:20503] seamless implicit memcache from Alkis Evlogimenos - on we2py?

2009-04-25 Thread dlypka
Is there a way to use this memcache 'shim' in a web2py app? If so, would I have to insert the calls in my web2py app source code, or do I have to modify a low level module in the web2py framework? Please give details if possible. Here is the posting link from Alkis Evlogimenos on the GAE forum:

[web2py:20504] Re: Can response.flash have different colors?

2009-04-25 Thread Iceberg
Oh, one more minor suggestion, shouldn't we add some description about this new feature into the build-in document of "example 6" in this page? http://www.web2py.com/examples/default/examples In fact I tried to write a couple more examples for Massimo to show the new "info" and "warn" class, bu

[web2py:20505] psycopg2-2.0.10 install linux ,help me

2009-04-25 Thread wengfei2...@163.com
[r...@localhost psycopg2-2.0.10]# python setup.py install running install running build running build_py running build_ext Traceback (most recent call last): File "setup.py", line 410, in ? ext_modules=ext) File "/usr/lib/python2.4/distutils/core.py", line 149, in setup dist.run_comman

[web2py:20506] Re: forms in web2py

2009-04-25 Thread newbie
in Controller/index.py: def getcities(): citystr = request.vars.values()[0] if citystr == "Delhi": output = "Hyderabad" elif citystr == "Tamil Nadu": output = "Chennai" elif citystr == "Andhra Pradesh": output = "Pune" else: output = "mumbai"

[web2py:20507] Need help with query on datetime field

2009-04-25 Thread weheh
# model db.define_table('a',SQLField('dts','datetime')) import datetime now=datetime.datetime.now() # this works db(db.a.dts > now).select(db.a.ALL) # this doesn't work db(db.a.dts.weekday() == now.weekday()).select(db.a.ALL) # this also doesn't work db(db.a.dts.day > now.day).select(db.a.ALL)

[web2py:20508] Adding [Try View] to Design options

2009-04-25 Thread mikech
Would it be possible to add a Try View to the Design page, rather than having to Edit then try view? Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send emai

[web2py:20509] Re: seamless implicit memcache from Alkis Evlogimenos - on we2py?

2009-04-25 Thread mdipierro
I do not know about this specific issue but in web2py can do from gluon.contrib.gae_memcache import MemcacheClient cache.ram=cache.disk=MemcacheClient(request) and then cache any query db(...).select(...,cache=(cache.ram,3000)) 3000 are ms Massimo On Apr 25, 6:29 am, dlypka wrote: > Is ther

[web2py:20510] Re: psycopg2-2.0.10 install linux ,help me

2009-04-25 Thread mdipierro
This looks like a psycopg issue. Mind that you need python 2.5 to run web2py. On Apr 25, 11:53 am, "wengfei2...@163.com" wrote: > [r...@localhost psycopg2-2.0.10]# python setup.py install > running install > running build > running build_py > running build_ext > Traceback (most recent call last)

[web2py:20511] Re: forms in web2py

2009-04-25 Thread mdipierro
Not sure I understand but you can try: def getcities(): citystr = request.vars.values()[0] if citystr == "Delhi": output = "Hyderabad" elif citystr == "Tamil Nadu": output = "Chennai" elif citystr == "Andhra Pradesh": output = "Pune" else: outpu

[web2py:20512] Re: Need help with query on datetime field

2009-04-25 Thread mdipierro
these will work: db(db.a.dts.day() > now.day).select(db.a.ALL) db(db.a.dts.month() > now.day).select(db.a.ALL) db(db.a.dts.year() > now.day).select(db.a.ALL) weekday() is not supported. Perhaps we can add it. Let me look into it. Massimo On Apr 25, 4:08 pm, weheh wrote: > # model > db.define_

[web2py:20513] Re: Adding [Try View] to Design options

2009-04-25 Thread mdipierro
Sorry I do not inderstand. You cannot try a view without an associated action. On Apr 25, 4:48 pm, mikech wrote: > Would it be possible to add a Try View to the Design page, rather than > having to Edit then try view? > > Mike --~--~-~--~~~---~--~~ You received th

[web2py:20514] Re: SQLFORM

2009-04-25 Thread Russell
You might want to look at this thread... http://groups.google.co.nz/group/web2py/browse_thread/thread/405c0bcfc6a2df2f It shows how you can have several "submit" buttons and then use your controller to dynamically determine the specific redirect. On Apr 25, 6:24 pm, jmverm...@xs4all.nl wrote:

[web2py:20515] Re: Request for more organize feature request lists...

2009-04-25 Thread Yarko Tymciurak
On Apr 20, 6:14 pm, Yarko Tymciurak wrote: > web2py Sphinx doc I think will be hosted on bitbucket - we noticed the > planned move of Python itself to mercurial, and this is where Sphinx and > some sphinx books are. > > We have discussed moving web2py and web2conf from launchpad to bitbucke

[web2py:20516] Re: Need help with query on datetime field

2009-04-25 Thread weheh
Thanks, Massimo. --~--~-~--~~~---~--~~ 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, send email to web2py+unsubsc

[web2py:20517] append/delete to SQLRow

2009-04-25 Thread weheh
Is there a way to append or delete a record to an SQLRow item? --~--~-~--~~~---~--~~ 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

[web2py:20518] Re: append/delete to SQLRow

2009-04-25 Thread mdipierro
I do not understand. You can append or delete from a Table. db.table.insert(field=value) db(db.table.field==value).delete() Massimo On Apr 25, 9:40 pm, weheh wrote: > Is there a way to append or delete a record to an SQLRow item? --~--~-~--~~~---~--~~ You receiv

[web2py:20519] Re: append/delete to SQLRow

2009-04-25 Thread weheh
Sorry, I wasn't clear. I want to do something like this: x=db(query0).select(db.table.ALL,orderby=something) x.append(db(query1).select(db.table.ALL,orderby=somethingelse)) I get an error message about not being able to append to an SQLRow object. --~--~-~--~~~---~--~

[web2py:20520] Re: append/delete to SQLRow

2009-04-25 Thread Álvaro Justen [Turicas]
On Sat, Apr 25, 2009 at 11:40 PM, weheh wrote: > Is there a way to append or delete a record to an SQLRow item? Why do you want that? Isn't there other way? -- Álvaro Justen Peta5 - Telecomunicações e Software Livre 21 3021-6001 / 9898-0141 http://www.peta5.com.br/ --~--~-~--~

[web2py:20521] Re: append/delete to SQLRow

2009-04-25 Thread Álvaro Justen [Turicas]
On Sun, Apr 26, 2009 at 12:14 AM, weheh wrote: > > Sorry, I wasn't clear. I want to do something like this: > > x=db(query0).select(db.table.ALL,orderby=something) > x.append(db(query1).select(db.table.ALL,orderby=somethingelse)) > > I get an error message about not being able to append to an SQL

[web2py:20522] Re: append/delete to SQLRow

2009-04-25 Thread weheh
Thanks Álvaro, that looks like it would do the trick. How did you learn this? Did you study the gluon code or did you read about this elsewhere? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" g

[web2py:20523] Want to make a feature, just would like some help on where to look...

2009-04-25 Thread Jason Brower
I want to add a feature to the error reporting section of the code. Where is that part of the code? In specific, I would like to add something to where it prints out the final code before running. (When an error happens.) --- Best Regards, Jason Brower --~--~-~--~~~-

[web2py:20524] Re: Auth works on local host, doesn't work on remote server

2009-04-25 Thread Alexei Vinidiktov
On Sat, Apr 25, 2009 at 6:32 PM, Alexei Vinidiktov wrote: > On Sat, Apr 25, 2009 at 2:30 PM, Alexei Vinidiktov > wrote: >> Hello, >> >> I'm beginning to learn user authentication. I've implemented a very >> basic authentication using the Auth module that works fine on my local >> machine: I can

[web2py:20525] Re: Want to make a feature, just would like some help on where to look...

2009-04-25 Thread mdipierro
I do not understand. Can you post an example? On Apr 25, 11:26 pm, Jason Brower wrote: > I want to add a feature to the error reporting section of the code. > Where is that part of the code? > In specific, I would like to add something to where it prints out the > final code before running. (Whe

[web2py:20526] Re: Auth works on local host, doesn't work on remote server

2009-04-25 Thread Alexei Vinidiktov
On Sun, Apr 26, 2009 at 12:45 PM, Alexei Vinidiktov wrote: > On Sat, Apr 25, 2009 at 6:32 PM, Alexei Vinidiktov > wrote: >> On Sat, Apr 25, 2009 at 2:30 PM, Alexei Vinidiktov >> wrote: >>> Hello, >>> >>> I'm beginning to learn user authentication. I've implemented a very >>> basic authenticatio

[web2py:20527] jDive and refresh button - just #null instead of javascript:void

2009-04-25 Thread Wes James
ceej, in firefox there is a js error when clicking on the jDiv refresh button. I found this article: http://blog.reindel.com/2006/08/11/a-hrefjavascriptvoid0-avoid-the-void/ The idea I liked was using #null. I just changed javascript:void (2 instances) to #null in jDive.py and it works like a

[web2py:20528] Re: Need help with query on datetime field

2009-04-25 Thread weheh
How would you describe day() vs. day in db.a.dts.day() vs. now.day? --~--~-~--~~~---~--~~ 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 unsubsc

[web2py:20529] Re: Need help with query on datetime field

2009-04-25 Thread mdipierro
for a field, field.day() represents the function that extacts the day from a date. It is not a value. for a date, date.day is the day of the date. It is a value. There should not be any confusion. Massimo On Apr 26, 12:05 am, weheh wrote: > How would you describe day() vs. day in db.a.dts.day(

[web2py:20530] Re: Want to make a feature, just would like some help on where to look...

2009-04-25 Thread Wes James
do you mean add something to the ticket? or to a response.flash? On Sat, Apr 25, 2009 at 10:26 PM, Jason Brower wrote: > > I want to add a feature to the error reporting section of the code. > Where is that part of the code? > In specific, I would like to add something to where it prints out the

[web2py:20531] About file upload and renaming

2009-04-25 Thread Iceberg
Hi pals, I've read "About file upload and renaming" here: http://mdp.cti.depaul.edu/AlterEgo/default/show/50 I think it is somewhat hard to remember we should do: form.vars.filename=do_something(request.vars.file.filename) rather than: request.vars.filename=do_something(request.vars.file.fi