Re: [web2py] Re: grid: deletion row callback

2014-07-07 Thread Manuele Pesenti
Il 07/07/14 23:49, Anthony ha scritto:
> I'm not sure how easy that would be in the browser without hacking
> web2py.js, but on the server, you can check for when a deletion
> happens and then send back some JS to be executed. Not tested, but
> maybe something like:
>
> |
> defmygrid():
> ifrequest.args(-3)=='delete':
> deleted_record =db.mytable(request.args(-1))
> response.js =[JS code to be executed upon completion of the
> Ajaxrequest]
> grid =SQLFORM.grid(db.mytable)
> returndict(grid=grid)
> |
>
> Anthony 
Thank you Antony,
it could be a solution... I'll try it :)

M.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: grid: deletion row callback

2014-07-07 Thread Manuele Pesenti
Il 07/07/14 22:43, 黄祥 ha scritto:
> pardon me, i'm not sure what do you mean with _javascript_ trigger.
> please explain more about it. btw, web2py have ondelete (executed on
> HTML Form Side) and before_delete callback (executed on DAL side).
Thank you 黄祥 :)
I mean that I need to refresh some part of the page I have builded up
depending on the data in my grid and I want to mantein them syncronized.
In this case I put a map on the grid to represent the position of some
geometry point managed by a column of the table represented by my grid
and I would like to see the corresponding point disappear when I delete
a row. I noticed that the delete operation is solved via ajax and the
page is not reloaded so I need to find an event that could run my map
update trigger.

Cheers

 Manuele

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] XMLRPC fault ?

2014-07-07 Thread lyn2py
Hello,

I'm trying out the XML RPC to have 2 apps talk to each other, and this is 
what I have in my code (copy-pasted from this groups and web2py book):

App 1:
def test():
import xmlrpclib
xmlpxy = xmlrpclib.ServerProxy(
'http://127.0.0.1:8000/app2/default/call/xmlrpc')
result = xmlpxy.do_action(3,7)
return locals()


App2:
def call():
return service()


@service.xmlrpc
def do_action(a,b):
return a+b


And I ran into this error… I'm puzzled what I am missing out to make this 
work??

File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py",
 line 793, in close
raise Fault(**self._stack[0])
Fault: :method "xml" is not 
supported'>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: custom group names in web2py

2014-07-07 Thread James Lamb
is there a list of default values that we can call using the %(id)s style
syntax?


On Tue, Jul 8, 2014 at 5:02 AM, Leonel Câmara 
wrote:

> One way to do it is to append an action to db.auth_user._after_insert
> where you create the group if it doesn't exist yet and then add the user.
>
> Check:
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: how to Consume external NetTcp SOAP service in Web2Py

2014-07-07 Thread Dave S


On Monday, July 7, 2014 6:32:28 PM UTC-7, Dave S wrote:
>
>
>
> On Tuesday, June 24, 2014 10:48:13 AM UTC-7, Massimo Di Pierro wrote:
>>
>> web2py ships with pysimplesoap. It is documented on google code.
>>
>> On Monday, 23 June 2014 12:39:22 UTC-5, Gopi wrote:
>>>
>>> Hi All.. I am new to web2py. Is there a way to call external NetTcp SOAP 
>>> service in Web2Py. What are the best practices to call such  services in 
>>> Web2Py?
>>>
>>
> As a newcomer, I found it easy to implement.
>
> (@service.soap(various args that get used to form the wsdl XML)   )
>
>
Whoops, replied from the wrong side of the soap factory.

 I am not sure I've consumed SOAP from my controllers.  I have clients that 
use suds, but I may have started down that road before finding web2py.  It 
was serving SOAP that brought me here.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: how to Consume external NetTcp SOAP service in Web2Py

2014-07-07 Thread Dave S


On Tuesday, June 24, 2014 10:48:13 AM UTC-7, Massimo Di Pierro wrote:
>
> web2py ships with pysimplesoap. It is documented on google code.
>
> On Monday, 23 June 2014 12:39:22 UTC-5, Gopi wrote:
>>
>> Hi All.. I am new to web2py. Is there a way to call external NetTcp SOAP 
>> service in Web2Py. What are the best practices to call such  services in 
>> Web2Py?
>>
>
As a newcomer, I found it easy to implement.

(@service.soap(various args that get used to form the wsdl XML)   )

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: grid: deletion row callback

2014-07-07 Thread Anthony
I'm not sure how easy that would be in the browser without hacking 
web2py.js, but on the server, you can check for when a deletion happens and 
then send back some JS to be executed. Not tested, but maybe something like:

def mygrid():
if request.args(-3) == 'delete':
deleted_record = db.mytable(request.args(-1))
response.js = [JS code to be executed upon completion of the Ajax 
request]
grid = SQLFORM.grid(db.mytable)
return dict(grid=grid)

Anthony

On Monday, July 7, 2014 4:32:27 PM UTC-4, Manuele wrote:
>
> Hi! 
> is it possible to setup a _javascript_ trigger on grid row deletion 
> event? Possibly capturing the data of the row that will be deleted? 
>
> thank you in advance. 
> Cheers 
>
> Manuele 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Updating database outside web2py

2014-07-07 Thread Cliff Kachinske
I would use the native Python adapter for what you want to do. There is 
less code to load and execute, thus less memory, less time and fewer 
opportunities for error.

The only possible drawback is you will need to write some SQL.

On Thursday, July 3, 2014 12:53:34 AM UTC-4, Mayank Kumar wrote:
>
> Hi,
> I am working on a project where I need to update the website database 
> outside web2py, i mean outside an standard HTTP request. For example, I 
> have another server where TCP request comes, and I need to update one table 
> in the database. Also, I have views defined inside web2py which prints out 
> entry from the same tables. 
>
> I am planning to use DAL for the database access outside web2py (
> http://www.web2py.com/AlterEgo/default/show/215). But, I am curious  - 
> What sort additional of care should I take while coding this as write 
> (outside web2py) and read (in some views of the website) can happen 
> simultaneously. 
>
> Thanks
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Auto update db records behaviour per input field on release (AJAX)

2014-07-07 Thread Derek
If you read, I suggested that when the 'page close' or 'navigate away' 
event is fired, you can trigger a save then (one option). You can use 
parsely to manage your validators (because you don't want to save invalid 
data). It will do run-time validation, which you can then hook into to do 
the saving for you, so as soon as valid data is entered, it is saved.

Another option is to collect a small amount of information at a time. Such 
like a 'wizard' interface. Take a look here for what I'm talking about:

http://parsleyjs.org/doc/examples/multisteps.html


On Friday, June 13, 2014 3:29:20 PM UTC-7, Francisco Ribeiro wrote:
>
> Thank you for stepping up to reply but 'parsely' looks more like a library 
> for client-side form validation which is not really the major problem I am 
> trying to address. My goal is to have a mechanism that stores (with 
> persistence) information provided by the user as soon as possible once it 
> is provided input field by input field (on focusOut event) , rather than 
> just doing all at once when the form is submitted. Anyway, thanks :)
>
> Francisco
>
>
> On Friday, 13 June 2014 21:06:48 UTC+1, Derek wrote:
>>
>> Try 'parsely'
>>
>> http://parsleyjs.org/doc/examples/simple.html
>>
>> and prompt on page close to save first.
>>
>> On Wednesday, June 11, 2014 7:43:41 PM UTC-7, Francisco G. T. Ribeiro 
>> wrote:
>>>
>>> hi all,
>>> I'm working on an app that uses forms that can be quite long and its 
>>> users often interrupt their sessions for whatever reason and end up losing 
>>> the information already filled. For this and other reasons I wanted to 
>>> provide a different behaviour to these forms where each input field updates 
>>> the record on the database as soon as its input field is released 
>>> ('focusOut' event on jQuery). Ideally, the server would reply with 
>>> 'success' or an error message so users know when they can move on to 
>>> another field (without refreshing the whole page). By the end of the form, 
>>> the user wouldn't have to review things that were written long ago since 
>>> these were all already validated.
>>>
>>> Now, I know this can be tricky due to database constrains but because i 
>>> need to do this very often (multiple fields and multiple forms), I thought 
>>> it would be useful to automate it, maybe even by having on the db Field 
>>> something like '..auto_update=True' (merely a suggestion) but before 
>>> getting there, I would like to know if anyone has faced this problem and if 
>>> yes what solution did you employ? 
>>>
>>> Thank you in advance,
>>> Francisco
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] SQLEDITABLE plugin

2014-07-07 Thread Fabiano Almeida
Thanks Kato!!!

Now I get it!!


2014-07-07 8:30 GMT-03:00 kato :

> I will add a postscript. you can write as below.
>
> def demo031():
> def record():
> rows = db(db.employee_sheet.resigned == True).select(limitby=(0,3))
> return [row.id for row in rows.sort(lambda
> row:row.employee_number)]
>
> response.title = 'demo030'
> response.view = 'plugin_sqleditable/sample.html'
> editable = SQLEDITABLE(db.employee_sheet,
> record=record(),showid=False,
>
> maxrow=5).process()
> return dict(editable=editable)
>
> If you use "primarykey" and multiple key fields, you need to write list of
> list in "record" parameter.
>
>
> 2014-07-07 5:51 GMT-03:00 'kato' via web2py-users  >:
>
>> Hi fabiano.
>>
>> It is not possible to pass a query currently.
>> But "record" parameter is so callable, please set there.
>> Please see to the demo5
>>  .
>>
>> thanks.
>>
>> 2014年7月6日日曜日 15時19分04秒 UTC-3 Fabiano Almeida:
>>>
>>> Hi kato!
>>>
>>> How to use SQLEDITABLE with a query?
>>>
>>> If I try this in your first example:
>>>
>>> query = db.employee_sheet.resigned == True
>>> editable = SQLEDITABLE(query, showid=False, maxrow=5).process()
>>>
>>> Return error:
>>>
>>>
>>> AttributeError: 'Query' object has no attribute '_id'
>>>
>>> How to filter table?
>>>
>>> Thanks,
>>>
>>> Fabiano
>>>
>>>
>>>
>>> 2014-07-01 10:12 GMT-03:00 'kato' via web2py-users <
>>> web...@googlegroups.com>:
>>>
 Hi.

 I tried to make SQLEDITABLE plugin.

 demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html

 It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
 If you are interested, please try.

 Thanks.

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 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+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>  --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/PQE1JJwv0Bc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: grid: deletion row callback

2014-07-07 Thread 黄祥
pardon me, i'm not sure what do you mean with _javascript_ trigger. please 
explain more about it. btw, web2py have ondelete (executed on HTML Form 
Side) and before_delete callback (executed on DAL side).

ref:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] grid: deletion row callback

2014-07-07 Thread Manuele Pesenti
Hi!
is it possible to setup a _javascript_ trigger on grid row deletion
event? Possibly capturing the data of the row that will be deleted?

thank you in advance.
Cheers

Manuele

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: custom group names in web2py

2014-07-07 Thread Leonel Câmara
One way to do it is to append an action to db.auth_user._after_insert where 
you create the group if it doesn't exist yet and then add the user.

Check:
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Use of scheduler in place of cron

2014-07-07 Thread Dave S


On Monday, June 23, 2014 11:46:28 PM UTC-7, pbreit wrote:
>
> I have a function that I want to run every 30 minutes. I would ordinarily 
> expect to use cron but see that the Web2py book encourages using the 
> scheduler. But after reviewing the docs several times, I have no idea how 
> to make this work. Thanks for any help.
>

I'm playing catch-up on the reading,so apologies for the delay ... does 
this link help?



(I haven't used the scheduler yet myself, but I think Niphlod's explanation 
is pretty clear.)

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Web2py Views: Multiple images changing in the background of index?

2014-07-07 Thread Dave S


On Monday, June 23, 2014 2:15:12 PM UTC-7, Gideon George wrote:
>
> Please I need a help, this is the first time I am posting here and I am in 
> my journey to be the Africa's number one Web2py enthusiast. I am currently 
> developing my first web2py application and I have less than a week to 
> complete it and head over to a more complex application by next week.
>
> My question to the community is, I want to use two pictures rotating 
> display as my background image in the index. please help me with suggestion 
> on how to go about it.
> Thank you.
> NB: Example of a similar situation is the index of twitter(i.e before user 
> logged in)
>


I don't see a background helper in the chapter on views, so I'd probably 
play around with the STYLE helper to set the background image.  That should 
work easily for 1 image, and for changing images I see 2 options:  

1) use a reload timer to refresh the page and load the 2nd image at that 
time.  Details TBD, and that might not be a smooth transition.

2) use javascript and a timer to rewrite the DOM entry for the background 
image.  Again, details TBD.

Good luck ... sorry this answer is so late.

 /dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Implementing a search engine in web2py

2014-07-07 Thread lokesh
I have a single web2py instance running on my localhost. And I have defined 
these functions in a controller and displaying the obtained using their 
respective views. I'm testing them by opening appropriate urls likes 
localhost:8000/application/controller/function.
In first case it returns the just inserted row if it matches search results. 
And if I open the second function url after the first one it doesn't return any 
search results. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Dynamic application names in routes.py

2014-07-07 Thread Evandro Oliveira
Hello, people. Awesome group!

Just a curiosity. We have an application that is accessible through 
http://mydomain/{user-account} where every account maps to an application.

Our signup and payment systems are other individual applications, ending up 
with 4 web2py applications

- admin
- application
- signup
- payment

My router (which works well), follows

routes_in = [
("/admin/$anything", "/admin/$anything"),
("/signup/$anything", "/signup/$anything"),
("/payments/$anything", "/payments/$anything"),
("/$account/$anything", "/application/$anything")
]

Is there any way to port this to the new parametric router version?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] SQLEDITABLE plugin

2014-07-07 Thread kato
I will add a postscript. you can write as below.

def demo031():
def record():
rows = db(db.employee_sheet.resigned == True).select(limitby=(0,3))
return [row.id for row in rows.sort(lambda row:row.employee_number)]

response.title = 'demo030'
response.view = 'plugin_sqleditable/sample.html'
editable = SQLEDITABLE(db.employee_sheet, record=record(),showid=False,

maxrow=5).process()
return dict(editable=editable)

If you use "primarykey" and multiple key fields, you need to write list of
list in "record" parameter.


2014-07-07 5:51 GMT-03:00 'kato' via web2py-users :

> Hi fabiano.
>
> It is not possible to pass a query currently.
> But "record" parameter is so callable, please set there.
> Please see to the demo5
>  .
>
> thanks.
>
> 2014年7月6日日曜日 15時19分04秒 UTC-3 Fabiano Almeida:
>>
>> Hi kato!
>>
>> How to use SQLEDITABLE with a query?
>>
>> If I try this in your first example:
>>
>> query = db.employee_sheet.resigned == True
>> editable = SQLEDITABLE(query, showid=False, maxrow=5).process()
>>
>> Return error:
>>
>>
>> AttributeError: 'Query' object has no attribute '_id'
>>
>> How to filter table?
>>
>> Thanks,
>>
>> Fabiano
>>
>>
>>
>> 2014-07-01 10:12 GMT-03:00 'kato' via web2py-users <
>> web...@googlegroups.com>:
>>
>>> Hi.
>>>
>>> I tried to make SQLEDITABLE plugin.
>>>
>>> demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html
>>>
>>> It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
>>> If you are interested, please try.
>>>
>>> Thanks.
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> 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+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/PQE1JJwv0Bc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Searching for multiple words in SQLFORM.grid

2014-07-07 Thread Cacpacific O
thanks, this is very helpful.

On Friday, March 1, 2013 3:19:22 PM UTC+7, Mandar Vaze wrote:
>
> Hi,
>
> As you all know, SQLFORM.grid search does not support searching for 
> multiple words - it throws an error "Invalid Query"
> Searching for multiple words may be a common requirement.
> I looked thru various older posting on this group, but none worked for me 
> AS IS (Possiblly because they were old - it worked with whatever was 
> current version of web2py at the time of original post) This one came the 
> closest : https://groups.google.com/forum/?fromgroups=#!topic/web2py
> /9_1ECdKHKUo
>
> Here is the version that worked for me: (web2py Version 2.3.2 (2012-12-17 
> 15:03:30) stable)
>
> #Referred to the web2py implementation of search (gluon/sqlhtml.py:def 
> grid())
> #Modified to support multiple words
> def search_query(fields, keywords):
> if isinstance(keywords, (tuple, list)):
> keywords = keywords[0]
> request.vars.keywords = keywords
> key = keywords.strip()
> if key and not '"' in key and not "'" in key:
> SEARCHABLE_TYPES = ('string', 'text', 'list:string')
> words = key.split(' ') if key else []
> filters = []
> for field in fields:
> if field.type in SEARCHABLE_TYPES:
> all_words_filters = []
> for word in words:
> all_words_filters.append(field.contains(word))
> filters.append(reduce(lambda a, b: (a & b), 
> all_words_filters))
> parts = filters
> else:
> parts = None
> if parts:
> return reduce(lambda a, b: a | b, parts)
> else:
> return None
>
> Why "&" in the first reduce ? Because if I use "|" then search results are 
> too wide. e.g. if I typed "web2py is great" - then using "|" would return 
> all the matches containing the word "is" even if "web2py" and "great" are 
> missing. 
> Off course using "&" isn't fool proof either since it will match a record 
> having text "web2py is not great" as well (since all three words are 
> present) 
>
> One big change from what previous posts having been saying is that I did 
> NOT override the search widget. Search widgets works well as is.
> Only difference is that I assigned the above function to "searchable" 
> parameter when calling the SQLFORM.grid like
>
> grid = SQLFORM.grid(query,create=True, searchable=search_query) #Use 
> other params as required
>
> I came to realize this after I looked at web2py code (gluon/sqlhtml.py) 
> where if "searchable" is callable - then it is called. I somehow used to 
> think that it is a boolean (True/False)
>
> I hope this helps someone
>
> -Mandar
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Updating database outside web2py

2014-07-07 Thread Johann Spies
On 3 July 2014 06:53, Mayank Kumar  wrote:

> Hi,
> I am working on a project where I need to update the website database
> outside web2py, i mean outside an standard HTTP request. For example, I
> have another server where TCP request comes, and I need to update one table
> in the database. Also, I have views defined inside web2py which prints out
> entry from the same tables.
>
> I am planning to use DAL for the database access outside web2py (
> http://www.web2py.com/AlterEgo/default/show/215). But, I am curious  -
> What sort additional of care should I take while coding this as write
> (outside web2py) and read (in some views of the website) can happen
> simultaneously.
>
>
>
> The database backend should handle this.  I am using Postgresql.  All that
web2py does is generate a query and send it to the backend in a transaction
which is handled by the backend.

I see no problem therefore updateing a table from outside web2py.

Regards
Johann


-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: APNSFeedbackWrapper receive method freezes

2014-07-07 Thread Wonton
Hello again Leonel.

I'm reading the Scheduler section in web2py docs and I'm a bit confused:

- To use the scheduler in a module what should i do? Create a scheduler.py 
model and pass the scheduler created in the model to the function in my 
module as I do with my db?

- Can I start and stop the task whenever I want? It seems that I have to 
insert the task in my db but I don't now when this task will be called 
because it depend on a certain event and maybe it never happens or it 
happens 500 times an hour.

Thank you again!

On Monday, July 7, 2014 3:51:34 PM UTC+2, Wonton wrote:
>
> Oks, then I will study the scheduler and I will try to implement it.
>
> Thank you very much for the suggestion.
>
> On Monday, July 7, 2014 1:39:57 PM UTC+2, Leonel Câmara wrote:
>>
>> Yes you can use the DAL inside the scheduler without any problem, the 
>> only thing you need to pay attention to is to do a commit if you do any 
>> changes to the DB.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] RapydScript / RapydML - impressive

2014-07-07 Thread António Ramos
@massimo
Does source maps help with coffeescript?
http://www.coffeescriptlove.com/2012/04/source-maps-for-coffeescript.html?m=1
Em 16/06/2014 04:26, "Massimo Di Pierro" 
escreveu:

> actually I did not know about this and this is really interesting.
> The problem I had with coffeescript was it was hard to debug because
> errors would reference the generate JS and not the source. How does
> radyscript handle tracebacks?
>
> On Sunday, 15 June 2014 13:24:28 UTC-5, Ramos wrote:
>>
>> I was hoping this would be a hot topic  but...
>> Em 09/06/2014 15:32, "António Ramos"  escreveu:
>>
>>> interesting read from RapydML.
>>>
>>>
>>> {% extends basic.html %}
>>>
>>> For those unfamiliar with it, the above line includes HTML from
>>> basic.html inside of the current page. This is a useful technique to avoid
>>> unnecessary copies of HTML that's common to multiple pages (this includes
>>> navigation menus, website logo, etc.). The above logic, however, can also
>>> be substituted with RapydML's importstatement, importing RapydML logic
>>> from another page. For example, I can create a template.pyml file,
>>> declararing a function for generating a chunk of reusable HTML inside of
>>> it, and then invoke that function in every place I want that HTML to
>>> appear. Which solution is better?
>>>
>>> If you're an experienced web developer, you probably know that on most
>>> hosting services storage space (especially for text/html) is relatively
>>> cheap compared to bandwidth and CPU usage. The bandwidth requirements in
>>> this case are the same, since both, template engine and RapydML logic
>>> happens before the page is served to the client. The main difference is
>>> that by using extends, you force your template engine to dynamically
>>> generate that HTML content before serving it to the client (using up CPU
>>> cycles, smart engines will probably cache this data), while by using
>>> import you make your compiler generate that HTML once and serve it
>>> repeatedly to your clients (using up a bit more storage space, which is not
>>> even significant when comparing it to storage taken up by images and other
>>> multimedia files). As a rule of thumb, I recommend using RapydML's logic
>>> over Django/Rails/web2py unless it's something that requires information
>>> that will not be available until runtime (i.e. news that you retrieve from
>>> the database, interactive form that deals with user input). It's not too
>>> different from preferring CSS over JavaScript for styling that doesn't
>>> change dynamically.
>>>
>>>
>>> 2014-06-09 14:51 GMT+01:00 António Ramos :
>>>
 I think i need something like that.

 cleaner is simple to read ..


 2014-06-09 3:35 GMT+01:00 nick name :

 Does anyone have experience with RapydScript (lightweight py-like to JS
> translator) and RapydML (pythonic-template to html/xml/svg translator)?
>
> Have just discovered them, and from a cursory examination they seem
> extremely nice and useful. RapydScript seems to bridge the JS<->Python
> bridge better than other projects I've looked at (PythonJS, Skulpt,
> Pyjamas, Brython) - it goes much farther than Brython, for example, but
> produces very readable and debuggable javascript that still works on IE8.
>
> RapydML explicitly shows how to support web2py in its documents ( ...
> as well as plain html and django).
>
> Does anyone have any experience with them?
>
> https://github.com/atsepkov/RapydML
>
> https://github.com/atsepkov/RapydScript
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>


>>>   --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2p

[web2py] Re: redirect(URL('second',vars=dict(name=name)))..could somebody explain this in details thank

2014-07-07 Thread Anthony
 name = form.vars.visitor_name
redirect(URL('second',vars=dict(name=name))) # i did not get the logic 
behind vars=dict(name=name)))

The above will produce a URL like /myapp/default/second?name=Bazida. This 
will pass the value of the "name" variable to the second() function.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Login drop down in appadmin while logged in into admin

2014-07-07 Thread Anthony
There are two ways to access appadmin:
>
> - begin logged into admin and "system administrator". this the usual way. 
> You get access to appadmin for all the apps.
> - begin logged into a specific app and having special privileges:
>
> http://web2py.com/books/default/chapter/29/09/access-control?search=manager_actions
>

And note that the latter method provides access only to the 
"manager_actions" functionality (which uses SQLFORM.grid), not the rest of 
appadmin.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: APNSFeedbackWrapper receive method freezes

2014-07-07 Thread Wonton
Oks, then I will study the scheduler and I will try to implement it.

Thank you very much for the suggestion.

On Monday, July 7, 2014 1:39:57 PM UTC+2, Leonel Câmara wrote:
>
> Yes you can use the DAL inside the scheduler without any problem, the only 
> thing you need to pay attention to is to do a commit if you do any changes 
> to the DB.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Editing tables with datatables

2014-07-07 Thread Yebach
Hello

I am using datatables plugin to dynamically edit table of workers which are 
read from database

my code on client side is 

JAVASCRIPT
var getTableData = function (){
var table = $('#example').tableToJSON(), // Convert the table into a 
javascript object
datas = JSON.stringify(table);
 return datas;
};

var saveTableData = function(){
var tableData = getTableData();
$.ajax({
 type: 'POST',
 url: '{{=URL('script', 'saveWorkers.json')}}',
 data: {data : tableData},
 dataType: 'json',
 }).done(function( msg ) { });
 };

$(document).ready(function() {
var table = $('#example').dataTable();
saveTableData(); //Will be triggered on save button

 //Hide columns
$('#example tr *:nth-child(1)').css('display','none');
$('#example tr *:nth-child(2)').css('display','none');
$('#example').editableTableWidget().numericInputExample().find('td:first').focus();

} );

HTML


   

 Id
Organizacija
Ime
Priimek
Vzdevek
E-mail
Status
Komentar




 {{for worker in workers:}}

{{=worker['w_id_w']}}
{{=worker['w_organisation']}}
{{=worker['w_first_name']}}
{{=worker['w_last_name']}}
{{=worker['w_nick_name']}}
{{=worker['w_email']}}
{{=worker['w_status']}}
{{=worker['w_note']}}

{{pass}} 




What is the best way to menage editing (update/delete/add) record(s). I 
have all workers in one table (also on view part) for fast and easy edit 
from client's part of view
Also I am experiencing problems with add new row to table and delete last 
row

First I would like to be saved/updated/deleted on button click but if not 
too complicated I would like them to be saved every time I change table 
cell.

Thans for any guidelines suggestions etc. 
Best regards


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] redirect(URL('second',vars=dict(name=name)))..could somebody explain this in details thank

2014-07-07 Thread Jonathan Lundell
On 6 Jul 2014, at 7:04 PM, Bazida  wrote:
> Hi, I was doing some tutorial from the web2py book, i ran into this following 
> code
> 
> def first():
> form = SQLFORM.factory(Field('visitor_name', requires=IS_NOT_EMPTY()))
> if form.process().accepted:
> name = form.vars.visitor_name
> redirect(URL('second',vars=dict(name=name))) # i did not get the 
> logic behind vars=dict(name=name)))
> return dict(form=form) # I know it's a dictionary, I also know dictionary 
> should be keys and values, how can a  form be both keys and values here. 
> instead of dict(form=form) shouldn't it be dict(something=form), since 
> something is a key and form is a variable.
> 
> def second():
> name = request.vars.visitor_name or redirect(URL('first'))
> return dict(name=name)
> 

In Python (not just web2py), dict(form=form) is the same as { 'form': form }. 
It's just naming the argument to the dict() function.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: APNSFeedbackWrapper receive method freezes

2014-07-07 Thread Leonel Câmara
Yes you can use the DAL inside the scheduler without any problem, the only 
thing you need to pay attention to is to do a commit if you do any changes 
to the DB.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: I have 2 simple newbie question from the introduction book..help

2014-07-07 Thread 黄祥


On Monday, July 7, 2014 6:29:05 AM UTC+7, Bazida wrote:
>
>
>- *Question one:*
>
> Hello {{=request.vars.visitor_name}}
>
> What is the purpose of vars here, what it does.
>
>
> request.vars: a gluon.storage.Storage object containing all request 
parameters.

ref:
http://web2py.com/books/default/chapter/29/04/the-core#request 

>
>- *Question two:*
>
> default/first.html
>
> What is the point of default here. Why we have to declare it everytime. Can't 
> we just create first.html. 
>
>
'default' is the controller name provided by web2py, you can change the 
controller file name into whatever you like. you don't have to declare the 
controller name everytime, it depends on your logic programming, so the 
answer is already inside you, wheter you want create 1 controller name : 
'default' with a lot of function, or you want to make a lot of controller 
with fewer function, your choice.
and first.html is the output of the function defined on the controller.

ref :
http://web2py.com/books/default/chapter/29/04/the-core#Dispatching


>
> Thank you for taking time to answer.
>
>
please spend some time read the book.

best regards,
stifan 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: How to host a website from web2py homepage on pythonanywhere.com?

2014-07-07 Thread Massimo Di Pierro
https://www.pythonanywhere.com/try-web2py/

On Sunday, 6 July 2014 06:46:09 UTC-5, Ritesh Bhat wrote:
>
> Hi everyone,
> I am a beginner and am using the web2py framework.for the first time. I 
> would like to host a website from my web2py page on to pythonanywhere.com 
> and i am not able to figure out the same. Any help in this regard will be 
> very helpful.
> Thankyou.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Implementing a search engine in web2py

2014-07-07 Thread Massimo Di Pierro
Can you tell us more about your setup? Do you have one server? Multiple 
processes? Did you try it form the web2py shell?

On Saturday, 5 July 2014 06:28:33 UTC-5, lokesh wrote:
>
> I'm using whoosh backend with plugin_haystack in my application.
> But the search function is working only if there is an insert or update db 
> statement in that function.
> For instance :
> def temp():
>  db.my_table.insert(my_row1="temporary data to test the search")
>  rows = db(index.search(my_row1="data to search"))
>  return dict(rows=rows)
>
> this returns the newly inserted row as the search result. But after that 
> if I do this, it doesn't return any matching result,
> def temp2():
>  rows = db(index.search(my_row1="data to search"))
>  return dict(rows=rows)
>
> what could be the mistake here?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: MySQL - OperationalError: Error on rename (errno: 150)

2014-07-07 Thread Massimo Di Pierro
No. web2py does not automatically delete indexes. You have to do it 
manually. Sorry. Please open a ticket about this.

On Friday, 4 July 2014 17:44:53 UTC-5, José Antonio Salazar Montenegro 
wrote:
>
> I realize this is an ancient topic, but I'm having the very same error 
> migrating a MySQL table where I'm only removing a self reference field.
>
> It seems like an index was created to guard the (self) foreign-key 
> constraint and DAL doesn't remove it when deleting the field.
> There are no manually-created indexes on my database, all were created 
> automatically.
>
> Just wondering if this was fixed.
>
> On Monday, July 20, 2009 12:05:44 PM UTC-5, David Zejda wrote:
>>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Hello,
>>
>> my db backend is MySQL 5.0.51a-24 on Linux.
>>
>> If I try to gently alter already generated table schema, like to rename
>>
>> SQLField('relation', 'text', requires = \
>>IS_NULL_OR(IS_IN_DB(db, 'relation_type.id', 'relation_type.id',
>> multiple=True)))
>>
>> to
>>
>> SQLField('relation_type', 'text', requires = \
>>IS_NULL_OR(IS_IN_DB(db, 'relation_type.id', 'relation_type.id',
>> multiple=True)))
>>
>> i get this:
>>
>> Traceback (most recent call last):
>>   File "/home/zejdad/!a/jfind/web2py/gluon/restricted.py", line 98, in
>> restricted
>> exec ccode in environment
>>   File "/home/zejdad/!a/jfind/web2py/applications/jfind/models/db.py",
>> line 346, in 
>> migrate="person"
>>   File "/home/zejdad/!a/jfind/web2py/gluon/sql.py", line 938, in
>> define_table
>> raise e
>> OperationalError: (1025, "Error on rename of './jfind/#sql-ac1_5e' to
>> './jfind/person' (errno: 150)")
>>
>> Maybe, it is related to the troubles mentioned there:
>>
>> http://forums.mysql.com/read.php?22,95361
>>
>> Please, do you have any experiences with a such type of errors?
>>
>> I would like to test it with MyISAM instead of InnoDB tables, but it is
>> not easy to change it in already generated and interrelated tables:
>>
>> ALTER TABLE `person` ENGINE = MYISAM
>>
>> #1217 - Cannot delete or update a parent row: a foreign key constraint
>> fails
>>
>> Or should I try other MySQL version?
>>
>> Thank you for advices!
>>
>> David
>> -BEGIN PGP SIGNATURE-
>> Version: GnuPG v1.4.9 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iEYEARECAAYFAkpko+cACgkQ3oCkkciamVF3nACfdej9+FBUseSRBgMtJyBm0elR
>> wKUAnjx/qSTnNzG+Dr47AKmHm40PxJUK
>> =HqDy
>> -END PGP SIGNATURE-
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] redirect(URL('second',vars=dict(name=name)))..could somebody explain this in details thank

2014-07-07 Thread Bazida
Hi, I was doing some tutorial from the web2py book, i ran into this 
following code

def first():
form = SQLFORM.factory(Field('visitor_name', requires=IS_NOT_EMPTY()))
if form.process().accepted:
name = form.vars.visitor_name
redirect(URL('second',vars=dict(name=name))) # i did not get the logic 
behind vars=dict(name=name)))
return dict(form=form) # I know it's a dictionary, I also know dictionary 
should be keys and values, how can a  form be both keys and values here. 
instead of dict(form=form) shouldn't it be dict(something=form), since 
something is a key and form is a variable.
def second():
name = request.vars.visitor_name or redirect(URL('first'))
return dict(name=name)


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] SQLEDITABLE plugin

2014-07-07 Thread 'kato' via web2py-users
Hi fabiano.

It is not possible to pass a query currently. 
But "record" parameter is so callable, please set there. 
Please see to the demo5 
 .

thanks.

2014年7月6日日曜日 15時19分04秒 UTC-3 Fabiano Almeida:
>
> Hi kato!
>
> How to use SQLEDITABLE with a query?
>
> If I try this in your first example:
>
> query = db.employee_sheet.resigned == True
> editable = SQLEDITABLE(query, showid=False, maxrow=5).process()
>
> Return error:
>
> AttributeError: 'Query' object has no attribute '_id'
>
> How to filter table?
>
> Thanks,
>
> Fabiano
>
>
>
> 2014-07-01 10:12 GMT-03:00 'kato' via web2py-users <
> web...@googlegroups.com >:
>
>> Hi.
>>
>> I tried to make SQLEDITABLE plugin.
>>
>> demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html
>>
>> It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
>> If you are interested, please try.
>>
>> Thanks.
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] How to host a website from web2py homepage on pythonanywhere.com?

2014-07-07 Thread Ritesh Bhat
Hi everyone,
I am a beginner and am using the web2py framework.for the first time. I 
would like to host a website from my web2py page on to pythonanywhere.com 
and i am not able to figure out the same. Any help in this regard will be 
very helpful.
Thankyou.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] I have 2 simple newbie question from the introduction book..help

2014-07-07 Thread Bazida



   - *Question one:*
   
Hello {{=request.vars.visitor_name}}

What is the purpose of vars here, what it does.



   - *Question two:*
   
default/first.html

What is the point of default here. Why we have to declare it everytime. Can't 
we just create first.html. 



Thank you for taking time to answer.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] plugin_editable_jqgrid is not saving or adding new record - but its deleting

2014-07-07 Thread Peter
https://github.com/parroit/editablejqgrid/blob/master/models/plugin_editable_jqgrid.py

I have been struggling to get this plugin to work out of the box but its 
not saving changes. On pressing enter key it just dims the window and 
nothing happens. This is happening even with their sample project.

I want very much to use this pluggin coz of inline editing and inline 
adding new records and am sure it can calculate totals to simulate an 
invoice. 

Any ideas on whats going on? or is the plugin broken on the current web2py 
version?

Kindly assist me coz i need such grid for my project - the closest grid to 
the above i have found so far might be flexigrid which i havent found 
web2py version


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] How to make so that the user can enter (add) a single address.

2014-07-07 Thread Капылов Данил
How to make so that the user can enter (add) a single address. 

And configure the "create an address" if more than one address to redirect 
to main page

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Login drop down in appadmin while logged in into admin

2014-07-07 Thread Massimo Di Pierro
There are two logins:
1) login into admin which gives you access to appadmin as well
2) login into your application. appadmin is part of your application and 
shows you whether you are logged into the application

There are two ways to access appadmin:
- begin logged into admin and "system administrator". this the usual way. 
You get access to appadmin for all the apps.
- begin logged into a specific app and having special privileges:
http://web2py.com/books/default/chapter/29/09/access-control?search=manager_actions

I hope this clarifies it.

Massimo




On Monday, 7 July 2014 03:37:58 UTC-5, Annet wrote:
>
> When I login to:
>
> https://admin.mydomain.com/admin/default/site
>
> The menu contains an item Logout.
>
> When I go to:
>
> https://admin.mydomain.com/myapp/appadmin/index
>
> The menu contains a drop down menu Login with the items: Lost password? 
> Forgot username? and Login,
> I am already logged in, so why login again?
>
> Regards,
>
> Annet
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] custom group names in web2py

2014-07-07 Thread James Lamb
Hello,

I am trying to get custom group names to work properly in web2py. I am using

2.9.5-stable+timestamp.2014.03.16.02.35.39
(Running on Apache/2.2.22 (Ubuntu), Python 2.7.3)

I am trying to understand how when a user signs up the group they get added
to is partly created  by the organisation name in my custom auth table.
Here is my additional settings.

auth.settings.extra_fields['auth_user'] = [
Field('address'),
Field('city'),
Field('zip'),
Field('phone', 'integer'),
Field('organisation', 'string', notnull=True)
]

It is the final "organisation" field that I want to add to the id field
i.e. %(organisation)s_%(id)s

Any advice would be great.

Regards,

J.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: IS_TIME() validator behavior with whitespaces surrounding meridiem

2014-07-07 Thread Niphlod
I don't see any particular issues as long as you include the relevant test 
cases changed. 
TBH, the current validator is "good" because the default time widget 
doesn't use the format with the space within, but, again, I don't see any 
issues including the "parsing" for the "additional" format.

On Saturday, July 5, 2014 2:17:07 AM UTC+2, Wes Hall wrote:
>
> It appears as though '2pm' and '2 pm' validate differently while '2:00 pm' 
> and '2:00pm' validate the same.
>
> In my quick testing, removing all spaces still allows the IS_TIME() 
> validator to pass any tests.
>
> Am I missing any international time entry methods where the spaces would 
> be critical or would this be an acceptable patch/fix?
>
> pre-fix
> >>> IS_TIME()('2pm')
> (datetime.time(14, 0), None)
> >>> IS_TIME()('2 pm') 
> (datetime.time(2, 0), None)
> >>> IS_TIME()('02 pm') 
> (datetime.time(2, 0), None)
> >>> IS_TIME()('2:00 pm') 
> (datetime.time(14, 0), None)
> >>> IS_TIME()('2:00 pm ')
> (datetime.time(14, 0), None)
> >>> IS_TIME()('2 pm ') 
> (datetime.time(2, 0), None)
> >>> IS_TIME()('2pm ') 
> ('2pm ', 'Enter time as hh:mm:ss (seconds, am, pm optional)')
>
> post-fix
> >>> IS_TIME()('2pm')
> (datetime.time(14, 0), None)
> >>> IS_TIME()('2 pm') 
> (datetime.time(14, 0), None)
> >>> IS_TIME()('02 pm') 
> (datetime.time(14, 0), None)
> >>> IS_TIME()('2:00 pm') 
> (datetime.time(14, 0), None)
> >>> IS_TIME()('2:00 pm ')
> (datetime.time(14, 0), None)
> >>> IS_TIME()('2 pm ') 
> (datetime.time(14, 0), None)
> >>> IS_TIME()('2pm ')
> (datetime.time(14, 0), None)
>
> gluon/validators.py
> class IS_TIME(Validator):
> ...
> def __call__(self, value):
> try:
> ivalue = value
> value = regex_time.match(value.lower().replace(' ',''))
> ...
>
>
> gluon/tests/test_validators.py
> ...
> rtn = IS_TIME()('2 pm')
> self.assertEqual(rtn, (datetime.time(14, 00), None))
> rtn = IS_TIME()('2 pm ')
> self.assertEqual(rtn, (datetime.time(14, 00), None))
> rtn = IS_TIME()('2pm')
> self.assertEqual(rtn, (datetime.time(14, 00), None))
> rtn = IS_TIME()('2pm ')
> self.assertEqual(rtn, (datetime.time(14, 00), None))
> ...
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Login drop down in appadmin while logged in into admin

2014-07-07 Thread Annet
When I login to:

https://admin.mydomain.com/admin/default/site

The menu contains an item Logout.

When I go to:

https://admin.mydomain.com/myapp/appadmin/index

The menu contains a drop down menu Login with the items: Lost password? 
Forgot username? and Login,
I am already logged in, so why login again?

Regards,

Annet

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.