[web2py] Is it possible to generate a file containing the update for book 4th to 5th?

2013-03-13 Thread david xiao
Just wondering, if it's possible, i think i will be helpful to know the new 
features.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Can't get linkto working in SQLFORM

2012-09-01 Thread david xiao
Hi, 
Not sure if there is anybody else using it or trying it, but I 
encounter this as a start, and hanged there for some time.
In order to help starter going easier, it'd be better to correct it. 
Because SQLFORM class can not be modified, then just to correct the example 
in the book.
I think the simple way is to change in display_form function:
FROM:

 link = URL('list_records', args='db')
 TO:
 link = URL('list_records')

 in list_records, strip the first prefix by dot-delimit:
 like:

query = request.vars.query
  To:
  
query = request.vars.query
query = ".".join(query.split(".")[1:]) 

I tried it work.



On Tuesday, July 12, 2011 5:08:09 AM UTC-7, jc wrote:
>
> Hi,
> Trying to use linkto, so following example in web2py 
> book
>  first, 
> to try to understand.
>
> I have copied the example with person and dog tables, in particular in def 
> display_form(): I have
>
> link = URL('list_records')
> form = SQLFORM(db.person, record, deletable=True,
>   upload=url, linkto=link, labels = {'dog.owner':"This 
> person's dogs"})
>
> as described in the book.
>
> The books says the link generated will be 
> "/test/default/list_records/dog?query=dog.owner%3D5" but in fact the link 
> which appears when I visit /test/default/display_form/1 is 
>  "/test/default/list_records/dog?query=list_records.dog.owner%3D%3D1", 
> i.e. there is a spurious list.records and a spurious %3D. Not surprisingly 
> the link doesn't work. Can anybody tell me what I am doing wrong? 
>
> Thanks.
>

-- 





[web2py] Any ideas about how to develop a gtalk web client into web2py?

2012-08-18 Thread david xiao
Any ideas about how to develop a gtalk web client into web2py?

Hi, 
   I am considering incorporate Gtalk, Webex(similar to previous Meeboo, 
seems Webex doesn't open its API) web clients into web2py site, while i 
didn't find any useful information when i searched, any ideas? or any 
resource/doc available to do that? 
My thoughts is that probably the easiest way is to use REST API, while 
i didn't find it.

Thanks very much
David Xiao

-- 





Re: [web2py] How to update the cached value?

2012-07-15 Thread David xiao
Thanks, everyone,
it's really helpful

David Xiao

On Sat, Jul 14, 2012 at 7:12 AM, Anthony  wrote:

> Right, you are using a ram cache, so you would have to explicitly
>> invalidate the cached items if you want to update them. I would not rely on
>> the time_expire to handle that for you, unless you are really not too
>> concerned about it.
>
>
> To be clear, the cached value will reliably get updated whenever the time
> since the previous save exceeds the current value of time_expire, so you
> can rely on time_expire to update based on the interval it specifies.
> Nevertheless, there may be times you want to update the cached value based
> on something other than the time that has expired since the last update.
> That is possible as well, though a separate issue.
>
> Anthony
>


[web2py] How to update the cached value?

2012-07-13 Thread david xiao
Hi, 
   I am new to web2py these 2 days, while i am confused about how to update 
the cached value when i read the manual, the below section.
   as it explains:
   *the value "Hello" will be retrieved from the cache, and it will not be 
updated with "Goodbye"*.
   Does it means the second statement just have set the time_expire, not 
update the value with "Goodbye"?
   Does it means "Hello" exists still after 5 second set in the first 
statement ? 
   How to update the cached vaule if want, like to set "Goodbye" to replace 
"Hello"?

Thanks

Note, time_expire is used to compare the current time with the time the 
requested object was last saved in the cache. It does not affect future 
requests.
This enables time_expire to be set dynamically when an object is requested 
rather than being fixed when the object is saved. For example:
1 message = cache.ram('message', lambda: 'Hello', time_expire=5)

Now, suppose the following call is made 10 seconds after the above call:
2 message = cache.ram('message', lambda: 'Goodbye', time_expire=20)

Because time_expire is set to 20 seconds in the second call and only 10 
seconds has elapsed since the message was first saved, *the value "Hello" 
will be
retrieved from the cache, and it will not be updated with "Goodbye"*. The 
time_expire value of 5 seconds in the first call has no impact on the 
second call.