[web2py] Re: Web2Py tool: Amazon SNS integration

2016-08-02 Thread Kiran Subbaraman
Am assuming you are aware of the Amazon SNS APIs, and what it takes to 
publish messages there (as a producer / publisher)
Do you want to read data from your database, and publish them to SNS on a:
* Regular scheduled basis?
* Whenever new data comes into the database?

In either case, I would use two web2py capabilities to do this - the 
`_on_insert/update/delete` callbacks[1] in conjunction with the web2py 
scheduler to publish to SNS.
The callback will help keep track of changes to the database (basically 
whenever the database data changes, these callbacks are called ... and you 
could record the changed value some place else ... maybe another table, or 
store). The scheduler would call the function that would read from this 
table/store and send this out to SNS.

Adjust the timing of the scheduler, depending on when you want to send out 
the messages.

[1] 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=insert#callbacks-on-record-insert--delete-and-update


On Tuesday, August 2, 2016 at 11:21:39 PM UTC+5:30, madhu nomula wrote:
>
> Hi All,
>
> We have implemented a tool in web2py tool.
>
> Now we have to implement sending the stored data(tables information) to 
> Amazon SNS.
>
> Can you please help me how to move the stored data to Amazon SNS.
>
> Thank you and appreciate your help in advance.
>
>
> Regards,
> MC
>

-- 
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] Web2py and WebRTC?

2016-08-02 Thread Ron Chatterjee
This may help. Its a django app. Someone needs to take a stab at this to 
convert into web2py. 

https://github.com/craigmadden/videochat



On Sunday, July 28, 2013 at 8:42:19 PM UTC-4, Vinicius Assef wrote:
>
> WebRTC has nothing to do with web2py. 
>
> It's a client specification, concerning basically audio and video 
> capturing and transmission. 
> It's accessed through javascript. 
>
> On Sun, Jul 28, 2013 at 9:37 PM, Ovidio Marinho  > wrote: 
> > you did this work in web2py?? you can publish the app? this is very 
> good? 
> > 
> > 
> > 
> > 
> >  Ovidio Marinho Falcao Neto 
> >   ITJP.NET.BR 
> >  ovid...@gmail.com  
> >83   8826 9088 - Oi 
> >83   9336 3782 - Claro 
> > Brasil 
> > 
> > 
> > 
> > 2013/7/28 Mika Sjöman  
> >> 
> >> Hi 
> >> 
> >> I would like the users of my website to communicate with video without 
> >> using Skype etc. I am currently using pythonanywhere as my host, and 
> they do 
> >> not permit using node.js, so I can not use 
> >> https://github.com/henrikjoreteg/SimpleWebRTC 
> >> 
> >> Is there any other way you guys know of that I could use to easily add 
> >> WebRTC to the webpage? Anyone wrote a plugin for that? Anything I 
> should 
> >> know before jumping into it? 
> >> 
> >> Cheers 
> >> 
> >> -- 
> >> 
> >> --- 
> >> 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/groups/opt_out. 
> >> 
> >> 
> > 
> > 
> > -- 
> > 
> > --- 
> > 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/groups/opt_out. 
> > 
> > 
>

-- 
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] list:integer and list:string not respecting show_if parameter, patch included

2016-08-02 Thread Tim Alexander
The subject line pretty much says it all, the list:integer and list:string
data types don't appear to respect the show_if parameter (from this

section
in the book). I needed them to, and had a workaround in js for a while, but
wanted to use all of the built-in web2py goodness for everything,
regardless of list data types (I'm using the list types in
sqlform.smartgrid already)

In brief, it comes down to the fact that the ID is different for list types
on the ul element containing each of the list items. Given a major priority
of web2py is backwards compatibility (one I highly appreciate),I wrote it
in a way that won't break existing CSS/JS/etc. for things referencing that
UL containing the list items. This is not exactly "clean" in my opinion,
but it's been running in my test environment for a few months with no
issues.

Even though though it takes 2 additional CSS selector lookups from jquery
to perform on each change of the monitored element, this handling should be
able to be reused for any additional data types that don't properly handle
the show_if situation, and the parent_tr reference can be used as a backup
for any future functionality that also has issues with cross-referencing
from the UL element to it's parent TR element. Note, I'm quite abysmal at
JS IMHO, though I can hack my way through it enough to be dangerous. So
there may be a better way to do this work than storing the parent element
name on the child as an attribute, then adding a fallthrough handler to
examine and select based upon said attribute. Given there doesn't exist a
parent reference in CSS (for good reason, performance wise), this is the
most efficient method I came up with in the 30 seconds I spent considering
before I wrote it.

I can work on forking and throwing a pull request up on github
if you prefer, and if someone can confirm
it's the "official home" of web2py code now. Might take me a short bit to
find the time to spin up a dev environment that's "clean" enough to do so,
but that's been on my todo list for a while. Otherwise the patch is
attached here for review.

You may also consider this my agreement to the Web2py Contributor Agreement
 (again
I think, though I don't entirely remember if the changes I made were to
web2py or some of the contrib libraries), unless you'd rather require I
upload a signed copy somewhere.

-- 
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.
diff -ur web2py_orig/applications/admin/static/js/web2py.js web2py/applications/admin/static/js/web2py.js
--- web2py_orig/applications/admin/static/js/web2py.js  2016-08-02 18:48:50.0 -0500
+++ web2py/applications/admin/static/js/web2py.js   2016-08-02 18:49:13.0 -0500
@@ -539,6 +539,7 @@
 for(var k = 0; k < triggers[id].length; k++) {
   var dep = $('#' + triggers[id][k], target);
   var tr = $('#' + triggers[id][k] + '__row', target);
+  if(!tr.length) tr = $('#' + $('#' + triggers[id][k], target).attr('parent_tr'), target);
   if(t.is(dep.attr('data-show-if'))) tr.slideDown();
   else tr.hide();
 }
diff -ur web2py_orig/gluon/sqlhtml.py web2py/gluon/sqlhtml.py
--- web2py_orig/gluon/sqlhtml.py2016-08-02 18:53:11.0 -0500
+++ web2py/gluon/sqlhtml.py 2016-08-02 18:33:04.0 -0500
@@ -296,6 +296,9 @@
   value=v, hideerror=k < len(nvalue) - 1,
   requires=requires),
 **attributes) for (k, v) in enumerate(nvalue)]
+default = dict(value=value)
+attributes = cls._attributes(field, default, **attributes)
+attributes['_parent_tr'] = attributes['_id'] + '__row'
 attributes['_id'] = _id + '_grow_input'
 attributes['_style'] = 'list-style:none'
 attributes['_class'] = 'w2p_list'

[web2py] Re: Host configuration

2016-08-02 Thread Dave S


On Tuesday, August 2, 2016 at 10:23:18 AM UTC-7, Gael Princivalle wrote:
>
> Hello.
>
> Someone can give some examples about the use of the Host configuration in 
> appconfig.ini?
>
> Thanks.
>

If your question is about the [host] block in appconfig.ini, the one 
setting in the block is 'name', which Niphlod says is used mainly for the 
'From' line in emails.


/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: Host configuration

2016-08-02 Thread Ron Chatterjee
I was thinking the same Gael. How we set up a web2py app if we get a brand 
new server and put that in a data center  or lets say in a dedicated server 
including scheduler.  

On Tuesday, August 2, 2016 at 1:23:18 PM UTC-4, Gael Princivalle wrote:
>
> Hello.
>
> Someone can give some examples about the use of the Host configuration in 
> appconfig.ini?
>
> 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: Upgrade from 2.5.1 to latest

2016-08-02 Thread Dave S


On Tuesday, August 2, 2016 at 1:09:39 PM UTC-7, Tito Garrido wrote:
>
> Hi Folks,
>
> I am trying to upgrade my web2py from 2.5.1 to latest and the appadmin 
> text editor breaks... I have tried to get appadmin.html, layout.hmt and 
> some js files from the Welcome app but it still complains:
>
> TypeError: editor is undefined
>
> var data = editor.getValue();
>
>
> What is the best way to upgrade from 2.5.1 to latest?
>

Short answer:  use the admin application to "create" New Simple 
Application, and replace the controllers (except appadmin.py) and views 
with the ones from your existing app.

My backlist here only goes to 2.9.12, and I'm not sure where the editor 
lives.

/dps


> Regards,
>
> Tito
>
>
> -- 
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>

-- 
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: jquery-pjax

2016-08-02 Thread Dave S


On Tuesday, August 2, 2016 at 12:04:08 PM UTC-7, Ricardo Pedroso wrote:
>
> On 8/2/16, António Ramos  wrote: 
> > any demo with web2py? 
>
> I'm using it at http://missportuguesa.pt in a simple way. 
>
> [detailed example]
>

Thanks, your code looks good (clear!) and the pjax readme at the github 
site is also straightforward (he says before trying it).

The Mozilla pages on the history API seem like good background reading, so 
that us borrowers have a clue what's happening under the hood.

They link to an example; a couple of other simple examples are at


(My history now includes "developer.mozzilla.org/dangit" from opening the 
console, and typing the obvious "history.pushstate(null, null, '/dangit'))

/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] Upgrade from 2.5.1 to latest

2016-08-02 Thread Tito Garrido
Hi Folks,

I am trying to upgrade my web2py from 2.5.1 to latest and the appadmin text
editor breaks... I have tried to get appadmin.html, layout.hmt and some js
files from the Welcome app but it still complains:

TypeError: editor is undefined

var data = editor.getValue();


What is the best way to upgrade from 2.5.1 to latest?

Regards,

Tito


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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: jquery-pjax

2016-08-02 Thread Ricardo Pedroso
On 8/2/16, António Ramos  wrote:
> any demo with web2py?

I'm using it at http://missportuguesa.pt in a simple way.


in my first model file:

request.pjax = True if request.env.get('HTTP_X_PJAX') == 'true' else False


In layout.html:



(...)

  Home
  Some page

(...)

{{ block content }} {{ include }} {{ end }}

(...)
  
  $(document).ready(function() {
$(document).pjax('a[data-pjax]', '#pjax-container')
  })




In default/index.html:
  {{ extend 'layout.html' if not request.pjax else None }}
  {{ block content }}
 {{ # Here in all links I put a data-pjax attribute }}
 https://github.com/defunkt/jquery-pjax/issues/560
   * 
http://stackoverflow.com/questions/9696119/where-to-put-the-page-initialize-javascript-when-using-pjax

- Using {{ extend 'layout.html' if not request.pjax else None }} in
views you cannot compile views


Ricardo

-- 
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 tool : Send emails to multiple user on schedule basis

2016-08-02 Thread Dave S


On Tuesday, August 2, 2016 at 10:51:36 AM UTC-7, madhu nomula wrote:
>
> Hi All,
>
> I need help on below requirement.
>
> We have implemented Time sheet  logging tool for users in web2py tool.
>
> Now the requirement is to send email notifications to the users of tool, 
> to enter time sheet and submit.
> This email has to be sent for all users from 1 to 15 days of month and 16 
> to 30 days of month till the user submits time sheets.
>

I am not sure what you mean here ... That twice a month you start nagging 
the users?  That's the easiest interpretation.  Also, I think, easy to do 
... see below.
 

>
> Please suggest, how can I schedule this sending emails option in Web2Py 
> tool.
>

I recommend using the built-in scheduler.  This looks something like:
(read about it at 
)
(and note that this is untested, but based on my own scheduler usage and 
comments in this forum by Niphlod)

in your model file (scheduler.py is a good name)
# define scheduler task
   def send_nags(first_reminder = False):
  if first_reminder or now.date in [1, 16]:
db(db.staff.ALL).update(curts_recd = False)
  mail = auth.settings.mailer 
  query = db.staff.curts_recd == False
  rows = db(query)
  for row in rows:
msg = compose_reminder(row.id, ...)
mail.send(to=row.email, reply_to="payroll@mybiz", message = msg)

# instantiate Scheduler class
from gluon.scheduler.import Scheduler
scheduler = Scheduler(db)


In one of your controller files:
# schedule recurring tasks:
def sched_tasks(arg1=""):
  # arg1 keeps this from being expose as a web page
  # instantiate Scheduler class
  from gluon.scheduler.import Scheduler
  scheduler = Scheduler(db)
  task = scheduler.queue_task("send_nags", period = 86400, repeats=1)
  # show on console, or add to log
  print task
  db.commit()

# also add as needed
def stop_tasks(arg1=""):
  # arg1 keeps this from being expose as a web page
  # instantiate Scheduler class
  from gluon.scheduler.import Scheduler
  scheduler = Scheduler(db)
  task = scheduler.task_status(db.scheduler_task.task_name == 'send_nags')
  if hasattr(task, "status") and task.status in ["QUEUED", "RUNNING"]:
 stop = scehduler.stop_task(task.uuid)
 # show on console or add to log
 print cue
 db.commit()




Use  these from the command line like this:
web2py.py -M -S uploader/default/sched_tasks 
or
web2py.py -M -S uploader/default/stop_tasks 

(and of course, you've used the -K option earlier to start the scheduler 
... you can add this to the startup sequence for your webserver)

 See
   
for more details.


-- 
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: problem with import type field data

2016-08-02 Thread Dave S


On Tuesday, August 2, 2016 at 10:21:01 AM UTC-7, dfpro...@gmail.com wrote:
>
> no help ?


Sorry, I didn't see anything on my first look, so I was waiting for someone 
else to chime in.

The symptoms in the message with the sample aren't quite the same as in the 
original post.  Are you getting the same error message?  If you are, what 
have you done to confirm that it is the date field that is in error?

Please post your define_table() for this .. that's a lot of fields to do by 
eyeballing.

/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] Web2py tool : Send emails to multiple user on schedule basis

2016-08-02 Thread madhu nomula
Hi All,

I need help on below requirement.

We have implemented Time sheet  logging tool for users in web2py tool.

Now the requirement is to send email notifications to the users of tool, to 
enter time sheet and submit.
This email has to be sent for all users from 1 to 15 days of month and 16 
to 30 days of month till the user submits time sheets.

Please suggest, how can I schedule this sending emails option in Web2Py 
tool.

Thank you and appreciate your help in advance.

Regards,
Madhu Chandar Nomula.

-- 
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] Web2Py tool: Amazon SNS integration

2016-08-02 Thread madhu nomula
Hi All,

We have implemented a tool in web2py tool.

Now we have to implement sending the stored data(tables information) to 
Amazon SNS.

Can you please help me how to move the stored data to Amazon SNS.

Thank you and appreciate your help in advance.


Regards,
MC

-- 
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: jquery-pjax

2016-08-02 Thread António Ramos
any demo with web2py?

2016-06-18 14:04 GMT+01:00 Massimo Di Pierro :

> Nice library.  It is a lot like web2py components but better. Perhaps
> web3py should use pjax.js
>
>
> On Tuesday, 14 June 2016 09:48:44 UTC-5, Niphlod wrote:
>>
>> great, simple, done.
>>
>> On Tuesday, June 14, 2016 at 2:34:22 PM UTC+2, Carlos Cesar Caballero
>> wrote:
>>>
>>> Hi everyone, have you any experience with
>>> https://github.com/defunkt/jquery-pjax and web2py? it looks really
>>> interesting.
>>>
>>> Greetings.
>>>
>>> --
>>> Este mensaje le ha llegado mediante el servicio de correo electronico
>>> que ofrece Infomed para respaldar el cumplimiento de las misiones del
>>> Sistema Nacional de Salud. La persona que envia este correo asume el
>>> compromiso de usar el servicio a tales fines y cumplir con las regulaciones
>>> establecidas
>>>
>>> Infomed: http://www.sld.cu/
>>>
>>> --
> 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] Host configuration

2016-08-02 Thread Gael Princivalle
Hello.

Someone can give some examples about the use of the Host configuration in 
appconfig.ini?

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: problem with import type field data

2016-08-02 Thread dfprojects
no help ?

-- 
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.